Usage
Learn how to use MyCoder effectively for your development tasks.
Basic Usage
Running with a Prompt
The simplest way to use MyCoder is to provide a natural language prompt:
mycoder "Fix all TypeScript build errors and ensure tests pass"
Interactive Mode
You can run MyCoder in interactive mode for ongoing conversation:
mycoder -i
Reading Prompts from Files
For complex tasks, you can prepare your prompt in a file:
mycoder --file=my-task-description.txt
Command Line Options
Option | Description |
---|---|
[prompt] | Main prompt text (positional argument) |
-i, --interactive | Run in interactive mode, asking for prompts |
-f, --file | Read prompt from a specified file |
-l, --logLevel | Set minimum logging level (debug, verbose, info, warn, error) |
--tokenUsage | Output token usage at info log level |
--headless | Use browser in headless mode with no UI showing (default: true) |
--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 |
--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
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 is managed through a mycoder.config.js
file in your project root:
// 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 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:
// 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.
GitHub Mode
MyCoder supports GitHub integration through the githubMode
configuration option. When enabled, MyCoder will:
- Work with GitHub issues and PRs as part of its workflow
- Create branches for issues it's working on
- Make commits with descriptive messages
- Create PRs when work is complete
To enable GitHub mode:
// mycoder.config.js
export default {
githubMode: true,
};
You can also enable it for a single session:
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.
Available Tools
MyCoder has access to a variety of tools that enable it to perform complex tasks:
Tool | Description | Use Case |
---|---|---|
textEditor | Views, creates, and edits files with persistence | Reading and modifying project files with advanced capabilities |
shellStart | Executes shell commands | Running builds, tests, installations, git operations |
shellMessage | Interacts with running shell processes | Working with interactive CLIs, monitoring long-running processes |
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 |
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: