Skip to content

feat(cli): 5-port ready panel + iii console install + global-install prompt + version-string fix#410

Merged
rohitg00 merged 2 commits into
mainfrom
feat/cli-boot-panel
May 15, 2026
Merged

feat(cli): 5-port ready panel + iii console install + global-install prompt + version-string fix#410
rohitg00 merged 2 commits into
mainfrom
feat/cli-boot-panel

Conversation

@rohitg00
Copy link
Copy Markdown
Owner

@rohitg00 rohitg00 commented May 15, 2026

Summary

Four DX wins on the CLI boot flow that were each silent killers individually:

  • 5-port ready panel. printReadyHint switches from Memory ready on :3111 · viewer on ... (which elided Streams, Engine bridge, and iii console) to a clack p.note panel listing all five surfaces. Ports come from III_REST_PORT, III_VIEWER_PORT, III_STREAM_PORT/III_STREAMS_PORT, III_ENGINE_PORT/III_ENGINE_URL — nothing hard-coded. New helpers getStreamPort() and getEnginePort() join the existing getRestPort()/getViewerUrl().
  • iii console install probe. New ensureIiiConsole() detects the binary via whichBinary("iii-console") or ~/.local/bin/iii-console. If absent on a TTY (not CI, not previously declined), prompts to install and shells out to curl -fsSL https://install.iii.dev/console/main/install.sh | sh. iii console is first-class engine UI — surfacing it in the boot panel makes the developer dashboard discoverable from one terminal. We do NOT auto-probe the console's HTTP port: its default 3113 collides with our viewer, so binary presence is the right signal at boot.
  • Global-install prompt. Replaces the passive p.log.info("Tip: install globally…") that users kept ignoring (then typing agentmemory stop in a fresh shell to a command not found). On first npx run (TTY, not CI, not declined), interactive p.confirm runs npm install -g @agentmemory/agentmemory@<VERSION> on yes; on no, persists skipGlobalInstall: true so we never re-prompt.
  • Version-string fix. Engine-mismatch warning said "agentmemory v0.9.14+ pins …" forever — shipping version is 0.9.15. Switched to the live VERSION constant.

Prefs schema gains skipGlobalInstall + skipConsoleInstall (both default false). schemaVersion stays at 1 — the reader already merges over defaults.

Diff stat

 src/cli.ts             | 223 ++++++++++++++++++++++++++++++++++++++++++-------
 src/cli/preferences.ts |  10 +++
 2 files changed, 203 insertions(+), 30 deletions(-)

Sample post-boot panel

Installed iii console case:

│
◇  agentmemory v0.9.15 ────────────────────────────────────────────────────────╮
│                                                                              │
│  REST API     http://localhost:3111                                          │
│  Viewer       http://localhost:3113                                          │
│  Streams      ws://localhost:3112                                            │
│  Engine       ws://localhost:49134                                           │
│  iii console  /Users/<you>/.local/bin/iii-console  (run: iii-console -p      │
│   <port>)                                                                    │
│                                                                              │
├──────────────────────────────────────────────────────────────────────────────╯

Try: agentmemory demo

Missing iii console case (user declined or hasn't been asked):

│
◇  agentmemory v0.9.15 ───────────────────────────────────╮
│                                                         │
│  REST API     http://localhost:3111                     │
│  Viewer       http://localhost:3113                     │
│  Streams      ws://localhost:3112                       │
│  Engine       ws://localhost:49134                      │
│  iii console  (run: curl -fsSL                          │
│  https://install.iii.dev/console/main/install.sh | sh)  │
│                                                         │
├─────────────────────────────────────────────────────────╯

Try: agentmemory demo

Test plan

  • npm run build passes
  • npm test passes (87 files, 954 tests — actually 0 failures, not the expected ~10)
  • Engine version-mismatch warning prints agentmemory v0.9.15 pins v0.11.2 (verified by invoking the dist build with AGENTMEMORY_III_VERSION unset and an iii v0.11.6 on PATH)
  • Panel renders correctly for both installed and missing iii console states
  • Manual: first npx run on a fresh machine prompts global install
  • Manual: declining global install persists skipGlobalInstall: true and we never re-prompt

Notes

  • Coordination: sibling PRs touch src/cli/onboarding.ts (multi-select wire) and MCP messaging strings in src/cli.ts. This PR stays in the boot/ready region of cli.ts plus the prefs schema. Expect a small rebase at merge time.
  • Does not bump VERSION (release PR handles).
  • Does not touch CHANGELOG.md.

Summary by CodeRabbit

  • New Features
    • Interactive first-run CLI prompts to optionally install the tool globally and to detect/install the console binary
    • One-time preference flags to skip global or console install prompts
    • Structured startup hint showing REST, viewer, streams, and engine URLs plus a console run/install line
    • Environment variables to override viewer, stream, and engine ports
    • Engine version warning now references the current pinned version

Review Change Stack

The boot/ready surface now reflects what's actually running and what's
on the menu instead of eliding three services and offering one passive
hint.

1. Five-port ready panel. printReadyHint switches from a single-line
   "Memory ready on :3111 · viewer on ..." to a clack p.note panel
   that lists REST API, Viewer, Streams, Engine bridge, and iii
   console. Each port reads from its env var (III_REST_PORT,
   III_VIEWER_PORT, III_STREAM_PORT / III_STREAMS_PORT,
   III_ENGINE_PORT / III_ENGINE_URL) with sane defaults; nothing
   is hard-coded.

2. iii console install probe + auto-install. New ensureIiiConsole
   detects the binary via whichBinary("iii-console") or
   ~/.local/bin/iii-console. If absent on a TTY (not CI), prompt
   the user; on yes shell out to "curl | sh"; on no persist
   skipConsoleInstall: true. We do NOT probe the console's HTTP
   port: its default 3113 collides with our viewer, so binary
   presence is the right signal at boot time.

3. Global-install prompt replaces maybeEmitNpxHint. Users kept
   ignoring the passive npx tip and then typing "agentmemory stop"
   in a new shell to a "command not found". Now on first npx run
   (TTY, not CI, not already skipped), we ask once and run
   "npm install -g @agentmemory/agentmemory@<VERSION>" on yes. On
   no, we persist skipGlobalInstall: true so we never re-prompt.

4. Version-string fix. The engine-version-mismatch warning quoted
   "agentmemory v0.9.14+ pins ..." forever. Switched to the live
   VERSION constant so the message stays honest across releases.

Preferences schema gains skipGlobalInstall and skipConsoleInstall
(both default false); schemaVersion stays at 1 because the reader
already merges over defaults.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agentmemory Ready Ready Preview, Comment May 15, 2026 5:02pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1481fd15-2d66-49e6-9830-1ec92c23d649

📥 Commits

Reviewing files that changed from the base of the PR and between 5eeeacb and e4e9e8c.

📒 Files selected for processing (1)
  • src/cli.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/cli.ts

📝 Walkthrough

Walkthrough

The CLI adds one-time interactive prompts for global npm and iii-console installs (persisted via new prefs), introduces viewer/stream/engine port helpers and updated engine-version messaging, and prints a structured ready panel listing REST/viewer/streams/engine URLs plus a console run/install line.

Changes

Interactive CLI Startup and Installation Prompts

Layer / File(s) Summary
Preferences schema for install skip flags
src/cli/preferences.ts
Prefs interface adds skipGlobalInstall and skipConsoleInstall booleans; DEFAULTS initializes both to false.
URL/port helpers and engine version text
src/cli.ts
Adds viewer/stream/engine port helper functions honoring III_* env overrides and updates iii-engine version-mismatch warning to use current VERSION.
Interactive install detection and prompts
src/cli.ts
Removes passive npx hint; adds maybeOfferGlobalInstall() for one-time global install offers and detectIiiConsole()/ensureIiiConsole() to detect and optionally install iii-console, persisting skip flags.
Structured ready output with console state
src/cli.ts
printReadyHint(consoleState) renders a note panel with REST, viewer, streams, and engine WS URLs and shows either an installed binary path or install command for iii-console.
Startup path integration
src/cli.ts
--no-engine, engine-already-running, and post-engine-start paths now ensure iii-console, optionally offer global install, and call printReadyHint(consoleState).

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CLI
  participant Preferences
  participant npmRegistry as npm Registry
  participant IiiConsole as iii-console Binary

  User->>CLI: Invoke via npx (TTY, not CI)
  CLI->>Preferences: maybeOfferGlobalInstall() - check skipGlobalInstall
  alt skipGlobalInstall unset and interactive
    CLI->>User: Prompt to npm install -g `@agentmemory/agentmemory`@VERSION
    User->>npmRegistry: Request install
    npmRegistry-->>CLI: Install completes
    CLI->>Preferences: Persist skipGlobalInstall:true
  end

  CLI->>IiiConsole: detectIiiConsole()
  alt iii-console not found
    CLI->>Preferences: check skipConsoleInstall
    alt skipConsoleInstall unset and interactive
      CLI->>User: Prompt to install iii-console
      User->>npmRegistry: Request install
      npmRegistry-->>CLI: Install completes
      CLI->>Preferences: Persist skipConsoleInstall:true
      CLI->>IiiConsole: Re-detect binary
    end
  end

  CLI->>CLI: printReadyHint(consoleState) — render REST/viewer/streams/engine URLs and console command
  CLI->>User: Display ready panel and run/install guidance
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 A tiny prompt, a hop, a nudge so kind,
Preferences saved so prompts stay behind,
WebSocket lights gleam, URLs in a line,
iii-console awaits — the CLI's feeling fine!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.08% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title comprehensively summarizes all major features: 5-port ready panel, iii console install prompt, global-install prompt, and version-string fix.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cli-boot-panel

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/cli.ts`:
- Around line 880-899: The printed commands must match the detected install
mode: update the consoleLine construction (where consoleState is set by
detectIiiConsole()/whichBinary) to render a runnable command — when
consoleState.kind === "installed" print the concrete binary invocation using
consoleState.binPath (e.g., `${consoleState.binPath} -p <port>`) not
`iii-console -p <port>`, and in the fallback branch print the install
instruction using III_CONSOLE_INSTALL_CMD; similarly replace the hardcoded `Try:
agentmemory demo` write with a demoCommand chosen from the install mode (use the
global command when installed, otherwise use an npx/local invocation) so the
suggested command is executable for the current environment.
- Around line 875-879: The ready panel currently hardcodes "localhost" when
building REST/Streams/Engine URLs in printReadyHint; update it to use the
configured host and protocol instead of "localhost" by deriving the base URLs
from the existing getters or environment-configured endpoints (e.g., use any
existing helpers that return full endpoints such as getViewerUrl() or replace
`http://localhost:${getRestPort()}`, `ws://localhost:${getStreamPort()}`, and
`ws://localhost:${getEnginePort()}` with constructions that read the configured
host/protocol (falling back to localhost only if none provided) or by parsing
AGENTMEMORY_URL / III_ENGINE_URL when present so the printed REST/Streams/Engine
addresses reflect the actual bind URLs; keep getViewerUrl() as-is for the viewer
line.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a3ee5316-6387-4750-8e5b-8cf108280337

📥 Commits

Reviewing files that changed from the base of the PR and between c3a613a and 5eeeacb.

📒 Files selected for processing (2)
  • src/cli.ts
  • src/cli/preferences.ts

Comment thread src/cli.ts Outdated
Comment thread src/cli.ts Outdated
…hints

Two findings, both valid against the just-shipped feat/cli-boot-panel
code:

1. The console line printed `(run: iii-console -p <port>)` regardless
   of where the binary actually lived. We just detected the binary
   path two lines earlier — print that as the executable hint
   (`consoleState.binPath -p <port>`) so the suggestion is runnable
   without assuming `iii-console` is on PATH.

2. REST / Streams / Engine URLs hardcoded `localhost`, so a deploy
   that binds `III_ENGINE_URL=ws://remote-host:49134` would print
   misleading addresses. Added `getEngineHost()` which reads
   III_ENGINE_URL or AGENTMEMORY_URL and falls back to localhost.
   REST now uses getBaseUrl() (already honors AGENTMEMORY_URL),
   Streams + Engine read the new host helper. Viewer line untouched
   — getViewerUrl() already handles this correctly.

3. Bonus runnability fix: the "Try: agentmemory demo" suggestion
   assumed the bare command was on PATH. Now picks `npx
   @agentmemory/agentmemory demo` when invoked via npx, falls back
   to the bare form for global installs.

Build clean, 954/954 tests pass.
@rohitg00 rohitg00 merged commit 7530339 into main May 15, 2026
5 checks passed
@rohitg00 rohitg00 deleted the feat/cli-boot-panel branch May 15, 2026 17:03
rohitg00 added a commit that referenced this pull request May 15, 2026
Patch bump per the established rule: additive surface only, no breaks
to MemoryProvider trait, exported types, or default behaviour. New
top-level subcommands (`--reset` already shipped 0.9.15, no new
commands here) are opt-in.

PRs included since v0.9.15:
  #408 — onboarding wires selected agents inline + memory-share callout
  #409 — clarify MCP is opt-in (REST primary)
  #410 — 5-port ready panel, iii console install, global-install prompt
  #411 — splash banner rerender + README install hoist + npx caveat
  #415 — agent-memory.dev refresh (FeaturedIn bar + Agents/Compare/
         CommandCenter/Hero updates)

Files bumped (9):
  package.json, packages/mcp/package.json, plugin/.claude-plugin/plugin.json,
  plugin/.codex-plugin/plugin.json, src/version.ts, src/types.ts,
  src/functions/export-import.ts, test/export-import.test.ts,
  CHANGELOG.md
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.

1 participant