Skip to content

ExpressedAi/Cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DevMaster CLI πŸš€

AAA-grade Development Assistant powered by Claude Agent SDK

An advanced CLI tool that leverages the full power of the Claude Agent SDK, featuring multiple MCP servers, specialized AI agents, comprehensive hooks, and intelligent permission management.

✨ Features

🎯 Multiple Operation Modes

  • Chat: Interactive conversation mode
  • Analyze: Deep codebase analysis and insights
  • Review: Comprehensive code review with feedback
  • Refactor: Smart code improvement suggestions
  • Plan: Project planning and architecture design
  • Test: Intelligent test generation and coverage analysis
  • Debug: Advanced debugging and error resolution

πŸ› οΈ Four Powerful MCP Servers

1. FileSystem Server

Advanced file operations beyond basic Read/Write:

  • Directory traversal with metadata
  • File tree visualization
  • Content-based search
  • File analysis and statistics
  • Bulk operations (rename, move, delete)

2. Git Server

Smart git operations and workflow automation:

  • Enhanced status with remote tracking
  • Intelligent commit message suggestions
  • Branch management (create, switch, compare, delete)
  • Commit history analysis and statistics
  • Merge conflict detection and resolution assistance

3. Code Analysis Server

Professional code quality metrics:

  • Cyclomatic complexity analysis
  • Code smell detection
  • Dependency graph with circular dependency detection
  • Refactoring suggestions with priorities
  • Maintainability index calculation

4. Dev Workflow Server

Complete development lifecycle support:

  • Automated test generation (unit, integration, e2e)
  • Debug strategy suggestions
  • Project scaffolding templates
  • Performance profiling and optimization hints

πŸ€– Eight Specialized AI Agents

Each agent is an expert in their domain:

  • Architect πŸ—οΈ: System design and architecture planning
  • Reviewer πŸ”: Comprehensive code review specialist
  • Refactor ♻️: Code improvement and cleanup expert
  • Tester πŸ§ͺ: Test generation and QA specialist
  • Debug πŸ›: Bug investigation and resolution expert
  • Planner πŸ“‹: Task breakdown and project planning
  • Docs πŸ“š: Documentation generation specialist
  • Optimizer ⚑: Performance optimization expert

πŸͺ Comprehensive Hook System

Real-time monitoring and automation:

  • SessionStart/End: Session lifecycle management
  • PreToolUse: Safety validation and permission checks
  • PostToolUse: Result monitoring and auto-backup
  • Notification: Custom alerts and messages
  • Performance: Slow operation detection
  • PreCompact: Context management

πŸ”’ Intelligent Permission Management

Flexible security modes:

  • Default: Interactive approval
  • Auto-approve: For read operations
  • Dev mode: Smart approvals for common operations
  • Safe mode: Block dangerous operations
  • Custom rules: Define your own patterns

πŸš€ Quick Start

Installation

# Clone and install
git clone <repository-url>
cd Cli
npm install

# Set your API key
export ANTHROPIC_API_KEY=your_api_key_here

Basic Usage

# Interactive chat
npm start

# Analyze codebase
npm run analyze

# Review code
npm run review

# Generate tests
npm run test "Generate tests for src/utils/parser.ts"

# Debug issues
npm run debug "Why is the API returning 500?"

# Plan feature
npm run plan "Design user authentication system"

πŸ“– Documentation

Command Line Options

devmaster [OPTIONS] [PROMPT]

Options:
  --mode, -m <mode>       Operation mode (chat|analyze|review|refactor|plan|test|debug)
  --model <model>         AI model (sonnet|opus|haiku)
  --permission-mode, -p   Permission mode (default|acceptEdits|bypassPermissions|plan)
  --verbose, -v           Enable verbose logging
  --output, -o <format>   Output format (text|json|markdown)
  --session, -s <id>      Resume existing session
  --fork, -f              Fork session instead of continuing
  --max-turns <n>         Maximum conversation turns
  --help, -h              Show help message
  --version               Show version

Advanced Examples

Automated Code Review

npm run review -- -p acceptEdits "Review all changes in src/"

Deep Analysis with Report

npm run analyze -- --output markdown > analysis.md

Refactor with Auto-approval

npm start -- --mode refactor -p acceptEdits "Simplify authentication logic"

Debug with Verbose Logging

npm run debug -- -v "Memory leak in WebSocket handler"

Architecture Planning

npm run plan -- "Design microservices architecture for e-commerce"

πŸ—οΈ Architecture

Project Structure

