<p align="center">
<img src="logo.png" alt="magi-code logo" width="100%">
</p>
<h1 align="center">magi-code</h1>
<p align="center">
A terminal coding agent that works in your repository. Read and edit files, run commands, and keep working across saved sessions.
</p>
<p align="center">
<img alt="Rust 2024" src="https://img.shields.io/badge/Rust-2024-000000?logo=rust&logoColor=white">
<img alt="Version pre-1.0" src="https://img.shields.io/badge/version-pre--1.0-blue">
<img alt="License: Apache 2.0 plus Commons Clause" src="https://img.shields.io/badge/license-Apache%202.0%20%2B%20Commons%20Clause-lightgrey">
<a href="docs/features/provider-authentication.md"><img alt="Providers" src="https://img.shields.io/badge/providers-Codex%20%7C%20Anthropic%20%7C%20custom-412991"></a>
</p>
## Quick start
You need [Rust 1.88.0+ and Cargo](https://rustup.rs/), network access, and a supported provider account or API key.
```sh
cargo install magi-code --version 0.77.1 --locked
cd /path/to/your/repository
magi-code
```
For Codex, connect your account in Mission Control:
```text
/login openai-codex
```
Magi-code also supports Anthropic API keys and configured OpenAI-compatible providers. See [provider setup](docs/features/provider-authentication.md) for those options. Bare `/login` opens Connect Provider.
Ask a question or describe a change. Mission Control starts by default; optionally supply its first prompt:
```sh
magi-code --prompt "Summarize this repository."
```
Use `magi-code --help` for commands, or `/help` in Mission Control. For pinned versions, source installs, and updates, see [Installation and updates](docs/features/installation-and-updates.md).
## What it does
- Reads repository instructions and uses file, search, editing, and shell tools.
- Researches public pages with `web` search/open/find; network research uses `EXA_API_KEY`.
- Saves sessions so you can resume work and manage conversation context.
- Supports skills, custom agent profiles, and parallel subagents.
- Connects to MCP tools and optional language-server diagnostics.
- Runs in Mission Control or as a JSONL service for other frontends (`--app service`).
## Guides
| Choose a provider or model | [Provider authentication](docs/features/provider-authentication.md) |
| Change settings | [Configuration](docs/features/configuration.md) |
| Learn commands and shortcuts | [Commands and interfaces](docs/features/commands-and-interfaces.md), [Mission Control](docs/features/mission-control-tui.md) |
| Resume, compact, or export a session | [Sessions and context](docs/features/sessions-context-cache.md) |
| Add instructions or skills | [Instructions, skills, and agents](docs/features/instructions-prompts-skills-and-agents.md) |
| Connect external tools | [MCP setup](docs/features/mcp-stdio-tools.md) |
| Fix a problem | [Troubleshooting](docs/features/troubleshooting.md) |
See [all feature guides and maintainer references](docs/features/README.md) for tools, hooks, themes, subagents, and development workflows.
## Safety
Magi-code can edit files and run commands. Shell guardrails are **not an OS-level sandbox**; isolate untrusted repositories separately.
Settings and saved state default to `~/.magi-code`; set `MC_HOME` to use another location. Keep credentials out of `settings.json` and never commit auth files or secrets. See [Security notes](docs/features/security.md) for credential handling and tool limits.
## Development
Start with [Contributing](CONTRIBUTING.md) for source setup, the folder map, and contributor guidance.
See the [testing guide](docs/features/risk-based-testing.md), [release checklist](docs/release.md), and [architecture decisions](docs/adr/).
## License
Magi-code uses Apache License 2.0 with Commons Clause. It is source-available, not OSI-approved open source or plain Apache-2.0.
You may modify it, redistribute it for free, and use it commercially inside your organization, subject to the required notices. You may not sell magi-code itself or a product or service whose value comes entirely or substantially from its functionality. See [LICENSE](LICENSE) for the full terms.