Skip to content
PifeatureCLI & tooling34 files · +8345 −854

Add CLI, TUI, and multi-channel architecture to 0xKobold agent (Bun/TypeScript)

Session from 0xKobolds on Hugging Face by moikapy · MIT · condensed by Coders Talk

2h 42msession
2interventions
GOAL

Turn the 0xKobold project into a linkable CLI with a TUI, then progressively add local/global workspace modes, persona/onboarding templates, task/session management, MCP and web-search extensions, and finally fix the resulting TypeScript build errors.

  1. Prompt · +0
    Asked how to deploy the CLI to NPM, then said they wanted to use `bun link` to test it locally instead
  2. Agent did · +4m
    Fixed package.json bin path to point at the TS entry (Bun runs TS directly, no tsc needed) and got `bun link` working so the 0xkobold CLI ran globally
  3. Agent did · +8m
    Added a `tui` command, then iteratively reworked it to launch the real TUI entry point, respect the invoking directory, and add a `--local` vs global `~/.0xkobold` workspace switch
  4. Intervention · +53m
    Developer found the agent had been writing files into the 0xKobolds repo itself instead of the resume-optimizer project despite --local being used
    Why: even though I used --local when creating the project, you started programming in this directory instead of that folder — I need you to explicitly work in the target repo when --local is set
  5. Agent did · +1h 7m
    Built out OpenClaw-inspired persona/identity templates (IDENTITY.md, USER.md, SOUL.md, AGENT.md, MEMORY.md, BOOT.md etc.), a persona-loader extension, a persona CLI, and an onboarding extension
  6. Agent did · +1h 45m
    Built session isolation, a kanban-style task manager, an MCP extension, and an Ollama-based web search/fetch extension, wiring them all into pi-config and index.ts
  7. Fail · +2h 22m
    `bun run build` failed with a wave of TypeScript parser errors (malformed template literals, quote mismatches) across several newly-added extensions; agent spent many turns manually bisecting files to find broken lines
  8. Intervention · +2h 35m
    Developer pointed out the gateway_broadcast subagent spawning shown in the plan-mode output was itself broken ("Broadcasted event undefined to 0 clients")
    Why: add to the list that the gateway broadcast is borked — it's spawning nothing and skipping queued messages, that needs fixing too
  9. Fail · +2h 40m
    Asked to use real subagents to fix the remaining ~250 TypeScript errors, but gateway_broadcast still returned 0 clients; agent fell back to scripted find/replace fixes across files and the build still had unresolved TS2345/TS2339 errors at session end
  10. Outcome · +2h 42m
    Session ended mid-fix: parser errors resolved and ~15 commits made across the feature work, but `bun run build` still reported dozens of TypeScript type errors (TS2339, TS2345, TS2322 etc.) unfixed, and subagent-based fixing via gateway_broadcast never worked
VERDICT

Next time I'd scope the session tighter instead of stacking CLI linking, TUI modes, personas, task/session managers, MCP, and web search all in one sitting — the build error cleanup at the end became its own multi-hour slog because of it. The correction that actually mattered was catching that --local wasn't isolating the agent's working directory; without that intervention the whole local-workspace feature would have been silently broken. The subagent/gateway_broadcast approach to parallelizing the TypeScript fixes never worked (0 clients every time), so I'd just tell it up front to fix errors directly rather than pretend to spawn subagents.

I tried this · 0

Discussion · 0

How Builds work