Skip to content

Phase3/jerry term: JerryTerm CLI MVP v0.1.0#12

Open
SarkarShubhdeep wants to merge 15 commits into
developmentfrom
phase3/jerry-term
Open

Phase3/jerry term: JerryTerm CLI MVP v0.1.0#12
SarkarShubhdeep wants to merge 15 commits into
developmentfrom
phase3/jerry-term

Conversation

@SarkarShubhdeep

Copy link
Copy Markdown
Collaborator

Phase 3: jerry-term Interactive Terminal CLI

v0 1 0-title

Summary

This PR delivers jerry-term v0.1.0, a standalone interactive terminal CLI for Jerry AI agent with a rich OpenTUI-based interface. jerry-term provides a complete, installable package (npm i -g jerry-term) that bundles all Jerry functionality without requiring the worker to be running.

What's New

Three Runtime Backends

  • Local (Ollama) — Fully offline, nothing leaves the machine
  • Ozwell — Managed cloud provider with curated model access
  • BYO-Cloud — Bring your own API keys for:
    • OpenAI (GPT models)
    • Anthropic (Claude models)
    • Other providers

All backends use the same tool loop (ActivityWatch, search, etc.) with runtime-switchable model endpoints.

📋 For detailed feature list and known limitations, see RELEASE_NOTES_v0.1.0.md

Quality Assurance

Green Gates ✅

  • pnpm build — Passes, dist/index.d.ts emits correctly
  • pnpm typecheck — Passes, 0 errors
  • pnpm test — Passes, 240/240 tests (100%)
  • No linter errors

Publish Readiness ✅

  • npm publish --dry-run — Succeeds (209.8 kB tarball, 12 files)
  • npm pack — Verified tarball contents
  • CLI smoke tests — --version, --help, --health all working
  • Bun compatibility — Verified with Bun 1.3.4
  • Local install tested — npm i -g ./jerry-term-*.tgz works

Documentation ✅

  • Complete README with all three runtimes
  • User guide: docs/jerry-term.md
  • CHANGELOG for 0.1.0 release
  • Screenshot added to README
  • Publish workflow: .github/workflows/publish-jerry-term.yml

Testing Instructions

📋 See TESTING_INSTRUCTIONS_v0.1.0.md for comprehensive step-by-step testing instructions.

📝 See RELEASE_NOTES_v0.1.0.md for complete feature list, known limitations, and roadmap.

Security Considerations

API Key Storage

  • Keys stored in plaintext in ~/.config/jerry-term/config.json
  • File permissions: 0600 (user read/write only)
  • Keys masked in UI: sk-pr****abcd
  • No keys sent to telemetry or logs

Deployment

Pre-Publish Checklist (Owner)

  • Review PR and approve
  • Merge to development
  • Merge development to main
  • Trigger .github/workflows/publish-jerry-term.yml (manual workflow dispatch)
  • Verify npm i -g jerry-term works on clean machine
  • Announce release

Post-Publish

  • Update root README with npm i -g jerry-term instructions
  • Create GitHub release with CHANGELOG
  • Announce on relevant channels

SarkarShubhdeep and others added 14 commits July 22, 2026 06:12
Add packages/jerry-term/ as a publishable tsup-bundled CLI with:
- Bundled @mieweb/jerry-agent-runtime via noExternal config
- Minimal --version entry point for acceptance verification
- React/Ink dependencies pre-installed for later slices

Verified: build produces dist/ with createLocalRuntime inlined,
typecheck passes, npm link + jerry-term --version works.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add JerryBridge abstraction wrapping agent-runtime for CLI consumption:
- BridgeEventEmitter for UI subscription (turn-start, turn-end, runtime-switched)
- JerryBridge class with dynamic runtime switching via switchRuntime()
- Active-turn protection: queues switch requests during runTurn()
- 15 unit tests covering all acceptance criteria

Also updates branching strategy to use per-slice branches for independent PRs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Land all jerry-term slices on phase3/jerry-term and open a single PR
against development when the phase is complete, instead of per-slice PRs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add Ollama, ActivityWatch, Footnote, and MCP health adapters with a
parallel runner, formatter, and unit tests. Externalize the MCP SDK
for local diagnostics.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add readline REPL with slash commands and config loading, wire health
into the CLI, and enable local summarize_activity via ActivityWatch HTTP
with stubs for worker-only tools.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace Ink with OpenTUI React for the interactive terminal UI to enable
proper fixed-viewport layout with native scrollable transcript.

Key changes:
- Stack: @opentui/core + @opentui/react replacing ink, ink-text-input
- React upgraded to 19.x (required by OpenTUI reconciler)
- Runtime: Bun required for interactive UI; Node.js via --no-ui fallback
- Layout: Fixed header/input/status chrome with scrollbox for transcript
- Dynamic import for UI to allow --no-ui mode to work with Node.js

UI components now rendered inline in App.tsx using OpenTUI primitives:
- box, text, scrollbox, input elements
- useKeyboard hook replacing Ink useInput
- useBridge and useRepl hooks unchanged (standard React hooks)

The --no-ui readline REPL remains fully functional under Node.js.

Co-authored-by: Cursor <cursoragent@cursor.com>
…bility UI

Restore local summarize_activity by calling AW /events without a trailing
slash and aborting timed-out fetches. Add /aw-tail to peek recent events.
Land Slice 6 observability panels and layout hardening attempts.

Open issue (unsolved): sticky alternate-screen viewport — host terminal
scrollback can still steal the wheel and the transcript scrollbox may not
scroll reliably. Tracked in docs/plans/phase-3.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Document /runtime command with available runtimes display
- Add examples showing runtime status and model override syntax
- Document /config persistence behavior and additional options
- Clarify that config changes are auto-persisted to config file

Co-authored-by: Cursor <cursoragent@cursor.com>
Wire OpenTUI onInput so slash mode opens on first keystroke, intercept
keys with preventDefault, and run the selected command on Enter (Tab
still completes into the input). The / selector problem is solved.

Co-authored-by: Cursor <cursoragent@cursor.com>
Ship slice 6.5/6.6: credential vault, live Ozwell /v1/models with
recommended-first collapsed Other list, /model + tree picker, and
bridge apply/persist for Ozwell and BYO. Detect empty Ozwell streams
and mark remaining model-compat verification in phase-3.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ig state fixes

Add native Anthropic backend with live model listing for BYO Cloud, fix critical
config state bugs, and improve API key management with validation and auto-fallback.

**New Features:**
- Add native Anthropic backend (@ai-sdk/anthropic) with support for Claude models
- Add live model listing for OpenAI and Anthropic with graceful error handling
- Implement API key validation before saving (prevents invalid keys from being stored)
- Add API key masking for security (sk-pr****abcd format)
- Rename /runtime command to "/runtime & LLMs" for clarity

**Bug Fixes:**
- Fix config state clobber bug: unify config state between App.tsx and useRepl (removed duplicate useState)
- Fix API key not reaching runtime: termConfigToProfile now falls back to credentials vault
- Fix clearKey not persisting: saveTermConfig now writes exact state instead of merging from file
- Fix invalid state after clearKey: automatically switch to local runtime when clearing active provider

**Config & Key Management:**
- /config clearKey now persists deletions across sessions
- Clearing active provider's key auto-switches to local/ollama (prevents "no API key" errors)
- Keys are validated via API before saving (rejects invalid keys immediately)
- Display only OpenAI and Anthropic in BYO picker (Moonshot/custom deferred)

**Testing:**
- Add 6 new tests for termConfigToProfile vault fallback
- Add 5 tests for API key validation
- Add test for clearKey persistence and auto-fallback
- All 240 tests passing

Closes issues with API key state management and Anthropic integration.

Co-authored-by: Cursor <cursoragent@cursor.com>
Phase A - Green gate (all quality gates passing):
- Remove unused symbols (LastModelMap, test vars) fixing DTS build
- Fix RuntimePicker.tsx type errors (guard undefined runtime, remove invalid props)
- Add JERRY_TERM_CONFIG env override for hermetic tests
- Update test assertions to include anthropic runtime
- Verify build/typecheck/test green, dist/index.d.ts emits correctly

Phase B - CLI argument parser:
- Create src/cli.ts with full argument parsing
- Support -v/--version, -h/--help, -r/--runtime, --model, -H/--health, --verbose, --no-ui, --config
- Implement one-shot mode: jerry-term "message" runs headless and exits
- Refactor index.ts to delegate to CLI module

Phase C - Documentation:
- Complete README with four runtimes, vault, masked keys, tree picker
- Add docs/jerry-term.md user guide
- Create CHANGELOG.md for 0.1.0 release (Slices 5-6.6.1)
- Add v0.1.0-title.png screenshot
- Link jerry-term docs from root README

Phase D - Publish workflow:
- Add .github/workflows/publish-jerry-term.yml (manual trigger, org NPM_TOKEN)
- Verify package.json publish fields
- Test npm publish --dry-run (passes)
- Test npm pack and CLI smoke tests (--version, --help, --health)
- Verify Bun compatibility

Phase E - Final QA:
- Correct phase-3.md green-gate documentation
- Mark all green-gate items complete
- Final verification: build + typecheck + test all pass (240/240)

All 11 Slice 7 tasks completed. Package ready for PR and owner publish.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Create separate RELEASE_NOTES_v0.1.0.md with full feature list, known limitations, and roadmap
- Create TESTING_INSTRUCTIONS_v0.1.0.md with comprehensive testing guide
- Create streamlined pr-draft-jerry-term.md that links to the detailed docs
- Update docs/jerry-term.md to correctly reflect three runtime backends (local, ozwell, byo-cloud)
- Clarify that BYO-Cloud supports multiple providers, not just OpenAI-compatible ones

The PR draft is now focused and clean, with detailed information properly organized into separate documents.

Co-authored-by: Cursor <cursoragent@cursor.com>
@SarkarShubhdeep SarkarShubhdeep self-assigned this Jul 24, 2026
@SarkarShubhdeep
SarkarShubhdeep requested a review from horner July 24, 2026 17:15
- Add jsx/jsxImportSource to tsconfig.base.json for tsx file checking
- Fix eslint ignore patterns for nested dist/ and bin/ directories
- Add missing welcome/index.ts module for jerry-term
- Fix various lint errors: prefer-const, no-unused-vars, no-case-declarations

Co-authored-by: Cursor <cursoragent@cursor.com>
@SarkarShubhdeep SarkarShubhdeep changed the title Phase3/jerry term Phase3/jerry term: JerryTerm CLI MVP v0.1.0 Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Review

Development

Successfully merging this pull request may close these issues.

1 participant