src/
β”œβ”€β”€ index.ts              # Main entry point
β”œβ”€β”€ cli.ts                # CLI interface and argument parsing
β”œβ”€β”€ servers/              # MCP Server implementations
β”‚   β”œβ”€β”€ filesystem.ts     # Advanced file operations
β”‚   β”œβ”€β”€ git.ts           # Git workflow automation
β”‚   β”œβ”€β”€ codeAnalysis.ts  # Code quality metrics
β”‚   └── devWorkflow.ts   # Testing and debugging
β”œβ”€β”€ agents/              # Specialized AI agents
β”‚   └── index.ts         # Agent definitions
β”œβ”€β”€ hooks/               # Event hooks
β”‚   └── index.ts         # Hook implementations
β”œβ”€β”€ utils/               # Utility modules
β”‚   β”œβ”€β”€ ui.ts           # Terminal UI
β”‚   β”œβ”€β”€ streaming.ts    # Stream handling
β”‚   └── permissions.ts  # Permission management
└── types/              # TypeScript types
    └── index.ts        # Shared type definitions

Key Technologies

  • Claude Agent SDK: Core AI capabilities
  • TypeScript: Type-safe development
  • Zod: Schema validation
  • MCP Protocol: Tool and server integration
  • Node.js: Runtime environment

🎨 Features in Detail

MCP Server Tools

FileSystem Tools

list_directories({ path, recursive, maxDepth })
file_tree({ path, maxDepth, includeFiles, excludePatterns })
search_files({ pattern, path, filePattern, caseSensitive })
analyze_file({ filePath })
bulk_operation({ operation, pattern, destination, dryRun })

Git Tools

git_status({ verbose })
suggest_commit({ analyzeCode })
branch_management({ action, branchName, baseBranch })
analyze_history({ limit, since, author })
conflict_helper()

Code Analysis Tools

analyze_complexity({ filePath })
detect_code_smells({ filePath })
analyze_dependencies({ rootPath, maxDepth })
suggest_refactorings({ filePath })

Dev Workflow Tools

generate_tests({ sourceFile, testType, framework })
analyze_debug({ filePath, errorMessage })
scaffold_project({ projectType, projectName, features })
profile_performance({ filePath })

Specialized Agents

Agents automatically invoke when their expertise is needed:

# Explicit agent invocation
npm start "Use the architect agent to design a caching layer"

# Implicit invocation
npm run review  # Automatically uses reviewer agent
npm run test    # Automatically uses tester agent
npm run debug   # Automatically uses debug agent

πŸ”§ Configuration

Environment Variables

ANTHROPIC_API_KEY    # Required: Your Claude API key
VERBOSE              # Optional: Enable verbose logging
AUTO_BACKUP          # Optional: Auto-backup modified files

Project Settings

Create .claude/settings.json for project-specific configuration:

{
  "defaultMode": "chat",
  "defaultModel": "sonnet",
  "permissionMode": "default"
}

🎯 Use Cases

1. Code Quality Improvement

npm run analyze  # Identify issues
npm run review   # Get detailed feedback
npm run refactor # Apply improvements
npm run test     # Generate comprehensive tests

2. Feature Development

npm run plan "Add payment processing"
npm start -- "Implement payment processing with the architect agent"
npm run test "Generate tests for payment module"
npm run review "Review payment implementation"

3. Debugging Workflow

npm run debug "API returns 500 on POST /users"
# Agent analyzes, suggests fixes
npm run test "Generate tests to prevent regression"

4. Documentation

npm start "Use docs agent to create comprehensive README"
npm start "Generate API documentation for src/api/"

🚦 Safety Features

Dangerous Operation Blocking

  • System directory writes blocked
  • Destructive commands require approval
  • Sensitive file modifications flagged

Permission Modes

  • Default: Asks for approval
  • Safe Mode: Extra validation
  • Dev Mode: Common operations auto-approved
  • Bypass: For automation (use carefully)

Auto-backup

Enable automatic backups of modified files:

export AUTO_BACKUP=true

Backups stored in .devmaster/backups/

πŸ“Š Output Formats

Text (Default)

Beautiful terminal output with colors and formatting

JSON

Machine-readable output for integration:

npm start -- --output json > output.json

Markdown

Documentation-friendly reports:

npm run analyze -- --output markdown > analysis.md

🀝 Contributing

This is a demonstration project showcasing Claude Agent SDK capabilities. Feel free to:

  1. Fork and extend with new MCP servers
  2. Add more specialized agents
  3. Create custom hooks
  4. Improve existing tools

πŸ“ License

MIT

πŸ™ Acknowledgments

Built with:

πŸ“š More Information


DevMaster CLI - Bringing AAA-grade AI assistance to your development workflow! πŸŽ‰

About

Cli

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •