feat(cli): 5-port ready panel + iii console install + global-install prompt + version-string fix#410
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe 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. ChangesInteractive CLI Startup and Installation Prompts
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
src/cli.tssrc/cli/preferences.ts
…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.
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
Summary
Four DX wins on the CLI boot flow that were each silent killers individually:
printReadyHintswitches fromMemory ready on :3111 · viewer on ...(which elided Streams, Engine bridge, and iii console) to a clackp.notepanel listing all five surfaces. Ports come fromIII_REST_PORT,III_VIEWER_PORT,III_STREAM_PORT/III_STREAMS_PORT,III_ENGINE_PORT/III_ENGINE_URL— nothing hard-coded. New helpersgetStreamPort()andgetEnginePort()join the existinggetRestPort()/getViewerUrl().ensureIiiConsole()detects the binary viawhichBinary("iii-console")or~/.local/bin/iii-console. If absent on a TTY (not CI, not previously declined), prompts to install and shells out tocurl -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.p.log.info("Tip: install globally…")that users kept ignoring (then typingagentmemory stopin a fresh shell to acommand not found). On first npx run (TTY, not CI, not declined), interactivep.confirmrunsnpm install -g @agentmemory/agentmemory@<VERSION>on yes; on no, persistsskipGlobalInstall: trueso we never re-prompt.VERSIONconstant.Prefs schema gains
skipGlobalInstall+skipConsoleInstall(both default false). schemaVersion stays at 1 — the reader already merges over defaults.Diff stat
Sample post-boot panel
Installed iii console case:
Missing iii console case (user declined or hasn't been asked):
Test plan
npm run buildpassesnpm testpasses (87 files, 954 tests — actually 0 failures, not the expected ~10)agentmemory v0.9.15 pins v0.11.2(verified by invoking the dist build withAGENTMEMORY_III_VERSIONunset and aniiiv0.11.6 on PATH)skipGlobalInstall: trueand we never re-promptNotes
src/cli/onboarding.ts(multi-select wire) and MCP messaging strings insrc/cli.ts. This PR stays in the boot/ready region of cli.ts plus the prefs schema. Expect a small rebase at merge time.Summary by CodeRabbit