<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="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 --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 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; Codex search uses Codex OAuth, other search uses `EXA_API_KEY`, and URL open fetches directly without a 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.
- Adds optional [Jev-native functionality](docs/features/jev-and-internal-tooling.md): typed agent judgments, Bash and prose checks, prompt injection protection, and completion verification.
- Runs in Mission Control in your terminal.
## Documentation
Start with the [user guide](docs/user/README.md).
| Install and run a first prompt | [Getting started](docs/user/getting-started.md) |
| Learn the terminal interface | [Mission Control](docs/user/mission-control.md) |
| Configure providers, models, or settings | [Providers and models](docs/user/providers-and-models.md), [Configuration](docs/user/configuration.md) |
| Continue, compact, summarize, or export work | [Sessions and context](docs/user/sessions.md) |
| Review changes and comments | [Review and history](docs/user/review-and-history.md) |
| Customize agents or delegate work | [Customization](docs/user/customization.md), [Side agents and parallel work](docs/user/agents-and-delegation.md) |
| Fix a problem | [Troubleshooting](docs/user/troubleshooting.md) |
Need settings keys, limits, storage behavior, or implementation details? Use the [technical feature reference](docs/features/README.md).
## 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.