fix(cli): smooth the setup and uninstall TUI rough edges

What does this MR do and why?

On a machine with no detected agent, orbit setup crashed. A second setup backed up Orbit's own files, and uninstall left those backups behind. The opencode plugin looked for the graph in the wrong folder, so its reminder never showed. Setup run from a folder that is not a git repository indexed every repository under it. This fixes those bugs and the smaller display problems a first-time user sees.

Testing

I ran every flow in tmux with an empty HOME. The full orbit-cli test suite, fmt, and clippy pass.

No agent detected

Before:

┌  Orbit setup (instructions, hooks, skill)
│
Error: No items added to the list

After:

┌  Orbit setup (instructions, hooks, skill)
│
◆  Which agents should use Orbit?
│  ◻ Claude Code (not detected)
│  ◻ Codex
│  ◻ GitLab Duo
│  ◻ OpenCode
│  ◻ Pi
└  space toggles, enter confirms
Second orbit setup -y -v (also shows the blank gap after each card, and the unaligned columns)

Before:

◇  instructions ───────────────────────────────╮
│  ~/.claude/CLAUDE.md  orbit section updated  │
│  ~/.codex/AGENTS.md  orbit section updated   │
├──────────────────────────────────────────────╯
│

◇  hooks ───────────────────────────────────────────────────────────────────╮
│  ~/.claude/settings.json  backup at ~/.claude/settings.json.orbit-backup  │
│  ~/.claude/settings.json  orbit entries installed                         │
├───────────────────────────────────────────────────────────────────────────╯
│

◇  skill ───────────────────────────────────────╮
│  ~/.agents/skills/orbit-cli  skill installed  │
│  ~/.claude/skills/orbit-cli  already linked   │
├───────────────────────────────────────────────╯

After:

◇  instructions ───────────────────╮
│  ~/.claude/CLAUDE.md  unchanged  │
│  ~/.codex/AGENTS.md  unchanged   │
├──────────────────────────────────╯
│
◇  hooks ──────────────────────────────╮
│  ~/.claude/settings.json  unchanged  │
├──────────────────────────────────────╯
│
◇  skill ──────────────────────────────────────╮
│  ~/.agents/skills/orbit-cli  unchanged       │
│  ~/.claude/skills/orbit-cli  already linked  │
├──────────────────────────────────────────────╯

The column alignment was added after this capture. A first install now shows:

◇  mcp server ─────────────────────────────────────────╮
│  ~/.claude.json         mcp server orbit registered  │
│  ~/.codex/config.toml   mcp server orbit registered  │
├──────────────────────────────────────────────────────╯
Files left after setup, setup, uninstall

Before: ~/.claude/settings.json.orbit-backup stays, and it holds only the Orbit hooks. After: no .orbit-backup file stays.

Esc in the picker

Before:

■  Which agents should use Orbit?
│  Claude Code
└  Operation cancelled.
Error: operation interrupted
EXIT=1

After:

■  Which agents should use Orbit?
└  Operation cancelled.
EXIT=130
orbit uninstall -y with nothing installed

Before:

┌  Orbit uninstall (instructions, hooks, skill, mcp server)
│
└  No agent selected.

After:

┌  Orbit uninstall (instructions, hooks, skill, mcp server)
│
└  Orbit is not set up for any agent. Nothing to remove.
Setup in a folder that is not a git repository, with two repositories inside it

Before: setup indexes every repository under the folder, without a question.

◇  orbit index .  42 files, 929 definitions, 1s; 42 files, 929 definitions, 0s
│
└  Done. Ask your agent where a function is defined.

After: setup indexes only the repository that holds the current directory. Outside a repository, it shows the command to run.

◇  Try it ────────╮
│  orbit index .  │
├─────────────────╯
│
└  Done. Run it in a repository, then ask your agent where a function is defined.
Closing line of orbit setup --no-index

Before: the command is in the prose and is wrong, because orbit index needs a path.

└  Done. Run orbit index in a repository, then ask your agent where a function is defined.

After: the command is in the same card as the grep suggestion.

◇  Try it ────────╮
│  orbit index .  │
├─────────────────╯
│
└  Done. Run it in a repository, then ask your agent where a function is defined.
opencode plugin

Before: the plugin checks ~/.orbit/graph.duckdb, but the CLI writes ~/.gitlab/orbit/graph.duckdb, so the reminder never shows. After: I ran the installed plugin in node with a graph file at the default path:

"ls result\n\n[orbit] Grep means run orbit grep 'words'. FTS, not regex."

Performance Analysis

  • This merge request does not introduce any performance regression. If a performance regression is expected, explain why.
Agent context: long-form analysis, file-by-file walkthroughs, profiler output, alternatives considered

The picker lists all agents and preselects the detected ones. A file gets a backup only when Orbit is not in it yet. The plugin now has a checksum line, so uninstall can tell if a user edited it. The old exact-text compare already failed after the reminder text changed. Plugins without the checksum get one backup on the next setup.

Edited by Jean-Gabriel Doyon

Merge request reports

Loading
Loading