From 9fd3fa1bc1aaf758f2063201610af37e32d3fd3e Mon Sep 17 00:00:00 2001 From: Ben Houston Date: Wed, 12 Mar 2025 11:53:55 -0400 Subject: [PATCH 1/2] 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 --- docs/getting-started/index.mdx | 15 +-- docs/getting-started/linux.md | 17 ++-- docs/getting-started/macos.md | 17 ++-- docs/getting-started/windows.md | 15 ++- docs/usage/configuration.md | 147 +++++++++++++++++++--------- docs/usage/github-mode.md | 11 ++- docs/usage/index.mdx | 76 +++++++++----- docs/usage/performance-profiling.md | 9 +- 8 files changed, 205 insertions(+), 102 deletions(-) diff --git a/docs/getting-started/index.mdx b/docs/getting-started/index.mdx index 6b719a7..6ae8c1d 100644 --- a/docs/getting-started/index.mdx +++ b/docs/getting-started/index.mdx @@ -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 diff --git a/docs/getting-started/linux.md b/docs/getting-started/linux.md index 60a599f..7a9f3b0 100644 --- a/docs/getting-started/linux.md +++ b/docs/getting-started/linux.md @@ -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. diff --git a/docs/getting-started/macos.md b/docs/getting-started/macos.md index 6fa4add..4d990d9 100644 --- a/docs/getting-started/macos.md +++ b/docs/getting-started/macos.md @@ -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. diff --git a/docs/getting-started/windows.md b/docs/getting-started/windows.md index b18c149..af38268 100644 --- a/docs/getting-started/windows.md +++ b/docs/getting-started/windows.md @@ -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. diff --git a/docs/usage/configuration.md b/docs/usage/configuration.md index a866785..cc76bbc 100644 --- a/docs/usage/configuration.md +++ b/docs/usage/configuration.md @@ -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 @@ -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 @@ -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 @@ -77,22 +103,20 @@ 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 @@ -100,18 +124,47 @@ 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. \ No newline at end of file +### 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, +}; +``` \ No newline at end of file diff --git a/docs/usage/github-mode.md b/docs/usage/github-mode.md index acb36a5..d039904 100644 --- a/docs/usage/github-mode.md +++ b/docs/usage/github-mode.md @@ -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 diff --git a/docs/usage/index.mdx b/docs/usage/index.mdx index 6d908a8..ebda4c3 100644 --- a/docs/usage/index.mdx +++ b/docs/usage/index.mdx @@ -46,45 +46,62 @@ mycoder --file=my-task-description.txt | `--userSession` | Use user's existing browser session instead of sandboxed session (default: false) | | `--pageFilter` | Method to process webpage content (simple, none, readability) | | `--profile` | Enable performance profiling of CLI startup | -| `--modelProvider` | Specify the AI model provider to use (anthropic, openai, mistral, xai, ollama) | -| `--modelName` | Specify the model name to use with the selected provider | +| `--provider` | Specify the AI model provider to use (anthropic, openai, mistral, xai, ollama) | +| `--model` | Specify the model name to use with the selected provider | | `-h, --help` | Show help | | `-V, --version` | Show version number | -## Configuration Management +## Configuration MyCoder provides a configuration system that allows you to set default values for various options. This saves you from having to specify the same options repeatedly on the command line. -### Configuration Commands +Configuration is managed through a `mycoder.config.js` file in your project root: -| Command | Description | -| ---------------------------------- | ---------------------------------- | -| `mycoder config list` | List all configuration values | -| `mycoder config get [key]` | Get a specific configuration value | -| `mycoder config set [key] [value]` | Set a configuration value | +```javascript +// mycoder.config.js +export default { + // GitHub integration + githubMode: true, + + // Browser settings + headless: false, + userSession: false, + pageFilter: 'readability', + + // Model settings + provider: 'anthropic', + model: 'claude-3-7-sonnet-20250219', + + // Custom settings + customPrompt: 'Always use TypeScript when writing code. Prefer functional programming patterns when possible.', +}; +``` ### Available Configuration Options -| Option | Description | Example | -| --------------- | -------------------------------------------------- | --------------------------------------------------------- | -| `logLevel` | Default logging level | `mycoder config set logLevel verbose` | -| `tokenUsage` | Show token usage by default | `mycoder config set tokenUsage true` | -| `headless` | Use browser in headless mode | `mycoder config set headless false` | -| `userSession` | Use existing browser session | `mycoder config set userSession true` | -| `pageFilter` | Default webpage content processing method | `mycoder config set pageFilter readability` | -| `modelProvider` | Default AI model provider | `mycoder config set modelProvider openai` | -| `modelName` | Default model name | `mycoder config set modelName gpt-4o` | -| `customPrompt` | Custom instructions to append to the system prompt | `mycoder config set customPrompt "Always use TypeScript"` | -| `githubMode` | Enable GitHub integration mode | `mycoder config set githubMode true` | -| `profile` | Enable performance profiling | `mycoder config set profile true` | +| Option | Description | Example in mycoder.config.js | +| --------------- | -------------------------------------------------- | ------------------------------------------------------ | +| `logLevel` | Default logging level | `logLevel: 'verbose'` | +| `tokenUsage` | Show token usage by default | `tokenUsage: true` | +| `headless` | Use browser in headless mode | `headless: false` | +| `userSession` | Use existing browser session | `userSession: true` | +| `pageFilter` | Default webpage content processing method | `pageFilter: 'readability'` | +| `provider` | Default AI model provider | `provider: 'openai'` | +| `model` | Default model name | `model: 'gpt-4o'` | +| `customPrompt` | Custom instructions to append to the system prompt | `customPrompt: "Always use TypeScript"` | +| `githubMode` | Enable GitHub integration mode | `githubMode: true` | +| `profile` | Enable performance profiling | `profile: true` | ## Custom Prompt The `customPrompt` configuration option allows you to append custom instructions to the system prompt used by MyCoder. This can be useful for guiding the AI's behavior for your specific use cases: -```bash -# Example: Set a custom prompt to prefer TypeScript -mycoder config set customPrompt "Always use TypeScript when writing code. Prefer functional programming patterns when possible." +```javascript +// mycoder.config.js +export default { + // Example: Set a custom prompt to prefer TypeScript + customPrompt: "Always use TypeScript when writing code. Prefer functional programming patterns when possible.", +}; ``` The custom prompt will be included in both the main agent and any sub-agents that are created. @@ -100,8 +117,17 @@ MyCoder supports GitHub integration through the `githubMode` configuration optio To enable GitHub mode: +```javascript +// mycoder.config.js +export default { + githubMode: true, +}; +``` + +You can also enable it for a single session: + ```bash -mycoder config set githubMode true +mycoder --githubMode true "Fix the bug in issue #42" ``` This requires the GitHub CLI (`gh`) to be installed and authenticated. For more details, see the [GitHub Mode documentation](./github-mode). diff --git a/docs/usage/performance-profiling.md b/docs/usage/performance-profiling.md index b37fd11..c5d9b66 100644 --- a/docs/usage/performance-profiling.md +++ b/docs/usage/performance-profiling.md @@ -24,10 +24,13 @@ mycoder --profile --interactive ### 2. As Default Behavior -Set profiling as the default behavior using the configuration system: +Set profiling as the default behavior in your configuration file: -```bash -mycoder config set profile true +```javascript +// mycoder.config.js +export default { + profile: true, +}; ``` ## Understanding Profiling Output From c3c949f42d046f94a6238b64ce17c7d040fceeeb Mon Sep 17 00:00:00 2001 From: Ben Houston Date: Wed, 12 Mar 2025 12:04:58 -0400 Subject: [PATCH 2/2] Update documentation to replace subAgent with agentStart and agentMessage - Replace references to the old subAgent tool with the new agentStart and agentMessage tools\n- Update the Available Tools section to reflect the new asynchronous agent workflow --- docs/usage/index.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/usage/index.mdx b/docs/usage/index.mdx index ebda4c3..0244df1 100644 --- a/docs/usage/index.mdx +++ b/docs/usage/index.mdx @@ -144,7 +144,8 @@ MyCoder has access to a variety of tools that enable it to perform complex tasks | **fetch** | Makes HTTP requests | Accessing APIs, downloading resources | | **browseStart** | Starts a browser session | Researching documentation, exploring solutions | | **browseMessage** | Performs actions in an active browser | Navigating websites, extracting information | -| **subAgent** | Creates specialized sub-agents | Handling complex tasks in parallel | +| **agentStart** | Starts a sub-agent and returns immediately | Creating asynchronous specialized agents for parallel tasks | +| **agentMessage** | Interacts with a running sub-agent | Checking status, providing guidance, or terminating sub-agents | For more detailed information about specific features, check the following pages: