|
| 1 | ++++ |
| 2 | +title = "Your --help was the ugliest screen in the app" |
| 3 | +date = 2026-03-19 |
| 4 | +description = "micasa swapped Kong for Cobra. Now there's tab completion, colored help, and CLI tests that run in 100ms." |
| 5 | ++++ |
| 6 | + |
| 7 | +Kong parsed my arguments for four months. It worked fine. It also didn't |
| 8 | +generate shell completions, so micasa had none. And `--help` was plain |
| 9 | +monochrome text next to a TUI with a color palette -- the one screen that |
| 10 | +looked like it belonged to a different application. |
| 11 | + |
| 12 | +## Kong out, Cobra in |
| 13 | + |
| 14 | +[#785](https://github.com/cpcloud/micasa/pull/785) replaces Kong with Cobra. |
| 15 | +The main reason was completions -- Kong doesn't generate them, so micasa |
| 16 | +never had tab completion. Cobra builds them from the command tree at runtime. |
| 17 | +`micasa completion bash` writes a script to stdout, same for zsh and fish. |
| 18 | +Add a subcommand next week, the completions already know about it. |
| 19 | + |
| 20 | +While I was in there, I overrode Cobra's help function to use the Wong |
| 21 | +palette. Subcommands in one color, flags in another, descriptions in the |
| 22 | +adaptive foreground. `--help` looks like the rest of the app now. |
| 23 | + |
| 24 | +Side benefit: Kong's CLI tests compiled the full binary and exec'd it in |
| 25 | +a subprocess, which took about ten seconds per run. Cobra commands are |
| 26 | +functions -- construct the root, set args, call `Execute()` against an |
| 27 | +`io.Writer`. CLI tests went from ~10s to ~100ms. |
| 28 | + |
| 29 | +## The LLM shows its work |
| 30 | + |
| 31 | +The extraction pipeline proposes database operations -- create a vendor, |
| 32 | +update a title, link a quote -- but you couldn't see the details. You got |
| 33 | +a summary and an accept/reject choice. |
| 34 | + |
| 35 | +Documents now have an **Ops** column |
| 36 | +([#776](https://github.com/cpcloud/micasa/pull/776)). It opens an |
| 37 | +interactive JSON tree: every proposed `INSERT`, `UPDATE`, and `DELETE` with |
| 38 | +field values inline. <kbd>j</kbd>/<kbd>k</kbd> to navigate, |
| 39 | +<kbd>l</kbd> to expand, <kbd>h</kbd> to collapse. Collapsed nodes show |
| 40 | +inline previews. Clickable too. |
| 41 | + |
| 42 | +<video src="/videos/ops-tree.webm" class="demo-video" autoplay loop muted playsinline></video> |
| 43 | + |
| 44 | +You can point at the exact field the LLM got wrong before you accept. |
| 45 | + |
| 46 | +## Faster the second time |
| 47 | + |
| 48 | +Re-extracting a document used to redo the full pipeline -- OCR, text |
| 49 | +extraction, everything. Now it skips straight to the LLM with the cached |
| 50 | +text from the first run |
| 51 | +([#763](https://github.com/cpcloud/micasa/pull/763)). |
| 52 | + |
| 53 | +Same PR: <kbd>r</kbd> in edit mode triggers extraction without opening a |
| 54 | +form. A **Model** column shows which LLM produced the extraction. The model |
| 55 | +name and operations JSON are persisted in the database -- if you need to |
| 56 | +know what model read your invoice six months from now, it's there. |
| 57 | + |
| 58 | +## Other things since last week |
| 59 | + |
| 60 | +- **Charm v2** -- bubbletea, lipgloss, huh, bubblezone, and glamour all |
| 61 | + migrated to their v2 releases. Go 1.26 required. The `bubbletea-overlay` |
| 62 | + dependency got inlined. Nothing should look different, but if something |
| 63 | + does, [open an issue](https://github.com/cpcloud/micasa/issues) |
| 64 | + ([#788](https://github.com/cpcloud/micasa/pull/788)). |
| 65 | +- **`micasa demo`** -- `--demo` is now a subcommand. `micasa demo --years 10` |
| 66 | + instead of `micasa --demo --years 10` |
| 67 | + ([#787](https://github.com/cpcloud/micasa/pull/787)). |
| 68 | +- **Keybinding hints** -- two-tier keycap rendering: pill keycaps for inline |
| 69 | + hints, bold accent for reference panels like the help overlay |
| 70 | + ([#783](https://github.com/cpcloud/micasa/pull/783)). |
| 71 | +- **Document restore** -- accepting an extraction on a soft-deleted document |
| 72 | + now restores it instead of silently writing to a hidden row |
| 73 | + ([#777](https://github.com/cpcloud/micasa/pull/777)). |
| 74 | +- **Hide-deleted** -- soft-deleting a row now respects your explicit |
| 75 | + hide-deleted toggle instead of overriding it |
| 76 | + ([#774](https://github.com/cpcloud/micasa/pull/774)). |
| 77 | +- **Sort** -- toggling sort didn't visually activate until you pressed a |
| 78 | + navigation key; the cached viewport wasn't being invalidated |
| 79 | + ([#773](https://github.com/cpcloud/micasa/pull/773)). |
| 80 | +- **Service log sync** -- closing the service log overlay auto-syncs and |
| 81 | + highlights the Last column so you see the update immediately |
| 82 | + ([#772](https://github.com/cpcloud/micasa/pull/772)). |
| 83 | +- **Error rendering** -- failed extraction step errors render as plain text |
| 84 | + instead of raw JSON |
| 85 | + ([#778](https://github.com/cpcloud/micasa/pull/778)). |
| 86 | + |
| 87 | +## Try it |
| 88 | + |
| 89 | +```sh |
| 90 | +go run github.com/cpcloud/micasa/cmd/micasa@latest demo |
| 91 | +``` |
| 92 | + |
| 93 | +Tab completions: |
| 94 | + |
| 95 | +```sh |
| 96 | +source <(micasa completion bash) |
| 97 | +source <(micasa completion zsh) |
| 98 | +micasa completion fish | source |
| 99 | +``` |
| 100 | + |
| 101 | +Binaries on the |
| 102 | +[releases page](https://github.com/cpcloud/micasa/releases/latest). |
0 commit comments