CLI Commands Reference: Complete Command List and Parameters
This chapter provides a complete command reference for the Agent App Factory CLI tool.
Command Overview
| Command | Function | Use Case |
|---|---|---|
factory init | Initialize Factory project | Start a new project |
factory run [stage] | Run pipeline | Execute or continue pipeline |
factory continue | Continue in new session | Save tokens, execute across sessions |
factory status | View project status | Understand current progress |
factory list | List all projects | Manage multiple projects |
factory reset | Reset project state | Restart pipeline |
factory init
Initialize the current directory as a Factory project.
Syntax
factory init [options]Parameters
| Parameter | Short | Type | Required | Description |
|---|---|---|---|---|
--name | -n | string | No | Project name |
--description | -d | string | No | Project description |
Functionality
After executing the factory init command, the following actions are performed:
- Check directory security (only allows
.git,.gitignore,README.mdand other config files) - Create
.factory/directory - Copy the following files to
.factory/:agents/- Agent definition filesskills/- Skill modulespolicies/- Policy documentstemplates/- Configuration templatespipeline.yaml- Pipeline definition
- Generate
config.yamlandstate.json - Generate
.claude/settings.local.json(Claude Code permission configuration) - Attempt to install required plugins:
- superpowers (needed for Bootstrap stage)
- ui-ux-pro-max-skill (needed for UI stage)
- Automatically launch AI assistant (Claude Code or OpenCode)
Examples
Initialize project with name and description:
factory init --name "Todo App" --description "一个简单的待办事项应用"Initialize project in current directory:
factory initNotes
- Directory must be empty or contain only config files (
.git,.gitignore,README.md) - If
.factory/directory already exists, you will be prompted to usefactory resetto reset
factory run
Run the pipeline, starting from the current stage or a specified stage.
Syntax
factory run [stage] [options]Parameters
| Parameter | Short | Type | Required | Description |
|---|---|---|---|---|
stage | - | string | No | Pipeline stage name (bootstrap/prd/ui/tech/code/validation/preview) |
Options
| Option | Short | Type | Description |
|---|---|---|---|
--force | -f | flag | Skip confirmation prompt |
Functionality
After executing the factory run command, the following actions are performed:
- Check if it's a Factory project
- Read
config.yamlandstate.json - Display current pipeline status
- Determine target stage (specified by parameter or current stage)
- Detect AI assistant type (Claude Code / Cursor / OpenCode)
- Generate execution instructions for the corresponding assistant
- Display available stage list and progress
Examples
Run pipeline starting from bootstrap stage:
factory run bootstrapContinue running from current stage:
factory runSkip confirmation and run directly:
factory run bootstrap --forceOutput Example
Agent Factory - Pipeline Runner
Pipeline Status:
────────────────────────────────────────
Project: Todo App
Status: Running
Current Stage: bootstrap
Completed:
🤖 Claude Code Instructions:
───────────────────────────
This is an Agent Factory project. To execute the pipeline:
1. Read pipeline definition:
Read(/path/to/.factory/pipeline.yaml)
2. Read orchestrator agent:
Read(/path/to/.factory/agents/orchestrator.checkpoint.md)
3. Read project config:
Read(/path/to/.factory/config.yaml)
Then execute the pipeline starting from: bootstrap
────────────────────────────────────────
Available stages:
○ bootstrap
○ prd
○ ui
○ tech
○ code
○ validation
○ preview
────────────────────────────────────────
Ready! Follow instructions above to continue.factory continue
Create a new session to continue executing the pipeline, saving tokens.
Syntax
factory continueFunctionality
After executing the factory continue command, the following actions are performed:
- Check if it's a Factory project
- Read
state.jsonto get current state - Regenerate Claude Code permission configuration
- Launch a new Claude Code window
- Continue execution from current stage
Use Cases
- Avoid token accumulation after each stage completion
- Each stage gets a clean context
- Support interruption recovery
Examples
Continue executing pipeline:
factory continueNotes
- Requires Claude Code to be installed
- Will automatically launch a new Claude Code window
factory status
Display detailed status of the current Factory project.
Syntax
factory statusFunctionality
After executing the factory status command, the following is displayed:
- Project name, description, path, creation time
- Pipeline status (idle/running/waiting_for_confirmation/paused/failed/completed)
- Current stage
- List of completed stages
- Progress of each stage
- Input file status (input/idea.md)
- Artifacts directory status (artifacts/)
- Number and size of artifact files
Examples
factory statusOutput Example
Agent Factory - Project Status
Project:
Name: Todo App
Description: 一个简单的待办事项应用
Path: /Users/user/Projects/todo-app
Created: 2026-01-29T10:00:00.000Z
Pipeline:
Status: Running
Current Stage: prd
Completed: bootstrap
Progress:
✓ bootstrap
→ prd
○ ui
○ tech
○ code
○ validation
○ preview
Input:
File: input/idea.md
Lines: 25
Preview:
# Todo App
一个简单的待办事项应用...
Artifacts:
✓ prd (3 files, 12.5 KB)
────────────────────────────────────────
Commands:
factory run - Run pipeline
factory run <stage> - Run from stage
factory reset - Reset pipeline statefactory list
List all Factory projects.
Syntax
factory listFunctionality
After executing the factory list command, the following actions are performed:
- Search common project directories (
~/Projects,~/Desktop,~/Documents,~) - Search current directory and its parent directories (up to 3 levels)
- List all projects containing
.factory/directory - Display project status (sorted by running, waiting, failed, completed)
Examples
factory listOutput Example
Agent Factory - Projects
Found 2 project(s):
◉ Todo App
一个简单的待办事项应用
Path: /Users/user/Projects/todo-app
Stage: prd
○ Blog System
博客系统
Path: /Users/user/Projects/blog
Completed: bootstrap
────────────────────────────────────────
Work on a project: cd <path> && factory runfactory reset
Reset the current project's pipeline state, preserving artifacts.
Syntax
factory reset [options]Options
| Option | Short | Type | Description |
|---|---|---|---|
--force | -f | flag | Skip confirmation |
Functionality
After executing the factory reset command, the following actions are performed:
- Check if it's a Factory project
- Display current status
- Confirm reset (unless using
--force) - Reset
state.jsonto initial state - Update pipeline section of
config.yaml - Preserve all
artifacts/artifacts
Use Cases
- Restart from bootstrap stage
- Clear state errors
- Reconfigure pipeline
Examples
Reset project state:
factory resetSkip confirmation and reset directly:
factory reset --forceNotes
- Only resets pipeline state, artifacts are not deleted
- To completely delete a project, manually delete
.factory/andartifacts/directories
Appendix: Source Code Reference
Click to expand source code locations
Last updated: 2026-01-29
| Command | File Path | Line Number |
|---|---|---|
| CLI Entry | cli/bin/factory.js | 17-122 |
| init command | cli/commands/init.js | 1-457 |
| run command | cli/commands/run.js | 1-335 |
| continue command | cli/commands/continue.js | 1-144 |
| status command | cli/commands/status.js | 1-203 |
| list command | cli/commands/list.js | 1-160 |
| reset command | cli/commands/reset.js | 1-100 |
Key Functions:
getFactoryRoot()- Get Factory root directory (factory.js:22-52)isFactoryProject()- Check if it's a Factory project (init.js:22-26)generateConfig()- Generate project configuration (init.js:58-76)launchClaudeCode()- Launch Claude Code (init.js:119-147)launchOpenCode()- Launch OpenCode (init.js:152-215)detectAIAssistant()- Detect AI assistant type (run.js:105-124)updateState()- Update pipeline state (run.js:94-100)
Dependencies:
commander- CLI argument parsingchalk- Terminal colored outputora- Loading animationinquirer- Interactive promptsyaml- YAML file parsingfs-extra- File system operations