feat(cli): interactive orva chat, orva docs, themed color + dynamic completion#8
Merged
Conversation
…ic completion Make the slim CLI do nearly what the dashboard does, with output that looks like Orva and works on any terminal. - Theming (cli/commands/theme): lipgloss-based palette (pure-Go, auto-degrades truecolor→256→16, light/dark adaptive). theme.New(enabled) returns no-op styles when disabled, gated by the existing --no-color/NO_COLOR/TTY chain via styles(cmd). okf() and the diff colorizer render through it. Table bodies stay uncolored on purpose (ANSI breaks tabwriter alignment). - `orva chat`: interactive streaming REPL + one-shot (-p, supports @file/@-) over the AI SSE backend with the CLI's existing API key. Live token streaming with glamour markdown re-render on a TTY (guarded; --raw/ORVA_CHAT_NO_GLAMOUR escape hatches); thinking + tool status to stderr, answer to stdout. Tool approval respects the server policy: [y/N] interactively, fail-closed when non-interactive, opt-in --auto-approve / /yolo (-y is NOT honored for AI approvals). /help /model /thinking /new /clear /yolo /exit; provider/model selection persists via PUT /ai/selection. Ctrl-C aborts the turn (not the process) via a new client.Request.Ctx for a cancellable streaming POST. - `orva docs`: renders the embedded docs/reference.md via glamour + $PAGER, --raw for source, origin substitution. make docs-embed now syncs the CLI copy too. - Dynamic completions (completions.go): function names, runtimes, chat models, -o and --thinking enums. Grouped `orva --help` (cobra command groups). - Tests: chat_test.go (httptest SSE drive, heartbeat-skip, approval fail-closed, auto-approve POST, thinking validation, wrap-aware row math); e2e test_cli extended (docs + completion) and new test_cli_chat (one-shot via mock LLM: plain reply, read-tool auto-run, fail-closed, --auto-approve, --no-color). - Deps: charmbracelet/lipgloss + glamour (pure-Go). chroma adds ~8 MB to the slim binary (~12→~20 MB); build-matrix size ceiling raised to 28 MB with a documenting comment.
Address PR #8 review: tab-completion (__complete) used the default 120s client timeout, so an unreachable endpoint could stall the user's shell for two minutes — give completion calls a 2s client. Remove the dead theme.Header style.
Owner
Author
Review (complete) — merge-readyAdversarial review across correctness, security, regressions, and resource handling. No blockers / no highs. Verified correct:
Fixes applied (commit 294f54d)
LOW/NIT remainder accepted as-is (approval prompt shows truncated tool args on the operator's own terminal — matches the dashboard; pre-existing single-line SSE Validation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the slim
orvaCLI do nearly what the dashboard does, with Orva-themed output that works on any terminal.cli/commands/theme): lipgloss palette (pure-Go, auto truecolor→256→16, light/dark adaptive).theme.New(enabled)no-ops when color is off, gated by the existing--no-color/NO_COLOR/TTY chain.okf()+ diff colorizer route through it. Table bodies stay uncolored (ANSI breakstabwriter).orva chat: interactive streaming REPL + one-shot (-p,@file/@-) over the AI SSE backend with the CLI's API key. Live token streaming → glamour markdown re-render on a TTY (guarded;--raw/ORVA_CHAT_NO_GLAMOURescape hatches). Thinking + tool status to stderr, answer to stdout. Approval respects the server policy:[y/N]interactively, fail-closed non-interactively, opt-in--auto-approve//yolo(-ynot honored for AI approvals)./help /model /thinking /new /clear /yolo /exit; selection persists viaPUT /ai/selection. Ctrl-C aborts the turn (not the process) via a newclient.Request.Ctx.orva docs: renders embeddeddocs/reference.mdvia glamour +$PAGER,--raw, origin substitution.make docs-embednow syncs the CLI copy.-o/--thinkingenums; groupedorva --help.Validation
go test ./...,go vet ./...green; command-tree golden diff matches.12→20 MB).test/e2e, fresh container, mock LLM): all modules green incl.test_cli(39/0) and newtest_cli_chat(11/0);deploy_invokeskips (no nsjail in-container, expected)./modelpicker,--no-color.Notes
charmbracelet/lipgloss+glamour(pure-Go, no CGO).internal/client+ Makefile/tests only.