Abstract

As part of this project we extend the default Bee CLI in an additive manner while respecting upstream changes and promoting a clear separation of concerns, to be useful for developers using Bee in their daily lives not just for simply developing apps for Bee. For us, the developer is the consumer.

We are extremely inspired by projects like Charm Bracelet and by Strands SDK which provide a beautiful and functional way to interact with AI and wearables using terminal user interface agents. We developed Queen 💅 as a beautiful and functional project to rival the above.

Scope and Objectives

We set out to make the BEE CLI more useful for ourselves. Developers live in the Terminal, and we wanted to make an attractive yet functional Terminal User Interface to be useful for developers. Not just those developers making apps for Bee wearables, but for developers using Bee on a day to day basis.

  • Extrapolate the default commands CLI to natural language. For example, instead of bee now, you can type queen now or queen show me all the stuff ive said today and get the same, or very similar results.
  • Provide json responses directly using a --json flag in order to integrated into CI/CD systems painlessly
  • User Interface a Three Panel Visual Browser for Agent Chat, Document Display and Navigation
  • Piggyback on Bee CLI security to ensure safety (We simply reuse the BEE_FORCE_FILE_STORE flag to read credentials locally while utilizing the exact same auth flow as the cli)
  • OS integration for both MacOS and Linux using osascript and xdg-utils for agentic actions
  • Reuse MCP server and SSE server to provide agentic usage and live updates at near zero RAM (~42 MB) and CPU cost.
  • Minimize framework bloat (our framework only adds about 82.6 MBs) for the model (quantized at 1.94 GB) with the statically linked executable sized totally at 2.02 GB to work on even low spec machines like entry level 8 GB RAM Macbooks.
  • Lastly, to make agentic decisions as transparent as possible with displayed thinking and reasoning steps and a robust numeric parameter to re-rank search results

Bug fixes (additive) and Enhancements to 🐝 Bee CLI

As part of our project and in a non-contrived manner we build on top of the Bee CLI, while also git checking out as a submodule so that upstream changes are preserved.

Some issues we found while using the Bee CLI:

  • No actual Relevance scoring exposed for semantic (aka --neural) searches
  • No diarization and speakers were always classified Unknown, this is probably future work
  • No structured json output for all commands, agents are gated into the MCP server usage only, heuristic based machine processing is undone

Our mitigation steps are purely additive:

  • We provide a 1:1 mapping of the Bee CLI into Queen CLI to ensure all Bee commands work correctly, and then also provide free text inputs
  • git submodule the Bee CLI (not vendored) so that any changes to it are propagated downstream.
  • Relevance scoring using PFA for all search queries semantic (--neural) or otherwise for transparent re-ranking based on Actual Query Relevance
  • Heuristic based speaker diarization for all conversations and transcripts to provide a user friendly display
  • JSON outputs for machine readable information for all Bee CLI commands

Open Source contributions

  • Principal Factor Analysis is a package for performing Relevance and Topic Scoring created and published during this hackathon, maintains numerical equivalence with Python and also provides WASM modules and has about 14 downloads per week at time of submission.
  • TUI code is non-trivial and open sourced under permissive license with the LFM (Small Language Model) license vendored to ensure commercial usages < $10M (this project is totally free to use and will never hit that cap).

Why?

Before we write about the what and how, we need to justify our design decisions, and if this project is in fact even needed.

  • Since developers live inside the terminal, and since the major audience for the Bee CLI is actual developers who might be using Bee (not just developing for it), we provide a nice terminal user interface for actual daily usage
  • Further, we also provide downstream agentic workflows using a server based agent like Claude etc by default. We allow piped input echo "command" | queen as well as queen <command> --json as well as subclass the bee mcp server directly to integrate directly with an agent of your choice
  • We ensure auth and privacy by reusing the actual Bee CLI flows as much as possible, and doing all processing locally. Any breaking changes to Bee CLI are our responsibility, and we clearly separate concerns while processing donwstream.

We believe this project adds value, especially since the cli is a highly maintained project and we simply add on to it in a transparent manner, instead of trying to override or replace it.

How we built it

  • We use Strands SDK in Typescript for our Agentic Framework
  • The Agent LLM is a actually single statically linked binary using Zig build on a SLM (LFM 2.6B) quantized Q5_K_M GGUF
  • Build using an Orchestrator architecture for the Agent, with 3 subagents, with context window and tools capped at 32k and 4 tools in order to avoid overloading the SLMs.
  • The frontend is built on OpenTUI, which is nothing but a packaged Bun executable, we codesign, then inject our frameworks into this executable, then codesign again in order to ship a single, statically linked TUI.
  • Our LLM inference framework ships as a static framework cross compiled from Zig in order to run on either Linux or MacOS.
  • We use osascript on MacOS and xdg-utils on Linux to provide agentic automation based on the Bee framework using Strands SDK agents.
  • Keyword commands fall through to the same Bee CLI logic, free text commands or agentic chat is first interpreted by a single agent or multiple subagents and then processed according to the logic present in Bee CLI
  • Agents make it possible to chain together multiple commands and output to an automation as well, all this is provided to us free by using Strands SDK

Please Note: We have used AI assistance for parts of the code but no AI has been used for any part of the writeup submission.

How to run it

Run TUI

The TUI for macOS is only shipped in Releases. Download it and place it in usr/local/bin or any other folder.

Then run it like you would any other executable. It is codesigned with my Apple Developer ID, though MacOS verification takes some time on first launch.

chmod +x ./queen
./queen

Run CLI While a bare queen opens the TUI. Any argument — or piped stdin — runs a single command, prints one card, and exits. Plain text commands are agent interpreted (locally) and keywords commands execute the same way as they would in Bee CLI.

./tui/dist/queen status
./tui/dist/queen todos create --text "buy milk"
./tui/dist/queen "show latest todo"
echo "what did I say about the budget" | ./tui/dist/queen

Recognized subcommands are derived from the pinned bee-cli registry, so every resource (todos, facts, insights, journals, conversations, locations, search, …) just works. Free text is resolved cheaply: information questions go to Bee search, list/latest reads are deterministic, and actions use one local-model tool-selection turn. Ambiguous requests fail fast with a card of runnable suggestions instead of guessing.

Docker

We also provide a multi-arch image, which is published as ghcr.io/bitanath/queen-bee:latest for linux/amd64 and linux/arm64. Mount ~/.bee to reuse your Bee credentials; without it, generic chat works, but Bee reads and actions are not authenticated. Note, Docker is untested and likely to be slow we recommend running the MacOS Mach-O executable for best UX.

docker pull ghcr.io/bitanath/queen-bee:latest
docker run --rm -it -v "$HOME/.bee:/root/.bee" ghcr.io/bitanath/queen-bee:latest

Challenges we ran into

  • It was a challenge to create a production oriented TUI that bundles a cohesive agent, while also maintaining structured commands and heuristic based actioning. Strands SDK made it considerably easier but we still needed some days to figure it out.
  • Factor Analysis on free text is quite a challenge, we pre-built a lexicon in order to ensure that we covered nearly all possible topics, and used heuristic to classify Factors with high variance explained.
  • Docker built and working to support Linux for both arm64 and amd64, but doable and necessary for a developer targetd user interface. We used colima+docker on macOS for testing, but there will be bugs I assume.

What we Learned and What's Next

  • Small agentic models when combined with a battle tested harness are quite powerful
  • Operationalize it! No one uses bee cli anymore and the project is folded into queen, or the other way around :)
Share this project:

Updates

Submission history