|
1 | 1 | # MyCoder CLI |
2 | 2 |
|
3 | | -[![NPM Package][npm]][npm-url] |
4 | | -[![NPM Downloads][npm-downloads]][npmtrends-url] |
5 | | -[![CI Status][ci]][ci-url] |
6 | | -[![Discord][discord]][discord-url] |
| 3 | +Command-line interface for AI-powered coding tasks. |
7 | 4 |
|
8 | | -## Overview |
| 5 | +## Features |
9 | 6 |
|
10 | | -MyCoder is a simple to install, powerful command-line AI agent that can perform arbitrary tasks with a particular focus on coding tasks. It uses the [mycoder-agent](https://www.npmjs.com/package/mycoder-agent) package to provide AI-powered automation capabilities. |
11 | | - |
12 | | -- 🤖 **AI-Powered**: Leverages Anthropic's Claude API for intelligent decision making |
| 7 | +- 🤖 **AI-Powered**: Leverages Anthropic's Claude API for intelligent coding assistance |
13 | 8 | - 🛠️ **Extensible Tool System**: Modular architecture with various tool categories |
14 | 9 | - 🔄 **Parallel Execution**: Ability to spawn sub-agents for concurrent task processing |
15 | 10 | - 📝 **Self-Modification**: Can modify code, it was built and tested by writing itself |
16 | 11 | - 🔍 **Smart Logging**: Hierarchical, color-coded logging system for clear output |
17 | 12 | - 👤 **Human Compatible**: Uses README.md, project files and shell commands to build its own context |
| 13 | +- 🌐 **GitHub Integration**: GitHub mode for working with issues and PRs as part of workflow |
18 | 14 |
|
19 | | -Please join the MyCoder.ai discord for support: https://discord.gg/5K6TYrHGHt |
20 | | - |
21 | | -## WARNING and LIABILITY WAIVER |
22 | | - |
23 | | -This tool can do anything on your command line that you ask it to. It can delete files, install software, and even send data to remote servers. It is a powerful tool that should be used with caution. By using this tool, you agree that the authors and contributors are not responsible for any damage that may occur as a result of using this tool. |
24 | | - |
25 | | -## API Key Required |
26 | | - |
27 | | -Before using MyCoder, you must have an ANTHROPIC_API_KEY specified either: |
28 | | - |
29 | | -- As an environment variable, "export ANTHROPIC_API_KEY=[your-api-key]" or |
30 | | -- In a .env file in the folder you run `mycoder` from |
31 | | - |
32 | | -Get an API key from https://www.anthropic.com/api |
33 | | - |
34 | | -## Quick Start |
| 15 | +## Installation |
35 | 16 |
|
36 | 17 | ```bash |
37 | | -# Install globally (pnpm, bun, yarn also work) |
38 | 18 | npm install -g mycoder |
| 19 | +``` |
39 | 20 |
|
40 | | -# Start MyCoder with a prompt |
41 | | -mycoder "fix all build errors and ensure the tests pass" |
| 21 | +## Usage |
42 | 22 |
|
43 | | -# Start in interactive mode |
| 23 | +```bash |
| 24 | +# Interactive mode |
44 | 25 | mycoder -i |
45 | 26 |
|
46 | | -# Read prompt from a file |
47 | | -mycoder --promptFile=your-prompt.txt |
48 | | -``` |
| 27 | +# Run with a prompt |
| 28 | +mycoder "Implement a React component that displays a list of items" |
| 29 | + |
| 30 | +# Run with a prompt from a file |
| 31 | +mycoder -f prompt.txt |
49 | 32 |
|
50 | | -## CLI Options |
| 33 | +# Enable GitHub mode |
| 34 | +mycoder config set githubMode true |
| 35 | +``` |
51 | 36 |
|
52 | | -- `[prompt]`: Main prompt text (positional argument) |
53 | | -- `-i, --interactive`: Run in interactive mode, asking for prompts |
54 | | -- `-f, --file`: Read prompt from a specified file |
55 | | -- `--log`: Set log level (info, verbose, warn, error) |
56 | | -- `--tokenUsage`: Output token usage at info log level |
57 | | -- `--headless`: Use browser in headless mode with no UI showing (default: true) |
58 | | -- `--userSession`: Use user's existing browser session instead of sandboxed session (default: false) |
59 | | -- `-h, --help`: Show help |
60 | | -- `-V, --version`: Show version |
| 37 | +## GitHub Mode |
61 | 38 |
|
62 | | -## Example Use Cases & Prompts |
| 39 | +MyCoder includes a GitHub mode that enables the agent to work with GitHub issues and PRs as part of its workflow. When enabled, the agent will: |
63 | 40 |
|
64 | | -MyCoder excels at various software development tasks. Here are some example prompts: |
| 41 | +- Start from existing GitHub issues or create new ones for tasks |
| 42 | +- Create branches for issues it's working on |
| 43 | +- Make commits with descriptive messages |
| 44 | +- Create PRs when work is complete |
| 45 | +- Create additional GitHub issues for follow-up tasks or ideas |
65 | 46 |
|
66 | | -### Code Migration & Updates |
| 47 | +To enable GitHub mode: |
67 | 48 |
|
68 | 49 | ```bash |
69 | | -# Converting test framework |
70 | | -mycoder "Convert all Jest tests in the src/ directory to Vitest, updating any necessary configuration files and dependencies" |
71 | | - |
72 | | -# Dependency updates |
73 | | -mycoder "Update all dependencies to their latest versions, handle any breaking changes, and ensure all tests pass" |
| 50 | +mycoder config set githubMode true |
74 | 51 | ``` |
75 | 52 |
|
76 | | -### Code Refactoring |
| 53 | +To disable GitHub mode: |
77 | 54 |
|
78 | 55 | ```bash |
79 | | -# Class refactoring |
80 | | -mycoder "Refactor the UserService class in src/services/UserService.ts to use the repository pattern, update all files that use this class, and ensure tests pass" |
81 | | - |
82 | | -# API modernization |
83 | | -mycoder "Convert all callback-based functions in the project to use async/await, update tests accordingly" |
| 56 | +mycoder config set githubMode false |
84 | 57 | ``` |
85 | 58 |
|
86 | | -### Feature Implementation |
| 59 | +Requirements for GitHub mode: |
| 60 | +- GitHub CLI (`gh`) needs to be installed and authenticated |
| 61 | +- User needs to have appropriate GitHub permissions for the target repository |
87 | 62 |
|
88 | | -```bash |
89 | | -# CLI enhancement |
90 | | -mycoder "Add a new global --debug command line option that enables verbose logging throughout the application" |
91 | | - |
92 | | -# New functionality |
93 | | -mycoder "Create a new caching system for API responses using Redis, including configuration options and unit tests" |
94 | | -``` |
| 63 | +## Configuration |
95 | 64 |
|
96 | | -### Maintenance & Fixes |
| 65 | +MyCoder stores configuration in `~/.mycoder/config.json`. You can manage configuration using the `config` command: |
97 | 66 |
|
98 | 67 | ```bash |
99 | | -# Build fixes |
100 | | -mycoder "Fix all TypeScript build errors and ensure all tests pass" |
| 68 | +# List all configuration |
| 69 | +mycoder config list |
101 | 70 |
|
102 | | -# Test coverage |
103 | | -mycoder "Add unit tests for all untested functions in the src/utils directory, aiming for 80% coverage" |
| 71 | +# Get a specific configuration value |
| 72 | +mycoder config get githubMode |
| 73 | + |
| 74 | +# Set a configuration value |
| 75 | +mycoder config set githubMode true |
104 | 76 | ``` |
105 | 77 |
|
106 | | -### Documentation |
| 78 | +## Environment Variables |
| 79 | + |
| 80 | +- `ANTHROPIC_API_KEY`: Your Anthropic API key (required) |
| 81 | + |
| 82 | +## Development |
107 | 83 |
|
108 | 84 | ```bash |
109 | | -# Documentation generation |
110 | | -mycoder "Generate comprehensive JSDoc documentation for all exported functions and update the API documentation in the docs/ directory" |
| 85 | +# Clone the repository |
| 86 | +git clone https://github.com/drivecore/mycoder.git |
| 87 | +cd mycoder |
111 | 88 |
|
112 | | -# Architecture documentation |
113 | | -mycoder "Analyze the current codebase and create detailed architecture documentation including component diagrams and data flow" |
| 89 | +# Install dependencies |
| 90 | +pnpm install |
| 91 | + |
| 92 | +# Build the CLI |
| 93 | +pnpm build |
| 94 | + |
| 95 | +# Run the locally built CLI |
| 96 | +pnpm cli -i |
114 | 97 | ``` |
115 | 98 |
|
116 | | -## Technical Requirements |
117 | | - |
118 | | -- Node.js >= 20.0.0 |
119 | | -- pnpm >= 10.2.1 |
120 | | - |
121 | | -[npm]: https://img.shields.io/npm/v/mycoder |
122 | | -[npm-downloads]: https://img.shields.io/npm/dw/mycoder |
123 | | -[npm]: https://img.shields.io/npm/v/mycoder |
124 | | -[npm-url]: https://www.npmjs.com/package/mycoder |
125 | | -[npm-downloads]: https://img.shields.io/npm/dw/mycoder |
126 | | -[npmtrends-url]: https://www.npmtrends.com/mycoder |
127 | | -[ci]: https://img.shields.io/github/checks-status/bhouston/mycoder/main |
128 | | -[ci-url]: https://github.com/bhouston/mycoder/actions |
129 | | -[discord]: https://img.shields.io/discord/1339025847331328000 |
130 | | -[discord-url]: https://discord.gg/5K6TYrHGHt |
| 99 | +## License |
| 100 | + |
| 101 | +MIT |
0 commit comments