Skip to content

Commit 85ad243

Browse files
authored
Merge pull request #222 from drivecore/issue-215-config-file
Replace config CLI commands with config file-based approach
2 parents ce2a3be + 8dffcef commit 85ad243

File tree

15 files changed

+387
-1398
lines changed

15 files changed

+387
-1398
lines changed

.husky/commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Validate commit message with commitlint
2-
# pnpm exec commitlint --edit $1
2+
pnpm exec commitlint --edit $1

packages/cli/.mycoder/config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"provider": "anthropic",
3+
"model": "claude-3-7-sonnet-20250219"
4+
}

packages/cli/README.md

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,23 +71,52 @@ Requirements for GitHub mode:
7171

7272
## Configuration
7373

74-
MyCoder stores configuration in `~/.mycoder/config.json`. You can manage configuration using the `config` command:
74+
MyCoder uses a configuration file in your project directory. To create a default configuration file, run:
7575

7676
```bash
77-
# List all configuration
78-
mycoder config list
77+
# Create a default configuration file
78+
mycoder init
7979

80-
# Get a specific configuration value
81-
mycoder config get githubMode
82-
83-
# Set a configuration value
84-
mycoder config set githubMode true
85-
86-
# Reset a configuration value to its default
87-
mycoder config clear customPrompt
80+
# Force overwrite an existing configuration file
81+
mycoder init --force
82+
```
8883

84+
This will create a `mycoder.config.js` file in your current directory with default settings that you can customize.
85+
86+
Example configuration file:
87+
88+
```javascript
89+
// mycoder.config.js
90+
export default {
91+
// GitHub integration
92+
githubMode: true,
93+
94+
// Browser settings
95+
headless: true,
96+
userSession: false,
97+
pageFilter: 'none', // 'simple', 'none', or 'readability'
98+
99+
// Model settings
100+
provider: 'anthropic',
101+
model: 'claude-3-7-sonnet-20250219',
102+
maxTokens: 4096,
103+
temperature: 0.7,
104+
105+
// Custom settings
106+
customPrompt: '',
107+
profile: false,
108+
tokenCache: true,
109+
110+
// API keys (better to use environment variables for these)
111+
// ANTHROPIC_API_KEY: 'your-api-key',
112+
};
89113
```
90114

115+
MyCoder will search for configuration in the following places (in order of precedence):
116+
1. CLI options (e.g., `--githubMode true`)
117+
2. Configuration file (`mycoder.config.js`, `.mycoderrc`, etc.)
118+
3. Default values
119+
91120
### Model Selection
92121

93122
NOTE: Anthropic Claude 3.7 works the best by far in our testing.

packages/cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"dependencies": {
4848
"@sentry/node": "^9.3.0",
4949
"chalk": "^5",
50+
"cosmiconfig": "^9.0.0",
5051
"deepmerge": "^4.3.1",
5152
"dotenv": "^16",
5253
"mycoder-agent": "workspace:*",

0 commit comments

Comments
 (0)