-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
Complete API reference for DoPlan CLI and generated projects.
DoPlan CLI provides several APIs:
- Command Line API - CLI commands and flags
- Generated Files API - Structure and format of generated files
- Agent System API - Agent definitions and interactions
- Rules System API - Rules library structure
- Extension API - Customization points
Description: Main DoPlan CLI command.
Usage:
doplan [flags]Flags:
-
--version, -v- Print version information and exit -
--help, -h- Show help information
Examples:
doplan # Run interactive wizard
doplan --version # Show version
doplan --help # Show helpExit Codes:
-
0- Success -
1- Error
Description: Zero-install wrapper command.
Usage:
npx @doplan-dev/cliBehavior:
- Downloads binary for your platform
- Runs DoPlan CLI
- No installation required
Format: Directory tree
Structure:
project-name/
├── .cursor/
│ ├── agents/
│ ├── commands/
│ └── rules/
├── .plan/
│ ├── 00_System/
│ ├── TASKS.md
│ └── active_state.json
├── .github/
│ └── workflows/
├── src/
└── [root files]
Format: JSON
Structure:
{
"phase": "idea|brainstorm|writing|approved|tasks|building",
"active_task": null | "task_id",
"completed": ["task_id", ...],
"locked": false | true
}Fields:
-
phase(string, required) - Current workflow phase -
active_task(string|null, optional) - Active task ID -
completed(array, required) - Completed task IDs -
locked(boolean, required) - Plan lock status
Example:
{
"phase": "building",
"active_task": "1.2",
"completed": ["1.1"],
"locked": true
}Format: Markdown
Structure:
# Agent Name
## Role
Brief role description
## System Prompt
Detailed persona and responsibilities
## Responsibilities
- Responsibility 1
- Responsibility 2Location: .cursor/agents/{name}.md
Required Fields:
-
# Agent Name- Agent title -
## Role- Role description -
## System Prompt- Agent persona
Format: Markdown
Structure:
# Command Name
## Trigger
Command trigger pattern
## Action
What happens when command is used
## Agent Involvement
- Agent 1
- Agent 2
## Files Read
- file1.md
- file2.md
## Files Modified
- file1.md
- file2.mdLocation: .cursor/commands/{name}.md
Required Fields:
-
# Command Name- Command title -
## Trigger- Trigger pattern -
## Action- Action description
Format: Markdown
Files:
-
IDEA.md- Project idea -
BRAINSTORM.md- Brainstorming results -
PRD.md- Product Requirements Document -
ARCHITECTURE.md- Technical Architecture -
DESIGN_SYSTEM.md- Design System
Location: .plan/00_System/
Structure: Free-form markdown (no strict format)
Format: Markdown
Structure:
# Tasks
## Phase 1: Description
**Goal**: Phase goal
### Task ID
**ID**: X.Y
**Description**: Task description
**Status**: Pending|In Progress|CompletedLocation: .plan/TASKS.md
Format: Markdown file
Required Sections:
-
# Agent Name- Agent title -
## Role- Role description -
## System Prompt- Agent persona
Optional Sections:
-
## Responsibilities- List of responsibilities -
## Current Project Context- Project-specific context
Trigger: Commands activate agents based on Agent Involvement section.
Process:
- Command file specifies agents
- Agents are loaded from
.cursor/agents/ - Agents receive context
- Agents execute their role
Format: Markdown
Structure:
# Rule Title
## Overview
Rule description
## Guidelines
- Guideline 1
- Guideline 2
## Examples
### Good
```code
// Good example// Bad example
**Location**: `.cursor/rules/library/{category}/{name}.md`
---
### Rule Categories
**Structure**: 15 numbered categories:
- `01-core-workflow/`
- `02-ai-agents/`
- `03-languages/`
- `04-frameworks/`
- `05-ui-libraries/`
- `06-cloud-infrastructure/`
- `07-databases/`
- `08-testing/`
- `09-devops-ci-cd/`
- `10-code-quality/`
- `11-documentation/`
- `12-security/`
- `13-development-practices/`
- `14-mcp-tools/`
- `15-project-specific/`
---
### Loading Rules
**Command**: `/load @library/{path}`
**Format**: `@library/{category}/{file}.md`
**Examples**:
```bash
/load @library/04-frameworks/nextjs.md
/load @library/07-databases/postgresql.md
Location: .cursor/agents/
Process:
- Create new
.mdfile - Follow agent file format
- Reference in commands if needed
Example:
# Custom Agent
## Role
Custom role description
## System Prompt
Custom agent personaLocation: .cursor/commands/
Process:
- Create new
.mdfile - Follow command file format
- Define trigger and action
Example:
# Custom Command
## Trigger
/custom
## Action
Custom action description
## Agent Involvement
- Custom AgentLocation: .cursor/rules/library/
Process:
- Create rule file in appropriate category
- Follow rule file format
- Load with
/loadcommand
Example:
# Custom Rule
## Overview
Custom rule description
## Guidelines
- Guideline 1Request: User types command in IDE
Response: Command executes, files modified
No explicit API - Commands work through IDE integration
Request: Command execution
Response: active_state.json updated
Format: JSON
Exit Code 1: General error
- Invalid arguments
- File system errors
- Generation failures
Error Messages: Printed to stderr
No explicit error codes - Errors handled through:
- Command responses
- File validation
- State validation
Format: Semantic versioning (MAJOR.MINOR.PATCH)
Example: 1.0.4
Check Version:
doplan --versionCurrent Version: 1.0
Breaking Changes: Documented in Migration Guide
Backward Compatibility: Maintained within major versions
# Read active_state.json
cat .plan/active_state.jsonResponse:
{
"phase": "building",
"active_task": "1.2",
"completed": ["1.1"],
"locked": true
}Create .cursor/agents/custom_agent.md:
# Custom Agent
## Role
Custom role
## System Prompt
Custom agent personaCreate .cursor/commands/custom.md:
# Custom Command
## Trigger
/custom
## Action
Custom action
## Agent Involvement
- Custom AgentCreate .cursor/rules/library/15-project-specific/custom.md:
# Custom Rule
## Overview
Custom rule
## Guidelines
- Guideline 1Load with:
/load @library/15-project-specific/custom.md- Commands Reference - Command details
- Project Structure - File structure
- Configuration Reference - Configuration API
- Configuration Guide - Extension examples
- Home - Wiki home page
Last Updated: 2025
Maintained By: Documentation Team