Skip to content

Commit 6c80df8

Browse files
cursoragentechobt
andcommitted
docs: restructure and expand the product documentation
Splits the old user-guide and exec-mode pages into guides, configuration, customization and reference sections behind a docs/README.md index, and moves the plugin docs under customization/ so nothing is orphaned. New pages cover the TUI, sessions, plan and spec modes, configuration files, environment variables, data locations, agents, MCP, skills, hooks, themes, the full CLI surface, tools, slash commands, keybindings, signing in and troubleshooting. Every flag, key, tool and config key is taken from the clap definitions and the TUI registries rather than invented, and the vendor model names left in the imported pages are gone. Co-authored-by: Mathis <echobt@users.noreply.github.com>
1 parent e8473b5 commit 6c80df8

31 files changed

Lines changed: 3048 additions & 1491 deletions

.rules/docs.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
- README must stay enough to build, log in to `api.cortex.foundation`, run the TUI, and run tests.
44
- User-facing docs live in `docs/`. Do not invent a second docs site in-tree.
5+
- `docs/README.md` is the index. New pages go under `guides/`, `configuration/`, `customization/` or `reference/`, and get a row in the index.
6+
- Document only what the code supports. Check `cortex <command> --help` and the clap definitions before writing a flag down.
7+
- The README banner is `docs/media/intro.gif`, regenerated by `./scripts/render-demo-gif.sh`. Do not replace it with a hand-taken screenshot.
58
- Product name is **Cortex CLI** / **Cortex Code**. Never Grok / Grok Bot / Grok-core.
69
- Document CI secret *names* in `docs/CI_SECRETS.md`. Never commit values.
710
- Changelog is `CHANGELOG.md`. Version-bump on `main` is the release note trigger.

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Match CI (`.github/workflows/ci.yml`):
7373

7474
| Need | Start here |
7575
|------|------------|
76+
| User docs index | [`docs/README.md`](docs/README.md) |
7677
| Security / exec / sandbox | [`.rules/security.md`](.rules/security.md) |
7778
| Product-facing errors | [`.rules/errors.md`](.rules/errors.md) |
7879
| TUI / responsive layout | [`.rules/tui.md`](.rules/tui.md) |

README.md

Lines changed: 136 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,145 @@
1-
# Cortex CLI / Cortex Code
1+
<h1 align="center">Cortex CLI</h1>
22

