@ocis/mycoder-cli
v0.0.4
Published
AFS MyCoder CLI
Readme
AFS MyCoder CLI
The AFS MyCoder CLI (mycoder) is a customizable command line coding agent.

Installation
macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/continuedev/continue/main/extensions/cli/scripts/install.sh | bashWindows (PowerShell):
irm https://raw.githubusercontent.com/continuedev/continue/main/extensions/cli/scripts/install.ps1 | iexOr install with npm if you have Node.js 20+:
npm i -g @ocis/mycoder-cliUsage
mycoderFirst Run: When you first use the CLI, it automatically creates a .env file in ~/.afsmycoder/ (or %USERPROFILE%\.afsmycoder\ on Windows) with default server configuration (DOMAIN=production).
Headless Mode
Headless mode (-p flag) runs without an interactive terminal UI, making it perfect for:
- Scripts and automation
- CI/CD pipelines
- Docker containers
- VSCode/IntelliJ extension integration
- Environments without a TTY
# Basic usage
mycoder -p "Generate a conventional commit name for the current git changes."
# With piped input
echo "Review this code" | mycoder -p
# JSON output for scripting
mycoder -p "Analyze the code" --format json
# Silent mode (strips thinking tags)
mycoder -p "Write a README" --silentTTY-less Environments: Headless mode is designed to work in environments without a terminal (TTY), such as when called from VSCode/IntelliJ extensions using terminal commands. The CLI will not attempt to read stdin or initialize the interactive UI when running in headless mode with a supplied prompt.
Session Management
The CLI automatically saves your chat history for each terminal session. You can resume where you left off:
# Resume the last session in this terminal
mycoder --resume
# List recent sessions and choose one to resume
mycoder ls
# List sessions in JSON format (for scripting)
mycoder ls --jsonCommand Line Options
-p: Run in headless mode (no TUI)--config <path>: Specify agent configuration path--resume: Resume the last session for this terminal<prompt>: Optional prompt to start with
Environment Variables
AFSMYCODER_CLI_DISABLE_COMMIT_SIGNATURE: Disable adding the AFS MyCoder commit signature to generated commit messagesFORCE_NO_TTY: Force TTY-less mode, prevents stdin reading (useful for testing and automation)
Commands
mycoder: Start an interactive chat sessionmycoder ls: List recent sessions with TUI selector to choose one to resumemycoder remote: Launch a remote instancemycoder serve: Start HTTP server mode
Session Listing (mycoder ls)
Shows recent sessions, limited by screen height to ensure it fits on your terminal.
--json: Output in JSON format for scripting (always shows 10 sessions)
TTY-less Support
The CLI fully supports running in environments without a TTY (terminal):
# From Docker without TTY allocation
docker run --rm my-image mycoder -p "Generate docs"
# From CI/CD pipeline
mycoder -p "Review changes" --format json
# From VSCode/IntelliJ extension terminal tool
mycoder -p "Analyze code" --silentThe CLI automatically detects TTY-less environments and adjusts its behavior:
- Skips stdin reading when a prompt is supplied
- Disables interactive UI components
- Ensures clean stdout/stderr output
For more details, see spec/tty-less-support.md.
Build
Development Build
Build the CLI from source:
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode
npm run devPackage for Distribution
Create a distributable tarball for testing:
# In extensions/cli directory, create a tarball
npm pack
# This generates a file like: ocis-mycoder-cli-0.0.3.tgzLocal Installation Testing
Install and test the packaged CLI locally:
# Install from the generated tarball
npm install -g /path/to/ocis-mycoder-cli-0.0.3.tgz
# Verify installation
mycoder --help
mycoder --version
# Test basic functionality
mycoder -p "Hello, world!"Verification
Run smoke tests to verify the build:
# Run comprehensive smoke tests
npm run test:smoke
# Run unit tests
npm test
# Run end-to-end tests
npm run test:e2eThe smoke tests verify:
- Bundle files exist and are executable
- CLI commands work correctly (--version, --help)
- Bundle size is within reasonable limits
- Local packages are properly bundled
- No missing runtime dependencies
For detailed build process documentation, see BUILD.md.
