migrai-code

command module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 2 Imported by: 0

README

MigrAI Code

AI coding agent for the terminal.

MigrAI Code is a fork of OpenCode (MIT License), customized for the MigrAI platform. OpenCode was created by @kujtimiihoxha and the project has since been archived upstream, continuing as Crush under the Charm team.


Features

  • Interactive TUI built with Bubble Tea
  • Multiple AI providers: OpenAI, Anthropic, Google Gemini, AWS Bedrock, Groq, Azure OpenAI, GitHub Copilot, OpenRouter
  • Session management with persistent SQLite storage
  • Tool integration: shell commands, file search, code editing, LSP diagnostics
  • MCP (Model Context Protocol) support for external tool servers
  • Non-interactive prompt mode for scripting and automation

Installation

From Source (Go)
go install github.com/brunohelius/migrai-code/cmd/...@latest
Build Locally
git clone https://github.com/brunohelius/migrai-code.git
cd migrai-code
go build -o migrai-code ./cmd/...
./migrai-code

Quick Start

Set your API key for the provider you want to use:

# Anthropic (Claude)
export ANTHROPIC_API_KEY="your-key"

# OpenAI
export OPENAI_API_KEY="your-key"

# Google Gemini
export GEMINI_API_KEY="your-key"

# MigrAI platform key (when available)
export MIGRAI_API_KEY="your-key"

Then launch the agent:

migrai-code

Or run a single prompt non-interactively:

migrai-code -p "Explain the use of context in Go"

Configuration

MigrAI Code looks for configuration in:

  • $HOME/.migrai-code.json
  • $XDG_CONFIG_HOME/migrai-code/.migrai-code.json
  • ./.migrai-code.json (project-local)

See the full configuration reference in the upstream OpenCode documentation.


Command-Line Flags

Flag Short Description
--help -h Display help
--version -v Print version
--debug -d Enable debug mode
--cwd -c Set working directory
--prompt -p Run a single prompt (non-interactive)
--output-format -f Output format: text (default) or json
--quiet -q Hide spinner in non-interactive mode

  • MigrAI -- MigrAI platform
  • OpenCode -- upstream (archived, MIT)
  • Crush -- upstream continuation by Charm

License

MIT License. See LICENSE for details.

Portions of this software are derived from OpenCode, copyright its original authors, used under the MIT License.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
schema command
internal
app
auth
Package auth handles authentication for the MigrAI Code CLI, including OAuth 2.0 Device Authorization Grant (RFC 8628) and credential storage.
Package auth handles authentication for the MigrAI Code CLI, including OAuth 2.0 Device Authorization Grant (RFC 8628) and credential storage.
config
Package config manages application configuration from various sources.
Package config manages application configuration from various sources.
db
lsp
Generated code.
Generated code.
tui

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL