Search docs

CLI reference

spawn create

Create projects from supported templates or a custom structure.

spawn create#

Creates a new project directory, writes starter files, installs dependencies, and optionally runs git init and uv init.

Contract

  • Arguments: none. Options and defaults are in the flag table under Non-interactive mode (--git, --uv, --no-claude-md, --license mit).
  • Success: the project is created in ./<name>, a success panel is shown, exit code 0. --dry-run validates and prints the resolved config, writes nothing, exit code 0.
  • Failure: ❌ message is printed and the command exits non-zero (see Exit codes). A partially written project directory is removed.
  • Filesystem: writes only a new directory ./<name>. It fails if that directory already exists (exit 3) and never modifies existing files.

Interactive mode#

Run with no flags to enter the arrow-key prompt flow:

bash
spawn create

Prompt sequence

Step Prompt When shown
1 Project Name Always
2 Choose a template Always
3 Choose CLI Type CLI Application only
4 Choose Project Type Data Project only
5 Choose Framework Backend API, CLI Application, AI Chatbot, AI Agent
6 Choose Provider AI Chatbot, AI Agent (filtered by framework)
7 Select extras Templates with available extras
8 Choose a license Always (MIT, None)
9 Initialize Git? [Y/n] Always
10 Also generate CLAUDE.md for Claude Code? [y/N] Always
11 Publish to GitHub? [y/N] Only when Git was enabled and not in non-interactive mode

Every menu (steps 2–8) is arrow-key / spacebar driven — no typed numbers.

Template list

text
? Choose a template (Use arrow keys)
 » Backend API
   CLI Application
   Automation Tool
   AI Chatbot
   AI Agent
   RAG System
   Data Project
   MCP Server
   Custom Structure

Extras selection (checkbox)

text
? Select extras (space to toggle, enter to confirm)
 ● ruff
 ● pytest
 ○ docker
 ○ github-actions
 ○ pre-commit
 ○ mypy

Space toggles, Enter confirms. Empty selection is valid (skip all extras).

Project Name validation

Rule Detail
Allowed characters Letters, numbers, hyphens (-), underscores (_)
Required At least one letter or digit
Rejected examples my project (space), my/project (slash), --- (no alphanumeric)

Non-interactive mode#

Pass --name to skip all prompts. --template is required when using --name.

bash
spawn create --name my-api --template backend-api --framework fastapi --extras ruff,pytest --license mit

Pass --config to read settings from a JSON file instead of flags:

bash
spawn create --config spawn.json

--config takes precedence over individual flags. The JSON file may contain:

json
{
  "name": "my-api",
  "template": "backend-api",
  "framework": "fastapi",
  "provider": null,
  "cli_type": null,
  "data_type": null,
  "extras": ["ruff", "pytest"],
  "license": "mit",
  "git": true,
  "uv": true,
  "claude_md": false
}

All spawn create flags

Flag Default Description
--name — Project name. Setting this enables non-interactive mode.
--template — Template slug (see table below). Required with --name.
--framework first available Framework for templates that support it
--provider first available AI provider for chatbot/agent templates
--cli-type utility utility or interactive (CLI Application only)
--data-type Data Analysis Sub-type for Data Project
--extras none Comma-separated extras, e.g. ruff,pytest
--license mit Project license (mit or none)
--git / --no-git --git Initialize a Git repository
--uv / --no-uv --uv Initialize uv and install dependencies. With --no-uv, extras that need pyproject.toml are skipped (one yellow "Skipped without uv" line lists them); file-only extras such as pre-commit are still written
--claude-md / --no-claude-md --no-claude-md Also write CLAUDE.md alongside AGENTS.md
--config — Path to a JSON config file. Takes precedence over other flags; an explicit --no-git/--no-uv is ignored with a yellow warning
--yes / -y false Skip the GitHub publish prompt
--dry-run false Validate and print the config without creating anything

Template slugs

Slug Display name Frameworks Providers CLI types Project types Extras
backend-api Backend API fastapi, flask, django — — — ruff, pytest, docker, github-actions, pre-commit, mypy
cli CLI Application typer, click, argparse — utility, interactive — ruff, pytest, github-actions, pre-commit, mypy
automation Automation Tool — — — — ruff, pytest, github-actions, pre-commit, mypy
chatbot AI Chatbot pydantic-ai, openai-sdk, litellm openai, anthropic, gemini, openrouter, ollama, groq — — ruff, pytest, rich, github-actions, pre-commit, mypy
agent AI Agent pydantic-ai, openai-agents openai, anthropic, gemini, openrouter, ollama, groq — — ruff, pytest, github-actions, pre-commit, mypy
rag RAG System — — — — ruff, pytest, github-actions, pre-commit, mypy
data Data Project — — — Data Analysis, Dashboard, ETL Pipeline, Machine Learning ruff, pytest, github-actions, pre-commit, mypy
mcp MCP Server — — — — ruff, pytest, github-actions, pre-commit, mypy

Provider options are filtered per framework: openai-sdk supports openai, gemini, openrouter, and groq (anthropic and ollama are excluded). openai-agents supports openai and openrouter.

Custom Structure is interactive-only. It is not available via --template.


Per-template prompt flows#

Backend API#

text
? Choose a framework (Use arrow keys)
 » fastapi
   flask
   django

? Select extras (space to toggle, enter to confirm)
 ○ ruff
 ○ pytest
 ○ docker
 ○ github-actions
 ○ pre-commit
 ○ mypy
