A CLI tool to initialize DL Agentic Workflow for Claude Code
npm install @dotted-labs/claude-code-flowA CLI tool to initialize DL Agentic Workflow for Claude Code projects.
``bash`
npx claude-code-flow init
This command initializes the DL Agentic Workflow in your current project by:
- Copying agent configurations to .claude/agentscommands/dl
- Adding workflow commands to mcp.json
- Merging MCP server configurations into CLAUDE.md
- Updating with workflow instructions
#### init
Initialize DL Agentic Workflow in your project.
`bash`
npx claude-code-flow init [options]
Options:
- --cwd - Target directory (default: current working directory)--dry-run
- - Show what would be done without making changes--force
- - Overwrite existing files when they differ
Examples:
`bashInitialize in current directory
npx claude-code-flow init
What Gets Created/Modified
$3
- Copies agent workflow definitions from the package
- Merges with existing agents without overwriting
- Provides specialized Claude Code agents for different tasks$3
- Adds DL-specific workflow commands
- Integrates with Claude Code's command system
- Enables enhanced project automation$3
- Merges MCP server entries required by DL workflow
- Creates .bak backup before modifications
- Preserves existing user configurations and formatting
- Only adds missing entries, never removes or modifies existing ones$3
- Updates the "## DL Agentic Workflow" section
- Creates file if it doesn't exist
- Preserves all other content in the file
- Uses sentinels for precise section replacementIdempotency & Safety
Safe Operations:
- Running
init multiple times is safe and won't duplicate content
- Existing files are only modified when content actually differs
- Backups are created before modifying mcp.json
- User modifications are preserved unless --force is usedConflict Resolution:
- By default, conflicting files are not overwritten
- Use
--force flag to overwrite when necessary
- Clear logs indicate what actions were taken or skippedCross-Platform Support:
- Works on Windows, macOS, and Linux
- Handles different path separators automatically
- Preserves line endings (CRLF/LF) as appropriate
File Structure
After running
init, your project will have:`
your-project/
├── .claude/
│ └── agents/
│ └── [agent files from package]
├── commands/
│ └── dl/
│ └── [workflow commands from package]
├── mcp.json (updated with DL MCP servers)
├── mcp.json.bak (backup of original)
└── CLAUDE.md (updated with DL workflow section)
`Development
$3
`bash
npm install
npm run build
`$3
`bash
Build and test locally
npm run build
node dist/cli.js init --dry-runTest with npm pack
npm pack
npx ./claude-code-flow-*.tgz init --dry-run
`$3
`bash
npm run prepublishOnly
npm publish
`Troubleshooting
$3
Permission Errors:
- Ensure you have write permissions to the target directory
- On Windows, run as Administrator if needed
Path Issues:
- Use absolute paths with
--cwd flag
- Ensure target directory exists before runningMCP Conflicts:
- Review
mcp.json.bak to see original configuration
- Use --force to overwrite conflicting MCP entries$3
- "Target directory does not exist" - Create the directory or use correct
--cwd` pathMIT License - see LICENSE file for details.