feat(cli): agent templates with spawn export and --repo#3350
Closed
AhmedTMM wants to merge 4 commits intoOpenRouterTeam:mainfrom
Closed
feat(cli): agent templates with spawn export and --repo#3350AhmedTMM wants to merge 4 commits intoOpenRouterTeam:mainfrom
AhmedTMM wants to merge 4 commits intoOpenRouterTeam:mainfrom
Conversation
Adds the ability to share agent setups as templates: - `spawn export` — SSHes into a running spawn, scans installed MCP servers, CLI auths, and tools, generates a spawn.md recipe (no secrets), pushes to GitHub, and prints a shareable one-liner command - `spawn <agent> <cloud> --repo user/repo` — clones the template repo onto the provisioned VM, reads spawn.md, merges built-in steps, guides the user through custom auth (OAuth, CLI login, API keys), installs MCP servers, runs setup commands, and launches the agent in the project directory - spawn.md format supports built-in steps (github, auto-update, browser) and custom setup steps (oauth, cli_auth, api_key, command) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Steps like github, auto-update, browser belong in the shareable --steps flag, not in spawn.md. spawn.md now only handles custom setup (OAuth, CLI auth, API keys, MCP servers, setup commands). The exported command now looks like: spawn claude digitalocean --repo user/repo --steps github,auto-update Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
|
Rebased onto
Verification:
-- refactor/pr-maintainer |
# Conflicts: # packages/cli/package.json # packages/cli/src/shared/orchestrate.ts
`spawn export` now publishes ~/project as a real working-folder snapshot
of a running spawn:
- MCP scan reads from ~/.claude/settings.json, ~/.claude.json,
~/.cursor/mcp.json, ~/.codex/config.toml, and ~/.openclaw/openclaw.json
(with hand-rolled Codex TOML parsing); entries are deduped by name and
env values are replaced with ${NAME} placeholders.
- CLI auth scan covers GitHub, GitLab, AWS, gcloud, Azure, DO, Hetzner,
Vercel, Netlify, Fly, Heroku, Railway, Render, Shopify, Stripe,
Firebase, Supabase, Cloudflare, Pulumi, Docker, npm, Turso, Neon,
PlanetScale, 1Password, ngrok. One batched SSH probe replaces
N round-trips.
- rsync exclude list expanded to filter common secret/key files
(.ssh, .aws, .gnupg, *.pem, *.key, terraform state, etc.) and a
post-rsync content scan flags inline secrets (PEM keys, GitHub PATs,
Slack/Stripe/AWS/Google API keys) before push.
- Repo visibility prompt defaults to private.
Replay-side fixes:
- installMcpServersFromTemplate routes through skills.ts helpers (no
more `node -e` injection); adds Codex TOML support.
- launchCmd `cd ~/project` now gates on actual clone success, not the
--repo flag — invalid slugs no longer break agent boot.
- api_key var name regex no longer strips lowercase letters.
Bumps CLI to 1.0.23.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Member
|
Rebased onto
Verification:
-- refactor/pr-maintainer |
Member
|
Rebased on main — merge conflict resolved. Lint clean, tests pass (2 pre-existing failures unrelated to this PR). -- refactor/pr-maintainer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
spawn export— SSHes into a running spawn, scans installed MCP servers, CLI auths, and tools, generates aspawn.mdrecipe (no secrets), pushes to GitHub, and prints a shareable one-linerspawn <agent> <cloud> --repo user/repo— clones the template repo onto the VM, readsspawn.md, merges built-in steps, guides through custom auth (OAuth, CLI login, API keys), installs MCP servers, runs setup commands, and launches in the project directoryspawn.mdformat supports built-insteps(github, auto-update, browser) and customsetupsteps (oauth, cli_auth, api_key, command)New files
packages/cli/src/shared/spawn-md.ts— YAML frontmatter parser, valibot schemas, spawn.md generation/applicationpackages/cli/src/commands/export.ts— export command (VM scan, repo creation, shareable link)Modified files
packages/cli/src/index.ts—--repoflag extraction,exportcommand dispatchpackages/cli/src/shared/orchestrate.ts— repo clone + spawn.md application in postInstallpackages/cli/src/flags.ts— added--repoto KNOWN_FLAGSpackages/cli/src/commands/help.ts— updated help textpackages/cli/src/commands/index.ts— barrel exportpackages/cli/package.json— version bump to 0.28.0Test plan
bunx @biomejs/biome check src/— zero errorsbun test— 1951 pass (1 pre-existing failure unrelated)spawn claude digitalocean --repo user/repospawn exporton a running spawn🤖 Generated with Claude Code