Skip to content

feat(cli): add tigris init wizard for AI agent onboarding#203

Merged
designcode merged 2 commits into
mainfrom
feat/cli-init-wizard
Jul 23, 2026
Merged

feat(cli): add tigris init wizard for AI agent onboarding#203
designcode merged 2 commits into
mainfrom
feat/cli-init-wizard

Conversation

@designcode

@designcode designcode commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

What

Adds tigris init — brings over the init-wizard work from the old tigrisdata/cli repo (feat/init-wizard) into the monorepo's packages/cli, then extends it.

Two modes:

  • tigris init — interactive wizard: detects installed editors, installs/updates the CLI, writes the Tigris remote MCP server config, and installs the Tigris agent skills (via npx skills). No login — the remote MCP server authenticates in-browser on first connect.
  • tigris init --agent — prints a plain-text setup recipe for an AI coding agent to run itself (no interactive prompts, no JSON).

Editors supported (MCP config + skills)

10 editors, each written with its real MCP config shape (verified against each tool's docs):

Editor Format Notes
Claude Code, Cursor, VS Code, Windsurf JSON original four
Gemini CLI JSON mcpServers httpUrl
opencode JSON mcp {type:remote,enabled}
Roo Code JSON mcpServers streamable-http, project .roo/mcp.json
Zed JSON context_servers stdio-only → mcp-remote bridge
Codex TOML idempotent [mcp_servers.tigris] upsert
Cline JSON VS Code globalStorage; only written if Cline is installed

Notes

  • "Defaults" installs all skills without prompting; only the "Customize" flow shows the skill picker.
  • @clack/prompts pinned to ^1.7.0.
  • Two least-clean targets: Cline (global-only, deep per-OS VS Code path, guarded) and Codex (TOML).

Verification

  • Typecheck (main + binary tsconfigs), Biome, and build all pass.
  • Config generation verified for all 10 editors — correct shapes, idempotent, preserves pre-existing servers/tables.
  • tigris init --agent output and the non-TTY guard exercised end-to-end.
  • Full CLI suite: 780 passed / 214 skipped (incl. specs-completeness).
  • Changeset added (@tigrisdata/cli minor).

🤖 Generated with Claude Code


Note

Medium Risk
The wizard writes and merges user/editor config files and can run global npm install/npx; mistakes could break local MCP setups, though errors are isolated per editor and secrets are only described in the --agent recipe, not written by init itself.

Overview
Adds tigris init (alias start) as a new onboarding command in specs.yaml, wired through packages/cli/src/lib/init/.

Interactive mode runs a @clack/prompts wizard: detect installed AI editors, optionally install/update the global CLI (npm install -g or tigris update), merge the hosted Tigris MCP server (https://mcp.storage.dev/mcp) into each editor’s config (JSON/JSONC via jsonc-parser, TOML for Codex), and install Tigris skills via npx skills add. It sets TIGRIS_NO_UPDATE_CHECK so the normal post-command update notifier doesn’t interrupt the flow, requires a TTY, and ends with a note to run tigris init --agent (or npx @tigrisdata/cli init --agent).

--agent mode only prints the plain-text recipe from plan.ts (login, org/bucket, access key + .env guidance) for a coding agent to execute—no prompts or file writes in that path.

Shared logic in shared.ts covers 10 editors (per-tool MCP shapes, scope fallbacks, editor detection, skills args). Per-editor MCP failures are logged and skipped so one bad config doesn’t abort the rest.

Minor release noted in .changeset/cli-init-wizard.md; lockfile picks up the new dependencies.

Reviewed by Cursor Bugbot for commit 6c29adc. Bugbot is set up for automated code reviews on this repo. Configure here.

Port the init command from tigrisdata/cli@feat/init-wizard into the
monorepo. `tigris init` runs an interactive setup (editor selection,
CLI install/update, remote MCP config, agent skills); `tigris init
--agent` emits an onboarding plan for an AI coding agent.

Assisted-by: Claude Opus 4.8 via Claude Code
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread packages/cli/src/lib/init/interactive.ts Outdated
Comment thread packages/cli/src/lib/init/interactive.ts
@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds an onboarding wizard for connecting Tigris to AI coding agents. The main changes are:

  • A new interactive tigris init command.
  • MCP configuration for ten supported editors.
  • Project or global agent-skill installation.
  • A plain-text tigris init --agent setup recipe.
  • A new prompt dependency and CLI changeset.

Confidence Score: 4/5

The onboarding path is not safe to merge until organization selection, credential cleanup, and configuration failure handling are fixed.

  • Access keys can be created in the wrong organization.
  • Secret-bearing temporary files remain on disk.
  • Existing Codex TOML can become invalid.
  • Filesystem and CLI update failures can leave setup incomplete.

packages/cli/src/lib/init/plan.ts, packages/cli/src/lib/init/shared.ts, packages/cli/src/lib/init/interactive.ts

Security Review

The agent recipe stores a newly created access-key secret in a plaintext temporary file without permission hardening or cleanup. Reusing the file can also mix multiple credentials.

Important Files Changed

Filename Overview
packages/cli/src/lib/init/interactive.ts Adds the interactive flow, CLI installation, MCP writes, and skill installation; write and update failures can leave setup incomplete.
packages/cli/src/lib/init/shared.ts Adds editor definitions, path detection, skill arguments, and JSON/TOML merging; existing alternate config shapes are not handled safely.
packages/cli/src/lib/init/plan.ts Adds the agent setup recipe; organization selection is not applied and temporary credentials are not securely removed.
packages/cli/src/lib/init/index.ts Dispatches cleanly between interactive and agent modes.
packages/cli/src/specs.yaml Registers the new command, alias, examples, and agent flag.
packages/cli/package.json Adds the prompt library used by the interactive wizard.

Reviews (1): Last reviewed commit: "feat(cli): expand init editors, all-skil..." | Re-trigger Greptile

Comment thread packages/cli/src/lib/init/plan.ts Outdated
Comment thread packages/cli/src/lib/init/plan.ts Outdated
Comment thread packages/cli/src/lib/init/shared.ts Outdated
Comment thread packages/cli/src/lib/init/shared.ts Outdated
Comment thread packages/cli/src/lib/init/interactive.ts Outdated
Comment on lines +260 to +267
if (latest && isNewerVersion(installed, latest)) {
runCommand(
'npm',
['install', '-g', '@tigrisdata/cli@latest', '--ignore-scripts'],
`Updating Tigris CLI ${installed} → ${latest}`
);
return true;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Failed Update Reports CLI Available

When the installed CLI is outdated and the global npm update fails, this branch discards the failure and returns true. The handoff then recommends tigris init --agent; an older release that predates init cannot run that command, despite the wizard continuing as if setup succeeded.

Suggested change
if (latest && isNewerVersion(installed, latest)) {
runCommand(
'npm',
['install', '-g', '@tigrisdata/cli@latest', '--ignore-scripts'],
`Updating Tigris CLI ${installed}${latest}`
);
return true;
}
if (latest && isNewerVersion(installed, latest)) {
return runCommand(
'npm',
['install', '-g', '@tigrisdata/cli@latest', '--ignore-scripts'],
`Updating Tigris CLI ${installed}${latest}`
).ok;
}

@Xe Xe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved modulo the bugbot gripes

Comment thread packages/cli/src/lib/init/plan.ts Outdated
* coding agent to follow — running the listed `tigris` commands itself and
* making decisions per each step.
*/
export function printAgentSetup() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a function instead of an exposed public const?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah we don't need this as a function

Comment thread .changeset/cli-init-wizard.md Outdated
Add `tigris init` to connect Tigris to AI coding agents. The interactive wizard
detects installed editors, installs/updates the CLI, writes the Tigris remote
MCP server config for 10 editors (Claude Code, Cursor, VS Code, Windsurf, Codex,
Gemini CLI, Cline, Zed, Roo Code, opencode), and installs the Tigris agent

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gemini CLI is deprecated

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaced with Antigravity CLI

Comment thread packages/cli/src/lib/init/plan.ts Outdated
Comment thread packages/cli/src/lib/init/interactive.ts Outdated
Comment thread packages/cli/src/lib/init/shared.ts Outdated
Comment thread packages/cli/src/lib/init/shared.ts Outdated
Comment thread packages/cli/src/lib/init/interactive.ts
Comment thread packages/cli/src/lib/init/shared.ts Outdated
Comment thread packages/cli/src/lib/init/shared.ts
Comment thread packages/cli/src/lib/init/shared.ts Outdated
Comment thread packages/cli/src/lib/init/shared.ts Outdated
Comment thread packages/cli/src/lib/init/shared.ts
Comment thread packages/cli/src/lib/init/shared.ts
Comment thread packages/cli/src/lib/init/index.ts
Comment thread packages/cli/src/lib/init/interactive.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 85b7cd7. Configure here.

Comment thread packages/cli/src/lib/init/shared.ts Outdated
Comment thread packages/cli/src/lib/init/interactive.ts
… recipe

Build on the initial `tigris init` port:

- Support 10 AI editors, each with its verified MCP config: Claude Code,
  Cursor, VS Code, Windsurf, Codex (TOML), Antigravity CLI, Cline (VS Code
  globalStorage), Zed (mcp-remote bridge), Roo Code, opencode. MCP files are
  edited with jsonc-parser so JSONC (comments/trailing commas) survives; shape
  guards reject non-object maps and inline/annotated TOML keys.
- "Defaults" installs all skills without prompting; only "Customize" asks.
- `tigris init --agent` prints a plain-text setup recipe (org select, secure
  temp file for the secret, correct IAM endpoint) and suppresses the
  update-notifier so stdout stays clean.
- Cross-platform: spawn npm/npx/tigris via cmd.exe on Windows; global skills
  dirs honor XDG_CONFIG_HOME/CODEX_HOME; detect editors where we actually write
  (Cline globalStorage, Antigravity ~/.gemini/config, opencode .jsonc).
- Robust command handling: keep the process alive during the registry check,
  surface install/update failures, verify `tigris` on PATH after install, and
  update via the CLI's own updater (npm/brew/binary).

Adds @clack/prompts and jsonc-parser; changeset included.

Assisted-by: Claude Opus 4.8 via Claude Code
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@designcode
designcode force-pushed the feat/cli-init-wizard branch from 85b7cd7 to 6c29adc Compare July 23, 2026 13:45
@designcode
designcode merged commit fa9292c into main Jul 23, 2026
2 checks passed
@designcode
designcode deleted the feat/cli-init-wizard branch July 23, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants