Skip to content

Instantly share code, notes, and snippets.

@matthew-gerstman
Created February 10, 2026 23:50
Show Gist options
  • Select an option

  • Save matthew-gerstman/00bc997aa31bc04243e1d299e224857f to your computer and use it in GitHub Desktop.

Select an option

Save matthew-gerstman/00bc997aa31bc04243e1d299e224857f to your computer and use it in GitHub Desktop.
Plan: Upgrade CLI to React 19 + Ink 6

Upgrade CLI to React 19 + Ink 6

Context

The CLI is isolated from the monorepo (excluded from workspaces in root package.json, has its own cli/bun.lock) solely because Ink 5 required React 18 while the dashboard uses React 19. Ink 6 now supports React 19, so the version conflict no longer exists. This upgrade unblocks agents that trip over the React 18 isolation and simplifies the monorepo setup.

Commits

  1. feat(cli): upgrade to React 19 + Ink 6
  2. refactor(cli): integrate CLI into monorepo workspaces
  3. docs: remove React 18 isolation references from CLI docs

Commit 1: feat(cli): upgrade to React 19 + Ink 6

Bump versions in cli/package.json while keeping CLI isolated (so we can test the upgrade in isolation first):

Package Current Target
react 18.3.1 ^19.2.2
ink ^5.1.0 ^6.2.0
@inkjs/ui ^2.0.0 keep (peerDep ink>=5 satisfied)
ink-link ^5.0.0 keep (peerDep ink>=6 satisfied)
@types/react ^18.3.0 ^19.2.6

No TUI code changes expected. The 20 TUI files use only stable APIs (Box, Text, render, useApp, useInput, useStdout, useStdin, memo, standard React hooks). React 19 has no breaking changes for these patterns.

Steps:

  1. Edit cli/package.json — update the 4 versions above
  2. Run cd cli && bun install to regenerate cli/bun.lock
  3. Run bun obvious typecheck --changed to verify types
  4. Manual smoke test: bun obvious up — verify TUI renders, keyboard works

Commit 2: refactor(cli): integrate CLI into monorepo workspaces

Now that React versions match, remove the isolation:

  1. package.json (root) — add "cli" to workspaces array:

    "workspaces": ["apps/*", "cli", "dashboard", "functions/*", "packages/*"]
  2. Delete cli/bun.lock — root lockfile now manages CLI deps

  3. cli/cli-bootstrap.sh — change cd "$CLI_DIR" && bun install to cd "$PROJECT_ROOT" && bun install --frozen-lockfile (root install now covers CLI)

  4. cli/src/check-deps.ts — update printMissingDepsError() message: remove "isolated dependencies (React/Ink)" phrasing, point to bun install at project root instead of ./cli/cli-bootstrap.sh

  5. Run bun install from root to regenerate root bun.lock with CLI deps

  6. Verify: bun obvious up still works, bun obvious typecheck --changed

Note on check-deps.ts: The checkCliDeps() function checks for cli/node_modules/react and cli/node_modules/ink. Bun workspaces create symlinks in workspace node_modules, so this check still works.

Commit 3: docs: remove React 18 isolation references from CLI docs

Update documentation that references the now-removed isolation strategy:

  • cli/AGENTS.md — remove/rewrite "IMPORTANT: React 18 Isolation" section (~lines 63-87)
  • cli/CLI_AGENT_GUIDE.md — remove "React 18 Isolation" section (~lines 481-495)
  • cli/TUI_GUIDE.md — update stack table: react 18.3.1 → 19.x, ink 5.1.0 → 6.x

Key files

  • cli/package.json — version bumps
  • package.json (root) — workspaces array, resolutions
  • cli/bun.lock — delete after workspace integration
  • cli/cli-bootstrap.sh — simplify install command
  • cli/src/check-deps.ts — update error messaging
  • cli/AGENTS.md, cli/CLI_AGENT_GUIDE.md, cli/TUI_GUIDE.md — doc updates

Verification

  1. bun obvious typecheck --changed — types pass
  2. bun obvious up — TUI renders, all panels work, keyboard shortcuts functional
  3. bun obvious up --no-tui — console mode still works
  4. Verify @inkjs/ui components work: Select, TextInput, ConfirmInput, Alert, Badge, StatusMessage
  5. cd cli && bun run build — compiled binary builds successfully

Risks

  • @inkjs/ui v2 + Ink 6: peerDep says >=5 so it should work, but it's ~2 years old. If runtime issues appear, can vendor the specific components or bump to a newer version.
  • Workspace hoisting: If bun hoists in a way that breaks check-deps.ts, adjust the path resolution. Low risk — bun creates symlinks in workspace node_modules.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment