Skip to content

Update documentation to reflect new mycoder.config.js configuration system #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions docs/getting-started/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,20 @@ MyCoder supports multiple AI providers:
| xAI/Grok | `XAI_API_KEY` | grok-1 |
| Ollama | N/A (local) | Various local models |

You can specify which provider and model to use with the `--modelProvider` and `--modelName` options:
You can specify which provider and model to use with the `--provider` and `--model` options:

```bash
mycoder --modelProvider openai --modelName gpt-4o "Your prompt here"
mycoder --provider openai --model gpt-4o "Your prompt here"
```

Or set them as defaults in your configuration:
Or set them as defaults in your configuration file:

```bash
mycoder config set modelProvider openai
mycoder config set modelName gpt-4o
```javascript
// mycoder.config.js
export default {
provider: 'openai',
model: 'gpt-4o',
};
```

## Next Steps
Expand Down
17 changes: 11 additions & 6 deletions docs/getting-started/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,19 @@ This guide will help you set up MyCoder on Linux.

**Enable GitHub Mode in MyCoder**:

After installing the GitHub CLI, enable GitHub mode in MyCoder for enhanced GitHub integration:
After installing the GitHub CLI, enable GitHub mode in MyCoder for enhanced GitHub integration by creating a configuration file:

```bash
# Enable GitHub mode
mycoder config set githubMode true
```javascript
// mycoder.config.js
export default {
githubMode: true,
};
```

# Verify configuration
mycoder config get githubMode
Or by using the CLI option for a single session:

```bash
mycoder --githubMode true "Your prompt here"
```

With GitHub mode enabled, MyCoder can create issues, branches, and pull requests directly through the GitHub CLI.
Expand Down
17 changes: 11 additions & 6 deletions docs/getting-started/macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,19 @@ This guide will help you set up MyCoder on macOS.

**Enable GitHub Mode in MyCoder**:

After installing the GitHub CLI, enable GitHub mode in MyCoder for enhanced GitHub integration:
After installing the GitHub CLI, enable GitHub mode in MyCoder for enhanced GitHub integration by creating a configuration file:

```bash
# Enable GitHub mode
mycoder config set githubMode true
```javascript
// mycoder.config.js
export default {
githubMode: true,
};
```

# Verify configuration
mycoder config get githubMode
Or by using the CLI option for a single session:

```bash
mycoder --githubMode true "Your prompt here"
```

With GitHub mode enabled, MyCoder can create issues, branches, and pull requests directly through the GitHub CLI.
Expand Down
15 changes: 10 additions & 5 deletions docs/getting-started/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,19 @@ This guide will help you set up MyCoder on Windows.

**Enable GitHub Mode in MyCoder**:

After installing the GitHub CLI, enable GitHub mode in MyCoder for enhanced GitHub integration:
After installing the GitHub CLI, enable GitHub mode in MyCoder for enhanced GitHub integration by creating a configuration file:

```javascript
// mycoder.config.js
export default {
githubMode: true,
};
```
# Enable GitHub mode
mycoder config set githubMode true

# Verify configuration
mycoder config get githubMode
Or by using the CLI option for a single session:

```
mycoder --githubMode true "Your prompt here"
```

With GitHub mode enabled, MyCoder can create issues, branches, and pull requests directly through the GitHub CLI.
Expand Down
147 changes: 100 additions & 47 deletions docs/usage/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,55 @@ MyCoder provides a comprehensive configuration system that allows you to customi

## Using the Configuration System

MyCoder's configuration is managed through a simple command-line interface:

```bash
# List all configuration values
mycoder config list

# Get a specific configuration value
mycoder config get modelProvider

# Set a configuration value
mycoder config set modelProvider openai
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.

```javascript
// mycoder.config.js
export default {
// GitHub integration
githubMode: true,

// Browser settings
headless: true,
userSession: false,
pageFilter: 'none', // 'simple', 'none', or 'readability'

// Model settings
provider: 'anthropic',
model: 'claude-3-7-sonnet-20250219',
maxTokens: 4096,
temperature: 0.7,

// Custom settings
customPrompt: '',
profile: false,
tokenCache: true,
};
```

Configuration values are stored persistently and will be used for all future MyCoder sessions until changed.
MyCoder will search for configuration in the following places (in order of precedence):

1. CLI options (e.g., `--githubMode true`)
2. Configuration file (`mycoder.config.js`)
3. Default values

## Available Configuration Options

### AI Model Selection

| Option | Description | Possible Values | Default |
| --------------- | --------------------------- | ------------------------------------------------- | ----------- |
| `modelProvider` | The AI provider to use | `anthropic`, `openai`, `mistral`, `xai`, `ollama` | `anthropic` |
| `modelName` | The specific model to use | Depends on provider | `claude-3-opus-20240229` |
| Option | Description | Possible Values | Default |
| ---------- | ----------------------- | ------------------------------------------------- | ----------- |
| `provider` | The AI provider to use | `anthropic`, `openai`, `mistral`, `xai`, `ollama` | `anthropic` |
| `model` | The specific model to use | Depends on provider | `claude-3-7-sonnet-20250219` |

Example:
```bash
# Set OpenAI as the provider with GPT-4o model
mycoder config set modelProvider openai
mycoder config set modelName gpt-4o
```javascript
// mycoder.config.js
export default {
// Use OpenAI as the provider with GPT-4o model
provider: 'openai',
model: 'gpt-4o',
};
```

### Logging and Debugging
Expand All @@ -48,10 +68,13 @@ mycoder config set modelName gpt-4o
| `profile` | Enable performance profiling | `true`, `false` | `false` |

Example:
```bash
# Enable verbose logging and token usage reporting
mycoder config set logLevel verbose
mycoder config set tokenUsage true
```javascript
// mycoder.config.js
export default {
// Enable verbose logging and token usage reporting
logLevel: 'verbose',
tokenUsage: true,
};
```

### Browser Integration
Expand All @@ -63,10 +86,13 @@ mycoder config set tokenUsage true
| `pageFilter` | Method to process webpage content | `simple`, `none`, `readability` | `simple` |

Example:
```bash
# Show browser windows and use readability for better web content parsing
mycoder config set headless false
mycoder config set pageFilter readability
```javascript
// mycoder.config.js
export default {
// Show browser windows and use readability for better web content parsing
headless: false,
pageFilter: 'readability',
};
```

### Behavior Customization
Expand All @@ -77,41 +103,68 @@ mycoder config set pageFilter readability
| `githubMode` | Enable GitHub integration | `true`, `false` | `false` |

Example:
```bash
# Set a custom prompt to guide the AI's behavior
mycoder config set customPrompt "Always write TypeScript code with proper type annotations. Prefer functional programming patterns where appropriate."

# Enable GitHub integration
mycoder config set githubMode true
```javascript
// mycoder.config.js
export default {
// Set a custom prompt to guide the AI's behavior
customPrompt: "Always write TypeScript code with proper type annotations. Prefer functional programming patterns where appropriate.",

// Enable GitHub integration
githubMode: true,
};
```

## Configuration File Location

MyCoder stores its configuration in a JSON file in your user directory:

- On macOS/Linux: `~/.config/mycoder/config.json`
- On Windows: `%APPDATA%\mycoder\config.json`

While you can edit this file directly, it's recommended to use the `mycoder config` commands to ensure proper formatting.
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.

## Overriding Configuration

Command-line arguments always override the stored configuration. For example:

```bash
# Use a different model provider just for this session
mycoder --modelProvider openai "Create a React component"
mycoder --provider openai "Create a React component"
```

This will use OpenAI for this session only, without changing your stored configuration.

## Resetting Configuration
## Configuration Examples

To reset a specific configuration value to its default:
### Basic Configuration

```bash
# Remove a specific configuration value
mycoder config set modelProvider ""
```javascript
// mycoder.config.js
export default {
provider: 'anthropic',
model: 'claude-3-7-sonnet-20250219',
githubMode: false,
};
```

To reset all configuration to defaults, you can delete the configuration file and restart MyCoder.
### Advanced Configuration

```javascript
// mycoder.config.js
export default {
// Model settings
provider: 'anthropic',
model: 'claude-3-7-sonnet-20250219',
maxTokens: 4096,
temperature: 0.7,

// Browser settings
headless: false,
userSession: true,
pageFilter: 'readability',

// GitHub integration
githubMode: true,

// Custom settings
customPrompt: 'Always prioritize readability and simplicity in your code. Prefer TypeScript over JavaScript when possible.',
profile: true,
tokenUsage: true,
tokenCache: true,
};
```
11 changes: 7 additions & 4 deletions docs/usage/github-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,19 @@ Before using GitHub mode, you need:

## Enabling GitHub Mode

Enable GitHub mode using the configuration system:
Enable GitHub mode using the configuration file:

```bash
mycoder config set githubMode true
```javascript
// mycoder.config.js
export default {
githubMode: true,
};
```

Or use it for a single session:

```bash
mycoder --githubMode "Fix the bug described in issue #42"
mycoder --githubMode true "Fix the bug described in issue #42"
```

## GitHub Mode Features
Expand Down
Loading