extract
The extract command creates a minimal, shareable version of your agent by stripping away deployment infrastructure while preserving your core agent logic. This is useful for sharing agents, creating starter templates, or distributing agent code without the full project scaffolding.
Usage
bash
uvx agent-starter-pack extract OUTPUT_PATH [OPTIONS]Arguments
OUTPUT_PATH(required): Path where the extracted agent will be created
Options
| Option | Default | Description |
|---|---|---|
--source, -s | . (current directory) | Source project directory |
--dry-run | false | Show what would be extracted without making changes |
--force, -f | false | Overwrite output directory if it exists |
--debug | false | Enable debug logging |
Examples
Basic Extraction
bash
# Extract current project to a new directory
uvx agent-starter-pack extract ../my-agent-share
# Extract from a specific source directory
uvx agent-starter-pack extract ./shared-agent --source /path/to/projectPreview Changes
bash
# See what would be extracted without making changes
uvx agent-starter-pack extract ../my-agent-share --dry-runOverwrite Existing
bash
# Force overwrite if output directory exists
uvx agent-starter-pack extract ../my-agent-share --forceWhat Gets Extracted
The extract command preserves your core agent code while removing deployment scaffolding:
Kept (Agent Code):
- Agent directory (e.g.,
app/) with youragent.pyand custom modules pyproject.toml(with scaffolding dependencies removed).gitignoreGEMINI.md(if present)
Removed (Scaffolding):
deployment/- Terraform infrastructure.github/or.cloudbuild/- CI/CD pipelinesfrontend/- UI componentsdata_ingestion/- Data pipeline codenotebooks/- Jupyter notebookstests/- Test filestools/- Build tools- Scaffolding files in agent directory (
fast_api_app.py,agent_engine_app.py,app_utils/)
Generated:
- Minimal
Makefilewith basic commands (install,playground,lint) - Simplified
README.mdfor the extracted project
How It Works
- Detects project language (Python or Go) from project files
- Reads ASP metadata from
pyproject.tomlor.asp.toml - Copies agent code excluding scaffolding files
- Strips scaffolding dependencies from
pyproject.toml - Generates minimal Makefile and README for standalone use
- Regenerates lock file (
uv lockorgo mod tidy)
Relationship to enhance
The extract and enhance commands are complementary:
Full Project ──extract──> Minimal Agent ──enhance──> Full Project- extract: Remove scaffolding to create a shareable, minimal agent
- enhance: Add scaffolding back to restore production capabilities
This workflow enables:
- Sharing: Extract your agent, share it with others
- Receiving: Others run
enhanceto add their own deployment infrastructure - Customization: Recipients can choose different deployment targets, CI/CD runners, etc.
Example Workflow
bash
# 1. Create a full project
uvx agent-starter-pack create my-agent -a adk -d cloud_run
# 2. Develop your agent...
cd my-agent
# ... edit app/agent.py ...
# 3. Extract for sharing
uvx agent-starter-pack extract ../my-agent-share
# 4. Share the extracted agent (e.g., push to GitHub)
cd ../my-agent-share
git init && git add . && git commit -m "Initial agent"
# 5. Recipients can enhance with their own preferences
uvx agent-starter-pack enhance --deployment-target agent_engineLanguage Support
The extract command supports both Python and Go projects:
| Language | Config File | Lock Command |
|---|---|---|
| Python | pyproject.toml | uv lock |
| Go | .asp.toml | go mod tidy |
Language is auto-detected from project files.