3-
The Cortex coding-agent harness: a CLI and TUI that talks to [api.cortex.foundation](https://api.cortex.foundation) for Chat/Code turns, tools, computers, plugins, and snapshots.
3+
<p align="center">
4+
<strong>Cortex Code</strong> — a coding agent that runs in your terminal.
5+
</p>
46

5-
Auth is WorkOS session / existing `/v1` auth against `auth.cortex.foundation` and `api.cortex.foundation`. Credentials are stored in the OS keyring.
7+
<p align="center">
8+
<a href="https://github.com/CortexLM/cli/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/CortexLM/cli/actions/workflows/ci.yml/badge.svg"></a>
9+
<a href="./LICENSE"><img alt="License: Apache-2.0" src="https://img.shields.io/badge/license-Apache--2.0-blue.svg"></a>
10+
<a href="https://github.com/CortexLM/cli/releases"><img alt="Latest release" src="https://img.shields.io/github/v/tag/CortexLM/cli?label=release&sort=semver"></a>
11+
<img alt="Built with Rust" src="https://img.shields.io/badge/built%20with-Rust-dea584.svg">
12+
</p>
613

7-
License: [Apache-2.0](./LICENSE).
14+
<p align="center">
15+
<a href="./docs/README.md">Documentation</a> ·
16+
<a href="./docs/guides/getting-started.md">Getting started</a> ·
17+
<a href="./docs/reference/cli.md">CLI reference</a> ·
18+
<a href="https://cortex.foundation">cortex.foundation</a>
19+
</p>
820

9-
## Build
21+
![Demo of Cortex CLI](./docs/media/intro.gif)
1022

11-
Requires current stable Rust (see `rust-toolchain.toml`).
23+
## What is Cortex CLI
24+
25+
Cortex CLI — also called **Cortex Code** — is a coding agent you run from a
26+
terminal in your project. Describe the change you want and it works through it:
27+
searching the codebase, reading the files that matter, editing them, running your
28+
build and tests, and reporting what it did. Every step shows up in the timeline
29+
as it happens, and you decide how much it can do without asking.
30+
31+
One binary gives you:
32+
33+
- **An interactive TUI** with a live timeline, tool approvals, plan and build
34+
modes, session history, rewind and fork.
35+
- **Headless one-shot runs** for scripts and CI, with autonomy levels, structured
36+
JSON output, and turn and time limits.
37+
- **The tools a coding agent needs** — search, read, edit, patch, shell
38+
execution, language-server queries and web fetch — under an approval policy and
39+
a sandbox you control.
40+
- **Extension points**: MCP servers, skills, custom agents and subagents, shell
41+
hooks and WebAssembly plugins.
42+
43+
Cortex CLI talks to the Cortex API at
44+
[api.cortex.foundation](https://api.cortex.foundation) and signs in through
45+
[auth.cortex.foundation](https://auth.cortex.foundation). Credentials are stored
46+
in your OS keyring.
47+
48+
## Install
49+
50+
### Linux and macOS
1251

1352
```bash
14-
# Linux deps used by optional audio / desktop crates
15-
sudo apt-get install -y libasound2-dev pkg-config
53+
curl -fsSL https://software.cortex.foundation/install.sh | sh
54+
```
55+
56+
### Windows
57+
58+
```powershell
59+
irm https://software.cortex.foundation/install.ps1 | iex
60+
```
1661

62+
### From source
63+
64+
Requires the toolchain pinned in [`rust-toolchain.toml`](./rust-toolchain.toml).
65+
66+
```bash
1767
cargo build -p cortex-cli --release
1868
# binary: target/release/Cortex
1969
```
2070

21-
A debug build is enough for local work:
71+
On Linux, the optional audio and desktop crates need ALSA headers:
72+
`sudo apt-get install -y libasound2-dev pkg-config`.
73+
74+
Full instructions, including Homebrew and WinGet, are in
75+
[Getting started](./docs/guides/getting-started.md).
76+
77+
## Quick start
2278

2379
```bash
24-
cargo build -p cortex-cli
25-
./target/debug/Cortex --help
80+
cd ~/code/my-project
81+
cortex
82+
```
83+
84+
That opens the session view from the recording above. Type what you want changed
85+
and press `Enter`:
86+
87+
```
88+
> add a /healthz endpoint and cover it with a test
89+
```
90+
91+
Press `Esc` to interrupt a turn, `Shift+Tab` to change how much autonomy the
92+
agent has, and `?` for help.
93+
94+
Prefer one-shot? Both of these work without a terminal:
95+
96+
```bash
97+
cortex run "explain the release process"
98+
cortex exec --auto read-only --git-diff "review my uncommitted changes"
2699
```
27100

28101
## Login
29102

30103
```bash
31-
# Device-code / WorkOS browser login against the live Cortex API
32-
./target/debug/Cortex login
104+
cortex login
105+
```
106+
107+
This opens the Cortex sign-in flow in your browser and stores the session in
108+
your OS keyring. For machines without a browser:
33109

34-
# Or set a key (still stored via the keyring helpers when you login)
35-
export CORTEX_API_KEY=...
36-
# optional override; default is https://api.cortex.foundation
37-
export CORTEX_API_URL=https://api.cortex.foundation
110+
```bash
111+
cortex login --device-auth # device-code flow
112+
cortex login --sso # enterprise SSO
113+
cortex login --with-api-key # read an API key from stdin
38114
```
39115

40-
`cortex login` opens the Cortex auth flow (`auth.cortex.foundation`). On success the session is written to the OS keyring (`cortex-cli` / `auth`).
116+
Check it worked with `cortex whoami`. See
117+
[Signing in](./docs/reference/login.md) for the full picture.
118+
119+
## Documentation
41120

42-
## Run the TUI
121+
| | |
122+
|---|---|
123+
| [Getting started](./docs/guides/getting-started.md) | Install, sign in, first session |
124+
| [The TUI](./docs/guides/tui.md) | Timeline, composer, modes, approvals |
125+
| [Sessions](./docs/guides/sessions.md) | Resume, export, import, share |
126+
| [Headless / exec mode](./docs/guides/exec.md) | Scripts and CI |
127+
| [Plan and Spec modes](./docs/guides/plan.md) | Approve a plan before anything changes |
128+
| [Configuration](./docs/configuration/config.md) | Files, keys, profiles, permissions |
129+
| [Agents](./docs/customization/agents.md) · [Skills](./docs/customization/skills.md) · [MCP](./docs/customization/mcp.md) · [Hooks](./docs/customization/hooks.md) · [Plugins](./docs/customization/plugins.md) | Extending Cortex |
130+
| [CLI reference](./docs/reference/cli.md) · [Tools](./docs/reference/tools.md) · [Slash commands](./docs/reference/slash-commands.md) · [Keyboard](./docs/reference/keyboard.md) | Reference |
131+
| [Troubleshooting](./docs/troubleshooting.md) | When something does not work |
132+
133+
The index is at [docs/README.md](./docs/README.md).
134+
135+
## Building and testing
43136

44137
```bash
45-
./target/debug/Cortex
46-
# or a one-shot turn
47-
./target/debug/Cortex "explain this repository"
138+
cargo build -p cortex-cli
139+
./target/debug/Cortex --help
48140
```
49141

50-
The TUI is the default when stdin is a TTY. If the coding API is unreachable you will see **The coding service is temporarily unavailable** — not a raw provider or HTTP-client name.
51-
52-
## Tests
142+
The gates CI enforces:
53143

54144
```bash
55145
cargo fmt --all -- --check
@@ -59,7 +149,7 @@ cargo audit
59149
./scripts/check-cli-version.sh
60150
```
61151

62-
Headless TUI / snapshot tests (required when you change a TUI surface):
152+
Headless TUI and snapshot tests, required whenever a TUI surface changes:
63153

64154
```bash
65155
cargo test -p cortex-tui -p cortex-tui-capture -p cortex-tui-components \
@@ -68,20 +158,33 @@ cargo test -p cortex-tui -p cortex-tui-capture -p cortex-tui-components \
68158
-p cortex-tui-input -p cortex-tui-terminal -p cortex-tui-syntax
69159
```
70160

71-
## Install from software.cortex.foundation
72-
73-
Published artifacts (when a release is cut) are at [software.cortex.foundation](https://software.cortex.foundation):
161+
The banner above is generated from this repository, not captured by hand:
74162

75163
```bash
76-
curl -fsSL https://software.cortex.foundation/install.sh | sh
164+
./scripts/render-demo-gif.sh
77165
```
78166

167+
That records the session view headlessly through `cortex-tui-capture` and
168+
rasterises the frames into `docs/media/intro.gif`.
169+
79170
## Release and CI secrets
80171

81-
Merges to `main` run `.github/workflows/version-bump.yml` (patch semver + tag). Tags run `.github/workflows/release.yml`, which can publish to R2 / `software.cortex.foundation` via `.github/workflows/publish-r2.yml`.
172+
Merges to `main` run [`.github/workflows/version-bump.yml`](.github/workflows/version-bump.yml),
173+
which patch-bumps the version and tags it. Tags run
174+
[`release.yml`](.github/workflows/release.yml), which can publish to
175+
[software.cortex.foundation](https://software.cortex.foundation) via
176+
[`publish-r2.yml`](.github/workflows/publish-r2.yml).
82177

83-
This repo does **not** invent cloud accounts. Secret *names* CI already expects are listed in [docs/CI_SECRETS.md](docs/CI_SECRETS.md). Do not put secret values in git.
178+
This repository does not invent cloud accounts. The secret *names* CI expects are
179+
listed in [docs/CI_SECRETS.md](./docs/CI_SECRETS.md). Values never go in git.
84180

85181
## Contributing
86182

87-
See [AGENTS.md](AGENTS.md), [`.rules/`](.rules/), and [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md). Every PR must fill the attestation list in `.github/PULL_REQUEST_TEMPLATE.md`.
183+
Start with [docs/CONTRIBUTING.md](./docs/CONTRIBUTING.md), then
184+
[`AGENTS.md`](./AGENTS.md) and [`.rules/`](./.rules/). Every PR fills the
185+
attestation list in
186+
[`.github/PULL_REQUEST_TEMPLATE.md`](./.github/PULL_REQUEST_TEMPLATE.md).
187+
188+
## Licence
189+
190+
[Apache-2.0](./LICENSE).

0 commit comments

Comments
 (0)