feat: add archy-dev CLI scaffold for app developers

Commands: create (scaffold manifest), validate (check manifest),
test/publish (stubs for future). Complements existing archy-dev.sh.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-14 05:47:29 +00:00
parent b4588867af
commit 855b3c5209

65
scripts/archy-dev/archy-dev Executable file
View File

@@ -0,0 +1,65 @@
#!/usr/bin/env bash
# archy-dev — Archipelago App Developer CLI
# Usage:
# archy-dev create <app-id> — scaffold a new app manifest
# archy-dev validate <manifest> — validate manifest (calls validate-app-manifest.sh)
# archy-dev test <manifest> — test app in sandbox container
# archy-dev publish <manifest> — publish to marketplace (future)
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
CMD="${1:-help}"
shift || true
case "$CMD" in
create)
APP_ID="${1:?Usage: archy-dev create <app-id>}"
MANIFEST_DIR="apps/${APP_ID}"
mkdir -p "$MANIFEST_DIR"
cat > "${MANIFEST_DIR}/manifest.yml" << YAML
id: ${APP_ID}
title: "${APP_ID^}"
version: "1.0.0"
description: "Description of ${APP_ID}"
author: "Your Name"
image: "docker.io/library/${APP_ID}:1.0.0"
ports:
- "8080:80"
environment: {}
memory: "256m"
# Security: these are enforced by Archipelago
# privileged: false (always)
# cap_drop: ALL (always)
# no_new_privileges: true (always)
YAML
echo "Created ${MANIFEST_DIR}/manifest.yml"
echo "Next: edit the manifest, then run: archy-dev validate ${MANIFEST_DIR}/manifest.yml"
;;
validate)
MANIFEST="${1:?Usage: archy-dev validate <manifest.yml>}"
exec "${SCRIPT_DIR}/../validate-app-manifest.sh" "$MANIFEST"
;;
test)
MANIFEST="${1:?Usage: archy-dev test <manifest.yml>}"
echo "Sandbox testing not yet implemented."
echo "For now, validate with: archy-dev validate $MANIFEST"
;;
publish)
echo "Marketplace publishing not yet implemented."
echo "Submit your app via PR to the Archipelago repository."
;;
help|--help|-h|"")
echo "archy-dev — Archipelago App Developer CLI"
echo ""
echo "Commands:"
echo " create <app-id> Scaffold a new app manifest"
echo " validate <manifest> Validate a manifest file"
echo " test <manifest> Test app in sandbox (future)"
echo " publish <manifest> Publish to marketplace (future)"
;;
*)
echo "Unknown command: $CMD"
echo "Run: archy-dev help"
exit 1
;;
esac