# Getting started
Install magi-code, connect a provider, and start your first conversation.
## Before you begin
You need:
- Rust 1.88 or later with Cargo
- a terminal
- a repository you want to work in
- a supported provider account or API key
Install Rust from [rustup.rs](https://rustup.rs/) if `cargo --version` does not work.
## Install magi-code
```sh
cargo install magi-code --locked
```
Cargo installs the `magi-code` command. If your shell cannot find it, add Cargo's binary directory to `PATH`:
```sh
export PATH="$HOME/.cargo/bin:$PATH"
```
## Open your repository
```sh
cd /path/to/your/repository
magi-code
```
Mission Control opens in your terminal. Magi-code works from the directory where you launch it, so start it at your repository root unless you intend to limit work to a subdirectory.
## Connect a provider
Enter this in Mission Control:
```text
/login
```
Choose a provider:
- OpenAI Codex uses ChatGPT browser sign-in.
- OpenAI uses an `OPENAI_API_KEY` environment variable.
- Anthropic uses an `ANTHROPIC_API_KEY` environment variable.
- Custom Provider connects an OpenAI-compatible service.
Magi-code does not ask you to paste API keys into the interface. Set the provider's environment variable before launching it. For provider-specific setup, see [provider authentication](../features/provider-authentication.md).
## Send a first prompt
Try a read-only task first:
```text
Summarize this repository and identify its main entry points. Do not change files.
```
Press `Enter` to submit. Mission Control shows responses in the transcript. Open Activity Tree from the header or with `Alt-1` to inspect tool activity.
Next, try a small change with a clear verification step:
```text
Update the README to clarify local setup, then check the resulting diff.
```
Review changed files in the Diff view before committing them.
## Start with an initial prompt
You can queue the first prompt when launching:
```sh
magi-code --prompt "Summarize this repository."
```
This still opens Mission Control. Magi-code does not provide a non-interactive one-shot mode.
## Leave and return
Exit with `Ctrl-D` or `/quit`. To continue your most recent saved session:
```sh
magi-code --continue
```
Use `/sessions` to choose another session from Mission Control.
## Update magi-code
When Mission Control reports an update, run `/update`. You can also update outside Mission Control:
```sh
magi-code --update
```
For source installs, custom Cargo roots, and update recovery, see [installation and updates](../features/installation-and-updates.md).
## Next steps
- [Learn Mission Control](mission-control.md)
- [Browse user guides](README.md)
- [Troubleshoot a problem](troubleshooting.md)