Skip to main content

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

OptionDescription
[prompt]Main prompt text (positional argument)
-i, --interactiveRun in interactive mode, asking for prompts
-f, --fileRead prompt from a specified file
-l, --logLevelSet minimum logging level (debug, verbose, info, warn, error)
--tokenUsageOutput token usage at info log level
--headlessUse browser in headless mode with no UI showing (default: true)
--userSessionUse user's existing browser session instead of sandboxed session (default: false)
--pageFilterMethod to process webpage content (simple, none, readability)
--profileEnable performance profiling of CLI startup
--providerSpecify the AI model provider to use (anthropic, openai, mistral, xai, ollama)
--modelSpecify the model name to use with the selected provider
-h, --helpShow help
-V, --versionShow 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

OptionDescriptionExample in mycoder.config.js
logLevelDefault logging levellogLevel: 'verbose'
tokenUsageShow token usage by defaulttokenUsage: true
headlessUse browser in headless modeheadless: false
userSessionUse existing browser sessionuserSession: true
pageFilterDefault webpage content processing methodpageFilter: 'readability'
providerDefault AI model providerprovider: 'openai'
modelDefault model namemodel: 'gpt-4o'
customPromptCustom instructions to append to the system promptcustomPrompt: "Always use TypeScript"
githubModeEnable GitHub integration modegithubMode: true
profileEnable performance profilingprofile: 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:

ToolDescriptionUse Case
textEditorViews, creates, and edits files with persistenceReading and modifying project files with advanced capabilities
shellStartExecutes shell commandsRunning builds, tests, installations, git operations
shellMessageInteracts with running shell processesWorking with interactive CLIs, monitoring long-running processes
fetchMakes HTTP requestsAccessing APIs, downloading resources
browseStartStarts a browser sessionResearching documentation, exploring solutions
browseMessagePerforms actions in an active browserNavigating websites, extracting information
agentStartStarts a sub-agent and returns immediatelyCreating asynchronous specialized agents for parallel tasks
agentMessageInteracts with a running sub-agentChecking status, providing guidance, or terminating sub-agents

For more detailed information about specific features, check the following pages: