You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update documentation to reflect new mycoder.config.js configuration system
- Remove references to old 'config' CLI commands\n- Update configuration documentation to use mycoder.config.js\n- Update examples throughout the documentation\n- Update platform-specific setup guides\n\nCloses #51
Copy file name to clipboardExpand all lines: docs/usage/configuration.md
+100-47
Original file line number
Diff line number
Diff line change
@@ -8,35 +8,55 @@ MyCoder provides a comprehensive configuration system that allows you to customi
8
8
9
9
## Using the Configuration System
10
10
11
-
MyCoder's configuration is managed through a simple command-line interface:
12
-
13
-
```bash
14
-
# List all configuration values
15
-
mycoder config list
16
-
17
-
# Get a specific configuration value
18
-
mycoder config get modelProvider
19
-
20
-
# Set a configuration value
21
-
mycoder config set modelProvider openai
11
+
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.
12
+
13
+
```javascript
14
+
// mycoder.config.js
15
+
exportdefault {
16
+
// GitHub integration
17
+
githubMode:true,
18
+
19
+
// Browser settings
20
+
headless:true,
21
+
userSession:false,
22
+
pageFilter:'none', // 'simple', 'none', or 'readability'
23
+
24
+
// Model settings
25
+
provider:'anthropic',
26
+
model:'claude-3-7-sonnet-20250219',
27
+
maxTokens:4096,
28
+
temperature:0.7,
29
+
30
+
// Custom settings
31
+
customPrompt:'',
32
+
profile:false,
33
+
tokenCache:true,
34
+
};
22
35
```
23
36
24
-
Configuration values are stored persistently and will be used for all future MyCoder sessions until changed.
37
+
MyCoder will search for configuration in the following places (in order of precedence):
38
+
39
+
1. CLI options (e.g., `--githubMode true`)
40
+
2. Configuration file (`mycoder.config.js`)
41
+
3. Default values
25
42
26
43
## Available Configuration Options
27
44
28
45
### AI Model Selection
29
46
30
-
| Option | Description| Possible Values | Default |
mycoder config set customPrompt "Always write TypeScript code with proper type annotations. Prefer functional programming patterns where appropriate."
83
-
84
-
# Enable GitHub integration
85
-
mycoder config set githubMode true
106
+
```javascript
107
+
// mycoder.config.js
108
+
exportdefault {
109
+
// Set a custom prompt to guide the AI's behavior
110
+
customPrompt:"Always write TypeScript code with proper type annotations. Prefer functional programming patterns where appropriate.",
111
+
112
+
// Enable GitHub integration
113
+
githubMode:true,
114
+
};
86
115
```
87
116
88
117
## Configuration File Location
89
118
90
-
MyCoder stores its configuration in a JSON file in your user directory:
91
-
92
-
- On macOS/Linux: `~/.config/mycoder/config.json`
93
-
- On Windows: `%APPDATA%\mycoder\config.json`
94
-
95
-
While you can edit this file directly, it's recommended to use the `mycoder config` commands to ensure proper formatting.
119
+
The `mycoder.config.js` file should be placed in the root directory of your project. MyCoder will automatically detect and use this file when run from within the project directory or any of its subdirectories.
96
120
97
121
## Overriding Configuration
98
122
99
123
Command-line arguments always override the stored configuration. For example:
100
124
101
125
```bash
102
126
# Use a different model provider just for this session
103
-
mycoder --modelProvider openai "Create a React component"
127
+
mycoder --provider openai "Create a React component"
104
128
```
105
129
106
130
This will use OpenAI for this session only, without changing your stored configuration.
107
131
108
-
## Resetting Configuration
132
+
## Configuration Examples
109
133
110
-
To reset a specific configuration value to its default:
134
+
### Basic Configuration
111
135
112
-
```bash
113
-
# Remove a specific configuration value
114
-
mycoder config set modelProvider ""
136
+
```javascript
137
+
// mycoder.config.js
138
+
exportdefault {
139
+
provider:'anthropic',
140
+
model:'claude-3-7-sonnet-20250219',
141
+
githubMode:false,
142
+
};
115
143
```
116
144
117
-
To reset all configuration to defaults, you can delete the configuration file and restart MyCoder.
145
+
### Advanced Configuration
146
+
147
+
```javascript
148
+
// mycoder.config.js
149
+
exportdefault {
150
+
// Model settings
151
+
provider:'anthropic',
152
+
model:'claude-3-7-sonnet-20250219',
153
+
maxTokens:4096,
154
+
temperature:0.7,
155
+
156
+
// Browser settings
157
+
headless:false,
158
+
userSession:true,
159
+
pageFilter:'readability',
160
+
161
+
// GitHub integration
162
+
githubMode:true,
163
+
164
+
// Custom settings
165
+
customPrompt:'Always prioritize readability and simplicity in your code. Prefer TypeScript over JavaScript when possible.',
0 commit comments