Skip to content

Commit f357db0

Browse files
authored
Merge pull request #323 from drivecore/docs/update-readme-322
docs: update CLI README.md and root README.md to reflect latest features
2 parents 4a8a60e + 4c22165 commit f357db0

File tree

2 files changed

+82
-30
lines changed

2 files changed

+82
-30
lines changed

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Command-line interface for AI-powered coding tasks. Full details available on th
1111
- 🔍 **Smart Logging**: Hierarchical, color-coded logging system for clear output
1212
- 👤 **Human Compatible**: Uses README.md, project files and shell commands to build its own context
1313
- 🌐 **GitHub Integration**: GitHub mode for working with issues and PRs as part of workflow
14+
- 📄 **Model Context Protocol**: Support for MCP to access external context sources
1415

1516
Please join the MyCoder.ai discord for support: https://discord.gg/5K6TYrHGHt
1617

@@ -36,14 +37,12 @@ mycoder -f prompt.txt
3637

3738
# Disable user prompts for fully automated sessions
3839
mycoder --userPrompt false "Generate a basic Express.js server"
39-
# or using the alias
40-
mycoder --userPrompt false "Generate a basic Express.js server"
4140

4241
# Disable user consent warning and version upgrade check for automated environments
4342
mycoder --upgradeCheck false "Generate a basic Express.js server"
4443

4544
# Enable GitHub mode via CLI option (overrides config file)
46-
mycoder --githubMode "Work with GitHub issues and PRs"
45+
mycoder --githubMode true "Work with GitHub issues and PRs"
4746
```
4847

4948
## Configuration
@@ -99,6 +98,22 @@ export default {
9998

10099
// Base URL configuration (for providers that need it)
101100
baseUrl: 'http://localhost:11434', // Example for Ollama
101+
102+
// MCP configuration
103+
mcp: {
104+
servers: [
105+
{
106+
name: 'example',
107+
url: 'https://mcp.example.com',
108+
auth: {
109+
type: 'bearer',
110+
token: 'your-token-here',
111+
},
112+
},
113+
],
114+
defaultResources: ['example://docs/api'],
115+
defaultTools: ['example://tools/search'],
116+
},
102117
};
103118
```
104119

@@ -167,4 +182,4 @@ Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute t
167182

168183
## License
169184

170-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
185+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

packages/cli/README.md

Lines changed: 63 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,27 @@ If GitHub mode is enabled but the requirements are not met, MyCoder will provide
9292

9393
## Configuration
9494

95-
MyCoder is configured using a `mycoder.config.js` file in your project root, similar to ESLint and other modern JavaScript tools. This file exports a configuration object with your preferred settings.
95+
MyCoder is configured using a configuration file in your project. MyCoder supports multiple configuration file locations and formats, similar to ESLint and other modern JavaScript tools.
9696

97-
You can create a `mycoder.config.js` file in your project root with your preferred settings.
97+
### Configuration File Locations
9898

99-
Example configuration file:
99+
MyCoder will look for configuration in the following locations (in order of precedence):
100100

101-
```javascript
101+
1. `mycoder.config.js` in your project root
102+
2. `.mycoder.config.js` in your project root
103+
3. `.config/mycoder.js` in your project root
104+
4. `.mycoder.rc` in your project root
105+
5. `.mycoder.rc` in your home directory
106+
6. `mycoder` field in `package.json`
107+
7. `~/.config/mycoder/config.js` (XDG standard user configuration)
108+
109+
Multiple file extensions are supported: `.js`, `.ts`, `.mjs`, `.cjs`, `.json`, `.jsonc`, `.json5`, `.yaml`, `.yml`, and `.toml`.
110+
111+
### Creating a Configuration File
112+
113+
Create a configuration file in your preferred location:
114+
115+
```js
102116
// mycoder.config.js
103117
export default {
104118
// GitHub integration
@@ -116,10 +130,20 @@ export default {
116130
temperature: 0.7,
117131

118132
// Custom settings
133+
// customPrompt can be a string or an array of strings for multiple lines
119134
customPrompt: '',
135+
// Example of multiple line custom prompts:
136+
// customPrompt: [
137+
// 'Custom instruction line 1',
138+
// 'Custom instruction line 2',
139+
// 'Custom instruction line 3',
140+
// ],
120141
profile: false,
121142
tokenCache: true,
122143

144+
// Base URL configuration (for providers that need it)
145+
baseUrl: 'http://localhost:11434', // Example for Ollama
146+
123147
// MCP configuration
124148
mcp: {
125149
servers: [
@@ -133,7 +157,37 @@ export default {
133157
},
134158
],
135159
defaultResources: ['example://docs/api'],
160+
defaultTools: ['example://tools/search'],
136161
},
162+
163+
// Custom commands
164+
// Uncomment and modify to add your own commands
165+
/*
166+
commands: {
167+
// Function-based command example
168+
"search": {
169+
description: "Search for a term in the codebase",
170+
args: [
171+
{ name: "term", description: "Search term", required: true }
172+
],
173+
execute: (args) => {
174+
return `Find all instances of ${args.term} in the codebase and suggest improvements`;
175+
}
176+
},
177+
178+
// Another example with multiple arguments
179+
"fix-issue": {
180+
description: "Fix a GitHub issue",
181+
args: [
182+
{ name: "issue", description: "Issue number", required: true },
183+
{ name: "scope", description: "Scope of the fix", default: "full" }
184+
],
185+
execute: (args) => {
186+
return `Analyze GitHub issue #${args.issue} and implement a ${args.scope} fix`;
187+
}
188+
}
189+
}
190+
*/
137191
};
138192
```
139193

@@ -168,13 +222,14 @@ export default {
168222

169223
### Available Configuration Options
170224

171-
- `githubMode`: Enable GitHub mode (requires "gh" cli to be installed) for working with issues and PRs (default: `false`)
225+
- `githubMode`: Enable GitHub mode (requires "gh" cli to be installed) for working with issues and PRs (default: `true`)
172226
- `headless`: Run browser in headless mode with no UI showing (default: `true`)
173227
- `userSession`: Use user's existing browser session instead of sandboxed session (default: `false`)
174228
- `pageFilter`: Method to process webpage content: 'simple', 'none', or 'readability' (default: `none`)
175229
- `customPrompt`: Custom instructions to append to the system prompt for both main agent and sub-agents (default: `""`)
176230
- `tokenCache`: Enable token caching for LLM API calls (default: `true`)
177231
- `mcp`: Configuration for Model Context Protocol (MCP) integration (default: `{ servers: [], defaultResources: [] }`)
232+
- `commands`: Custom commands that can be executed via the CLI (default: `{}`)
178233

179234
### Model Context Protocol (MCP) Configuration
180235

@@ -242,26 +297,7 @@ These options are available only as command-line parameters and are not stored i
242297
- `upgradeCheck`: Disable version upgrade check for automated/remote usage (default: `true`)
243298
- `userPrompt`: Enable or disable the userPrompt tool (default: `true`)
244299

245-
Example configuration in `mycoder.config.js`:
246-
247-
```js
248-
// mycoder.config.js
249-
export default {
250-
// Browser settings
251-
headless: false, // Show browser UI
252-
userSession: true, // Use existing browser session
253-
pageFilter: 'readability', // Use readability for webpage processing
254-
255-
// Custom settings
256-
customPrompt:
257-
'Always prioritize readability and simplicity in your code. Prefer TypeScript over JavaScript when possible.',
258-
tokenCache: false, // Disable token caching for LLM API calls
259-
260-
// Other configuration options...
261-
};
262-
```
263-
264-
You can also set these options via CLI arguments (which will override the config file):
300+
Example setting these options via CLI arguments (which will override the config file):
265301

266302
```bash
267303
# Set browser to show UI for this session only
@@ -275,6 +311,7 @@ mycoder --userSession true "Your prompt here"
275311

276312
- `ANTHROPIC_API_KEY`: Your Anthropic API key (required when using Anthropic models)
277313
- `OPENAI_API_KEY`: Your OpenAI API key (required when using OpenAI models)
314+
- `SENTRY_DSN`: Optional Sentry DSN for error tracking
278315

279316
Note: Ollama models do not require an API key as they run locally or on a specified server.
280317

@@ -297,4 +334,4 @@ pnpm cli -i
297334

298335
## License
299336

300-
MIT
337+
MIT

0 commit comments

Comments
 (0)