CLI Documentation

Complete reference for the Monkey Coder CLI commands, options, and usage patterns

Quick Install (Recommended)

Activate Yarn via Corepack and run the CLI with yarn dlx

corepack enable && corepack prepare yarn@4.9.2 --activate
yarn dlx monkey-coder-cli@latest --help

monkey-coder implement

Generate code implementation based on requirements

Core

Examples

Basic implementation:

monkey-coder implement "Create a user authentication system"

Modify existing file:

monkey-coder implement "Add error handling" src/api.ts --output src/api-fixed.ts

Language conversion with streaming:

monkey-coder implement "Convert to TypeScript" legacy.js --language typescript --stream

Options

-o, --outputOutput file path
-l, --languageTarget programming language
-p, --personaAI persona to use (developer, architect, etc.)
--modelSpecific AI model to use
--streamEnable streaming output
-t, --temperatureModel temperature (0.0-2.0)

monkey-coder analyze

Analyze code for quality, security, and performance issues

Core

Examples

Security analysis:

monkey-coder analyze src/**/*.ts --type security

Performance analysis with report:

monkey-coder analyze app.py --type performance --output report.md

Options

-t, --typeAnalysis type (quality, security, performance)
-o, --outputOutput file for analysis report
-p, --personaAI persona (default: reviewer)
--streamEnable streaming output

monkey-coder build

Build and optimize code architecture

Core

Examples

Architecture design:

monkey-coder build "Design a microservices architecture"

Refactoring with output directory:

monkey-coder build "Refactor monolith" src/ --output refactored/

Options

-o, --outputOutput directory for built files
-p, --personaAI persona (default: architect)
--streamEnable streaming output

monkey-coder test

Generate comprehensive tests for your code

Core

Examples

Generate Jest tests:

monkey-coder test src/utils.ts --framework jest

Generate Python tests:

monkey-coder test src/**/*.py --output tests/ --framework pytest

Options

-o, --outputOutput directory for test files
-f, --frameworkTesting framework (jest, pytest, etc.)
-p, --personaAI persona (default: tester)
--streamEnable streaming output

monkey-coder config

Manage CLI configuration

Config

Examples

Set API key:

monkey-coder config set apiKey "your-api-key"

List all configuration:

monkey-coder config list

Reset to defaults:

monkey-coder config reset

Options

set <key> <value>Set a configuration value
get <key>Get a configuration value
listList all configuration
resetReset to default configuration

monkey-coder health

Check API server health status

Utility

Examples

Check server status:

monkey-coder health

AI Personas

Choose specialized AI personas for different tasks

developer

General purpose coding and implementation

architect

System design and architecture planning

reviewer

Code review and quality analysis

security_analyst

Security-focused analysis

performance_expert

Performance optimization

tester

Test generation and quality assurance

technical_writer

Documentation and explanation

Configuration Options

Available configuration keys and their defaults

apiKey
string

Your API key for authentication

baseUrl
string

Base URL for the API

Default: https://monkey-coder.up.railway.app
defaultPersona
string

Default AI persona

Default: developer
defaultModel
string

Default AI model

Default: claude-opus-4-6
defaultProvider
string

Default AI provider

Default: anthropic
defaultTemperature
number

Default model temperature

Default: 0.1
defaultTimeout
number

Default request timeout (seconds)

Default: 300

Environment Variables

Alternative configuration through environment variables

MONKEY_CODER_API_KEYAPI key
MONKEY_CODER_API_URLBase URL for the API

Advanced Usage Patterns

Pro tips and advanced workflows

Streaming Output

Use the --stream flag for real-time progress updates on long-running tasks:

monkey-coder implement "Complex system" --stream

Combining Commands

Chain commands for complete workflows:

# Generate code, analyze it, then create tests
monkey-coder implement "API endpoint" --output api.ts
monkey-coder analyze api.ts --type security
monkey-coder test api.ts --framework jest

Using Personas Effectively

Match personas to tasks for best results:

architect
for system design
security_analyst
for vulnerability checks
performance_expert
for optimization