Framework Run command
fastapi uv run uvicorn app.main:app --reload
flask uv run python run.py
django uv run python manage.py runserver

CLI Application#

text
? Choose CLI Type (Use arrow keys)
 » utility
   interactive

? Choose a framework (Use arrow keys)
 » typer
   click
   argparse

? Select extras (space to toggle, enter to confirm)
 ○ ruff
 ○ pytest
 ○ github-actions
 ○ pre-commit
 ○ mypy
CLI type Run command
utility uv run python -m src.main hello
interactive uv run python -m src.main greet

Automation Tool#

text
? Select extras (space to toggle, enter to confirm)
 ○ ruff
 ○ pytest
 ○ github-actions
 ○ pre-commit
 ○ mypy

Run: uv run python -m src.main


AI Chatbot#

text
? Choose a framework (Use arrow keys)
 » pydantic-ai
   openai-sdk
   litellm

? Choose a provider (Use arrow keys)
 » openai
   anthropic   ← pydantic-ai, litellm
   gemini
   openrouter
   ollama      ← pydantic-ai, litellm
   groq

? Select extras (space to toggle, enter to confirm)
 ○ ruff
 ○ pytest
 ○ rich
 ○ github-actions
 ○ pre-commit
 ○ mypy

Run: add provider API key to .env, then uv run python -m src.main


AI Agent#

text
? Choose a framework (Use arrow keys)
 » pydantic-ai
   openai-agents

? Choose a provider (Use arrow keys)
 » openai
   anthropic   ← pydantic-ai only
   ...

? Select extras (space to toggle, enter to confirm)
 ○ ruff
 ○ pytest
 ○ github-actions
 ○ pre-commit
 ○ mypy

Run: add provider API key to .env, then uv run python -m src.main


RAG System#

No framework or provider prompt. Requires OPENAI_API_KEY in .env.

text
? Select extras (space to toggle, enter to confirm)
 ○ ruff
 ○ pytest
 ○ github-actions
 ○ pre-commit
 ○ mypy

Run: uv run python -m src.main (auto-ingests data/ on first run)


Data Project#

text
? Choose Project Type (Use arrow keys)
 » Data Analysis
   Dashboard
   ETL Pipeline
   Machine Learning

? Select extras (space to toggle, enter to confirm)
 ○ ruff
 ○ pytest
 ○ github-actions
 ○ pre-commit
 ○ mypy
Type Run command
Data Analysis uv run jupyter notebook
Dashboard uv run streamlit run dashboard/app.py
ETL Pipeline uv run python -m pipelines.run
Machine Learning uv run python src/train.py

MCP Server#

No framework or provider prompt.

text
? Select extras (space to toggle, enter to confirm)
 ○ ruff
 ○ pytest
 ○ github-actions
 ○ pre-commit
 ○ mypy

Run: uv run python -m src.server (waits on stdio for an MCP client to connect)


Custom Structure#

The last option in the template picker. After selecting it, Spawn switches to a different flow:

  1. Paste your folder/file layout (Tree, Markdown list, or Indented format) then Ctrl+D
  2. Spawn previews the detected folder/file count
  3. Initialize Git? [Y/n]
  4. Also generate CLAUDE.md for Claude Code? [y/N]
  5. Initialize uv? [Y/n]
  6. (if uv) Dependencies (comma separated, optional):
  7. (if uv) Optional Setup checkbox — Ruff, Pytest, Pre-commit, Dockerfile, Mypy
  8. Additional ignore patterns (optional, comma separated):
  9. Proceed? [Y/n]

If the pasted structure contains a README.md or .gitignore entry, Spawn populates those files with generated content instead of leaving them empty.


Generated files (every project)#

Every generated project includes:

File Contents
README.md Template-specific content with project name, structure, setup, and run instructions
AGENTS.md Agent context file with project structure, setup, and conventions
CHANGELOG.md Keep a Changelog starter documenting the initial release
LICENSE MIT license (when --license mit, the default)
.gitignore Python defaults (.venv/, __pycache__/, .pytest_cache/, .mypy_cache/, .ruff_cache/, etc.)
.spawn/meta.json intent, framework, provider, spawn_version, created_at, generator, git, uv, source

If --claude-md was passed (or "claude_md": true in the config file), a CLAUDE.md file identical to AGENTS.md is also written.

.spawn/meta.json example:

json
{
  "intent": "backend-api",
  "framework": "fastapi",
  "provider": null,
  "spawn_version": "1.2.0",
  "created_at": "2026-01-01T00:00:00+00:00",
  "generator": "blueprint",
  "git": true,
  "uv": true,
  "source": null
}

GitHub publishing#

After a successful creation, if Git was enabled, Spawn asks:

text
Publish to GitHub? [y/N]: y
Repository URL: https://github.com/your-username/my-project

Supported URL formats: https://github.com/user/repo, https://github.com/user/repo.git, git@github.com:user/repo.git.

Spawn stages all files, creates the initial commit, renames the branch to main, adds the remote, and pushes.

The repository must already exist on GitHub. Spawn connects to it; it does not create it.

In non-interactive mode or when --yes / -y is passed, the publish prompt is skipped automatically.


Error cases#

All errors print ❌ message in red and exit with the code for their error class; any partial directory is deleted on failure. See Exit codes for the full table (for example: invalid input 1, usage error 2, existing destination 3, missing git/uv 4, generation error 5, Ctrl+C 130).

ESC