Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ description: >-

## Testing changes

If you touch the CLI resolver block in a skill or command, run `./tests/resolve-cli.sh` — it checks every copy is identical and resolves correctly in bash and zsh.

Smoke-install the plugin from your working copy:

```bash
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ Codex plugin that delegates dbt and warehouse work to [`altimate-code`](https://

## What this gives your Codex agent

One skill: **`altimate-code`** — routes tasks that touch live warehouse state, column lineage, cross-database work, query-cost attribution, schema diffs, PII detection, or FinOps reporting to the altimate-code subprocess. The skill body encodes:
Two skills and matching slash commands. **`altimate-code`** routes tasks that touch live warehouse state, column lineage, cross-database work, query-cost attribution, schema diffs, PII detection, or FinOps reporting to the altimate-code subprocess. The skill body encodes:

- how to check that `altimate-code` is installed
- how to resolve the CLI (`altimate-code`, falling back to `altimate`) and detect that it is not installed
- which agent persona (`fast-edit` / `analyst` / `builder`) to pick for the task shape
- the exact non-interactive invocation with `--yolo` / `--output` / `--dir`
- when to add `--continue` for follow-up tasks in a warm session
- how to surface each failure mode to the user

**`review`** runs `altimate-code review` on dbt project changes (a local diff or a PR) and reports the findings. The slash commands `/altimate-code:altimate` and `/altimate-code:review` invoke the same flows explicitly.

The plugin also ships a `SessionStart` hook that emits a short routing hint into Codex's context so the model prefers delegation over reimplementing warehouse workflows with native tools.

## Install
Expand Down Expand Up @@ -59,19 +61,24 @@ altimate-codex-plugin/
├── hooks/
│ ├── hooks.json # SessionStart hook definition
│ └── altimate-code-session-start.sh # hook script (routing hint)
├── commands/
│ ├── altimate.md # /altimate-code:altimate
│ └── review.md # /altimate-code:review
└── skills/
└── altimate-code/SKILL.md # the one delegation skill
├── altimate-code/SKILL.md # delegation skill
└── review/SKILL.md # dbt change review skill
```

## Companion CLI

The delegation skill spawns `altimate-code` as a subprocess. Install the companion CLI:

```bash
npm install -g altimate-code
npm install -g altimate-code # Node 20+; exposes `altimate` and `altimate-code`
curl -fsSL https://www.altimate.sh/install | bash # standalone binary; exposes `altimate`
```

Node 20+. After install, run `altimate-code` once to configure your LLM provider auth and warehouse connections through the TUI.
After install, run `altimate` once to configure your LLM provider auth and warehouse connections through the TUI.

## License & legal

Expand Down
2 changes: 1 addition & 1 deletion plugins/altimate-code/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "altimate-code",
"version": "1.0.0",
"version": "1.1.0",
"description": "Delegates dbt and warehouse work to altimate-code, a specialized CLI agent with 100+ purpose-built data tools (SQL analysis, column-level lineage, dbt build/test/run, warehouse profiling, FinOps, connectivity to Snowflake, BigQuery, Redshift, Databricks, Postgres, MySQL, DuckDB).",
"author": {
"name": "Altimate AI",
Expand Down
7 changes: 7 additions & 0 deletions plugins/altimate-code/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to the Altimate Code Codex plugin are recorded here.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0] — 2026-10-19

### Fixed
- The skills and slash commands now resolve the CLI as `altimate-code` and fall back to `altimate`. curl and PowerShell installs from v0.7.1 on may expose only `altimate`, so the plugin previously reported "not installed" on machines where the CLI was present. `altimate-code` is tried first because a different tool may own the generic `altimate` name.
- Install guidance and recovery messages now list both the npm and curl install methods and point to `altimate` for first-run auth setup.
- The CLI lookup ignores aliases and shell functions, skips a non-executable match in favour of the other name, and runs before `gh pr checkout` in PR reviews, so a missing CLI never switches your branch. Recovery messages name `altimate` for installs without `altimate-code`.

## [1.0.0] — 2026-07-18

### Added
Expand Down
17 changes: 10 additions & 7 deletions plugins/altimate-code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ Adding the marketplace makes the plugin discoverable in the `/plugins` browser b

## Prerequisites

The altimate-code CLI must be installed and configured on your PATH:
The altimate-code CLI must be installed and configured on your PATH. Either install method works:

```bash
npm install -g altimate-code # requires Node 20+
altimate-code # launch the TUI, then run /connect to configure your LLM provider
npm install -g altimate-code # requires Node 20+; exposes `altimate` and `altimate-code`
curl -fsSL https://www.altimate.sh/install | bash # standalone binary; exposes `altimate`
altimate # launch the TUI, then run /connect to configure your LLM provider
```

The plugin invokes `altimate-code`, which no other tool uses, and falls back to `altimate`, so standalone installs that expose only `altimate` still work.

Or configure a provider via environment variable (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, and 20+ others — see the [altimate-code docs](https://docs.altimate.sh)).

If altimate-code is not on PATH or not configured, the plugin surfaces the failure with fix instructions rather than silently falling back to Codex's native tools.
Expand Down Expand Up @@ -57,12 +60,12 @@ Full details: **[PRIVACY.md](../../PRIVACY.md)** · Security policy and disclosu

| Symptom | Fix |
|---|---|
| `command not found: altimate-code` | `npm install -g altimate-code` (Node 20+), then run `altimate-code` once to configure your provider. |
| `Unauthorized` / `No provider configured` | Run `altimate-code` to open the TUI and reconfigure your provider via `/connect`, or set the provider API key env var. |
| `altimate-code CLI not found` (neither `altimate` nor `altimate-code` on PATH) | `npm install -g altimate-code` (Node 20+) or `curl -fsSL https://www.altimate.sh/install \| bash`, then run `altimate` once to configure your provider. |
| `Unauthorized` / `No provider configured` | Run `altimate-code` (`altimate` on installs without `altimate-code`) to open the TUI and reconfigure your provider via `/connect`, or set the provider API key env var. |
| `Error: Unexpected error — Unknown: FileSystem.open (…altimate-code/log/opencode.log)` | Codex's default `workspace-write` sandbox blocks writes to `~/.local/share/altimate-code/log/`, where the CLI writes its log. Re-run with `codex exec --sandbox danger-full-access …`, or pass `-c 'sandbox_permissions=["disk-full-write-access"]'` on the specific invocation. Frequent users can raise the default in `~/.codex/config.toml`. Codex has no per-plugin sandbox-permission declaration in its manifest schema today, so this is a per-invocation flag. |
| Task hangs for several minutes | Open `altimate-code` to check for a pending prompt in the TUI, or re-run specifying a known-good model. |
| Task hangs for several minutes | Open `altimate-code` (`altimate` on installs without `altimate-code`) to check for a pending prompt in the TUI, or re-run specifying a known-good model. |
| Empty result | The task may be too ambiguous — restate with the target table, expected columns, or time window. |
| `UNKNOWN_USER` / `Database does not exist` mid-run | The CLI connects but your warehouse credentials don't match this project — reconfigure warehouse auth in the `altimate-code` TUI or `profiles.yml`. |
| `UNKNOWN_USER` / `Database does not exist` mid-run | The CLI connects but your warehouse credentials don't match this project — reconfigure warehouse auth in the `altimate-code` TUI (`altimate` on installs without `altimate-code`) or `profiles.yml`. |
| Plugin installed but never delegates | Confirm the SessionStart hook is trusted — Codex asks on first use; if you skipped it, uninstall and reinstall from `/plugins`. |
| Plugin doesn't appear in `/plugins` | Confirm the marketplace is registered: `codex plugin marketplace add AltimateAI/altimate-codex-plugin`, then re-open `/plugins`. |

Expand Down
24 changes: 15 additions & 9 deletions plugins/altimate-code/commands/altimate.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ description: Delegate a task to altimate-code, the specialised data-engineering
argument-hint: <task description>
---

The user explicitly invoked `/altimate-code:altimate` to delegate this task to altimate-code. You MUST run the task via the `altimate-code` CLI — do NOT attempt the work with native `Bash`/`Edit`/`Write` tools.
The user explicitly invoked `/altimate-code:altimate` to delegate this task to altimate-code. You MUST run the task via the altimate-code CLI — do NOT attempt the work with native `Bash`/`Edit`/`Write` tools.

Workflow (follow in order, no skipping):

1. **Verify altimate-code is installed:**
```bash
command -v altimate-code
```
If it returns nothing, stop and tell the user:
> altimate-code is not installed. Install with `npm install -g altimate-code` (Node 20+), then run `altimate-code` once to configure your provider/warehouse auth, then re-run `/altimate-code:altimate <task>`.
1. **Verify altimate-code is installed.** There is no separate check: the run command in step 3 resolves the CLI first, ignoring aliases and shell functions, and exits 127 with `altimate-code CLI not found` before doing anything else. The CLI ships under two names: npm and Homebrew installs expose both `altimate` and `altimate-code`; curl and PowerShell installs from v0.7.1 on may expose only `altimate`, and installs older than v0.7.1 expose only `altimate-code`. The lookup tries `altimate-code` first, because no other tool uses that name, and falls back to `altimate`. Either one is fine. If the run exits with `altimate-code CLI not found`, stop and tell the user:
> altimate-code is not installed. Install with `npm install -g altimate-code` (Node 20+) or `curl -fsSL https://www.altimate.sh/install | bash`, then run `altimate` once to configure your provider/warehouse auth, then re-run `/altimate-code:altimate <task>`.

2. **Pick the agent persona** based on the user's task shape. Start cheap and escalate on failure — fast-edit handles most dbt/SQL work at 10–20× lower cost than builder.

Expand All @@ -35,9 +31,14 @@ Workflow (follow in order, no skipping):
$ARGUMENTS
ALTIMATE_TASK
)"
for ALTIMATE_NAME in altimate-code altimate; do
ALTIMATE_BIN="$(unalias "$ALTIMATE_NAME" 2>/dev/null; unset -f "$ALTIMATE_NAME" 2>/dev/null; command -v "$ALTIMATE_NAME")"
[ -x "$ALTIMATE_BIN" ] && break || ALTIMATE_BIN=
done
[ -n "$ALTIMATE_BIN" ] || { echo "altimate-code CLI not found (tried altimate-code, altimate)" >&2; exit 127; }
umask 077
OUTPUT_FILE="$(mktemp -t altimate-result.XXXXXX.md)"
altimate-code run "$TASK" \
"$ALTIMATE_BIN" run "$TASK" \
--agent <fast-edit|analyst|builder> \
--yolo \
--output "$OUTPUT_FILE" \
Expand All @@ -51,9 +52,14 @@ Workflow (follow in order, no skipping):
$ARGUMENTS
ALTIMATE_TASK
)"
for ALTIMATE_NAME in altimate-code altimate; do
ALTIMATE_BIN="$(unalias "$ALTIMATE_NAME" 2>/dev/null; unset -f "$ALTIMATE_NAME" 2>/dev/null; command -v "$ALTIMATE_NAME")"
[ -x "$ALTIMATE_BIN" ] && break || ALTIMATE_BIN=
done
[ -n "$ALTIMATE_BIN" ] || { echo "altimate-code CLI not found (tried altimate-code, altimate)" >&2; exit 127; }
umask 077
OUTPUT_FILE="$(mktemp -t altimate-result.XXXXXX.md)"
altimate-code run "$TASK" \
"$ALTIMATE_BIN" run "$TASK" \
--agent <fast-edit|analyst|builder> \
--yolo --output "$OUTPUT_FILE" --dir "$(pwd)" \
--continue
Expand Down
25 changes: 18 additions & 7 deletions plugins/altimate-code/commands/review.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,26 @@ Run the `altimate-code review` CLI on the current dbt project and present the si

