Skip to content

feat: improvements for CLI based agent interface, TUI dashboard#8

Open
giolaq wants to merge 13 commits into
bee-computer:mainfrom
giolaq:feat/agent-opt-and-tui
Open

feat: improvements for CLI based agent interface, TUI dashboard#8
giolaq wants to merge 13 commits into
bee-computer:mainfrom
giolaq:feat/agent-opt-and-tui

Conversation

@giolaq

@giolaq giolaq commented Jun 11, 2026

Copy link
Copy Markdown

Summary

Adds three capabilities on top of v0.7.1 without changing existing command behavior:

  1. CLI agent interface optimizations for agents that prefer CLI over MCP
  2. Interactive TUI dashboard for humans browsing Bee data in a terminal

Shell Agent Features

  • bee --describe — JSON schema of all 40 commands with parameter names, types, and side-effect flags
  • bee validate <command> — pre-check auth/command existence without executing
  • Typed exit codes (0-5) so agents branch on failure type
  • BEE_OUTPUT_FORMAT=json — structured JSON errors on stderr instead of usage text
  • Typed error classes: AuthError (2), ValidationError (3), ApiError (4), RateLimitError (5)

Complements existing MCP providing two paths for agents:

  • MCP agents: bee mcp (protocol-native)
  • CLI agents: bee --describe + validate + exit codes

TUI Dashboard

Screenshot 2026-06-11 at 17 51 40
  • bee dashboard (alias: bee ui) persistent two-pane terminal interface
  • Arrow keys / Tab to navigate, Enter to load/expand items
  • Terminal capability detection (truecolor/256/16, hyperlinks, unicode)
  • NO_COLOR env var support

Code Quality

  • Used ValidationError in all commands (changed, login, mcp) for consistent exit codes
  • Regenerated bun.lock from public npm (removes internal CodeArtifact URLs) fix the github action to build

Test plan

  • bee --describe returns JSON with all commands and parameters
  • bee validate facts list returns {"valid":true}
  • bee validate boguscmd exits 3 with structured error
  • BEE_OUTPUT_FORMAT=json bee facts create returns JSON error on stderr
  • bee dashboard opens interactive TUI, navigable with arrow keys
  • bee dashboard exits cleanly with q
  • bun test passes (313 tests)
  • bun run build compiles

giolaq added 13 commits June 11, 2026 16:02
For agents that prefer CLI shell invocation over MCP protocol:

- bee --describe: JSON blob of all commands for agent discovery
- bee validate <cmd>: pre-check auth + command existence without executing
- Structured exit codes: 0=ok, 1=general, 2=auth, 3=args, 4=network, 5=rate-limit
- BEE_OUTPUT_FORMAT=json: structured JSON errors on stderr (not usage text)

Two agent paths now coexist:
- MCP agents: bee mcp (native protocol, tool discovery via list_tools)
- Shell agents: bee --describe + validate + exit codes + JSON stderr
- sources/utils/format.test.ts: 7 tests for resolveOutputFormat
  (flags, env var, precedence, defaults)
- sources/errors.test.ts: 6 tests for typed error classes
  (exit codes, recoverable, suggestions, names)
- sources/commands/validate/index.test.ts: 3 tests for validate
  (valid command, unknown command, no command)
- Fix: validate skips token check in proxy mode

Total: 313 tests passing (was 297)
--describe now outputs flag names, types (int/string/bool/boolString),
positionals (with required flag), and side_effects for all 40 commands.
Shell agents can construct valid command invocations without guessing.
- Replace Handlebars with 3-line renderTemplate() regex in stream command
- Remove handlebars from package.json dependencies
- Use ValidationError (exit code 3) instead of generic Error in:
  changed (--cursor, unknown option, unexpected args)
  login (--token, --proxy, --token-stdin, unknown option, unexpected args)
  mcp (missing subcommand)
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