From 851622d4e7e4c06f3b0f0066a121fac20cf4ce40 Mon Sep 17 00:00:00 2001 From: Dorian Date: Sat, 14 Mar 2026 05:47:29 +0000 Subject: [PATCH] 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) --- scripts/archy-dev/archy-dev | 65 +++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 scripts/archy-dev/archy-dev diff --git a/scripts/archy-dev/archy-dev b/scripts/archy-dev/archy-dev new file mode 100755 index 00000000..e82bac07 --- /dev/null +++ b/scripts/archy-dev/archy-dev @@ -0,0 +1,65 @@ +#!/usr/bin/env bash +# archy-dev — Archipelago App Developer CLI +# Usage: +# archy-dev create — scaffold a new app manifest +# archy-dev validate — validate manifest (calls validate-app-manifest.sh) +# archy-dev test — test app in sandbox container +# archy-dev publish — 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 }" + 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 }" + exec "${SCRIPT_DIR}/../validate-app-manifest.sh" "$MANIFEST" + ;; + test) + MANIFEST="${1:?Usage: archy-dev test }" + 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 Scaffold a new app manifest" + echo " validate Validate a manifest file" + echo " test Test app in sandbox (future)" + echo " publish Publish to marketplace (future)" + ;; + *) + echo "Unknown command: $CMD" + echo "Run: archy-dev help" + exit 1 + ;; +esac