## Workflow

1. **Verify altimate-code is on PATH.** Run `command -v altimate-code`. If nothing is returned, tell the user: `"altimate-code is not installed. Install with 'npm install -g altimate-code' (Node 20+), then run 'altimate-code' once to configure your provider and warehouse auth."` — then STOP.
1. **Verify altimate-code is on PATH.** There is no separate check: the resolver below runs first in the same shell command as the review, before any `gh pr checkout`. If it exits 127 with `altimate-code CLI not found`, tell the user: `"altimate-code is not installed. Install with 'npm install -g altimate-code' (Node 20+) or 'curl -fsSL https://www.altimate.sh/install | bash', then run 'altimate' once to configure your provider and warehouse auth."` — then STOP.

The CLI ships under two names: npm and Homebrew installs expose both `altimate` and `altimate-code`; curl and PowerShell installs from v0.7.1 on may expose only `altimate`, and installs older than v0.7.1 expose only `altimate-code`. The lookup tries `altimate-code` first, because no other tool uses that name, and falls back to `altimate`. Every review command below runs through `"$ALTIMATE_BIN"`, in the same shell command as this resolver (shell state does not persist between commands). The lookup ignores aliases and shell functions, so a user alias such as `alias altimate-code=altimate` cannot be captured as the binary path:

```bash
for ALTIMATE_NAME in altimate-code altimate; do
ALTIMATE_BIN="$(unalias "$ALTIMATE_NAME" 2>/dev/null; unset -f "$ALTIMATE_NAME" 2>/dev/null; command -v "$ALTIMATE_NAME")"
[ -x "$ALTIMATE_BIN" ] && break || ALTIMATE_BIN=
done
[ -n "$ALTIMATE_BIN" ] || { echo "altimate-code CLI not found (tried altimate-code, altimate)" >&2; exit 127; }
<the scope command chosen below, run through "$ALTIMATE_BIN">
```

2. **Confirm you are in a dbt project root** (`dbt_project.yml` present). If not, tell the user to `cd` there and STOP.

3. **Determine scope from `$ARGUMENTS`:**
- Empty → `altimate-code review`
- Commit SHA (matches `[0-9a-f]{7,40}`) → `altimate-code review --base $ARGUMENTS~1 --head $ARGUMENTS`
- Branch name (matches local branch via `git rev-parse`) → `altimate-code review --base $ARGUMENTS`
- PR URL or number → first `gh pr checkout <n>`, then `altimate-code review`
- Empty → `"$ALTIMATE_BIN" review`
- Commit SHA (matches `[0-9a-f]{7,40}`) → `"$ALTIMATE_BIN" review --base $ARGUMENTS~1 --head $ARGUMENTS`
- Branch name (matches local branch via `git rev-parse`) → `"$ALTIMATE_BIN" review --base $ARGUMENTS`
- PR URL or number → `gh pr checkout <n> && "$ALTIMATE_BIN" review`, in the same shell command after the resolver so a missing CLI stops before the checkout

4. **Run the review command as chosen above.** Capture its stdout.

Expand Down Expand Up @@ -53,8 +64,8 @@ Anything else (`--manifest`, `--cwd`) only if the user explicitly requested it o

| Symptom | Message to user |
|---|---|
| `command not found: altimate-code` | "altimate-code is not installed. Install with `npm install -g altimate-code` (Node 20+), then run `altimate-code` once to configure auth." |
| `Unauthorized: Incorrect auth token` | "altimate-code's LLM provider auth is misconfigured. Run `altimate-code` to reconfigure, or re-run with `--no-ai`." |
| `altimate-code CLI not found` (neither `altimate` nor `altimate-code` on PATH) | "altimate-code is not installed. Install with `npm install -g altimate-code` (Node 20+) or `curl -fsSL https://www.altimate.sh/install \| bash`, then run `altimate` once to configure auth." |
| `Unauthorized: Incorrect auth token` | "altimate-code's LLM provider auth is misconfigured. Run `altimate-code` (`altimate` on installs without `altimate-code`) to reconfigure, or re-run with `--no-ai`." |
| `fatal: not a git repository` | "This directory isn't a git repo. `altimate-code review` needs git to compute the diff." |
| No `dbt_project.yml` | "No dbt project detected at this path. Run from the directory with `dbt_project.yml`." |
| Output mentions `DEGRADED — lint-only` | Present verbatim; do NOT silently upgrade a degraded run to a full verdict. |
Loading