HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
spf13
cobra
Go2015–2026
spf13 / cobra

cobra

A Commander for modern Go CLI interactions

40Distinct people
42Mentions
0Explicit recommenders
44.8KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A Commander for modern Go CLI interactions

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 10:49:33 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year42 dated mentions

Observed mentions: 2015-01-03 00:09:24 UTC to 2026-01-14 14:05:20 UTC.

024682015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 8 mentions; 2 submissions, 6 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC101
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC211
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC413
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC606
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC505
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC514
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC826
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC202
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC312
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC505
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC110

What Hacker News says

5 sources
Oh fun. Since this pokes at LLM I'll share my use case from last week. I built a similar(ish) tool locally (for personal use) as a CLI with an LLM. I download transactions from my bank and credit card, have it load them into a sqlite database, do some transformations (categorizing, grouping, excluding), and bottle up each command as a cli sub-command or flag. I used go, cobra, and the charm libs (to help with interactive labeling). I spent about a day on it to get it roughly usable, so I can drop in my updated transactions next month and get a basic report. Since the output is sqlite database and cli commands, I can also use claude code to ask it stuff, which was interesting because my original plan was to do all the asking myself and just have claude build the cli tool. It works decently. I got out what i needed and fought very very hard
Read the rest
to not go more all in / code dive, etc. I just needed my monthly expense totals, ordered, with some clean-up. The code is so-so, but it mostly got things working in a few shots. Claude being able to iteratively run commands / issue queries while it worked was key to it getting functional, I think. I love that it runs local and spits out plain text for tables and such; to share with my wife i copy pasted some of the output to a text document then added some comments (markdown). If I hacked on it more, I'd probably re-work the architecture a bit; I think coming up with a good design about how to ingest idempotently, and then how you want to transform transactions (i.e. in place, vs setting up rules / overrides and then generating a computed transactions table) is most important. After each mini feature having the LLM document its usage in the README, and of course committing, was key. It made it very easy to ditch conversations and start new ones, and point to the README / examples (as opposed to compacting prior conversation). I think your tool at $5 is a great value; I had TONS of fun making the CLI app but it still took me a few hours of focused work in the end spread over a day, and relied on me having very basic prior experience to help steer it. I bet you can charge more while still keeping the product focused / maintenance low, and absolutely think there's a strong need for it -> While I am super tempted to get crazy with my local app and / automating calculations (etc) ultimately just seeing the money in / out, a few categories that I can sum up (groceries, eating out), and the top 15 expenses, that's really all we need to get our budget in place. Kudos on building a real product, esp. on figuring out how to keep it focused, finding the niche, and recognizing the opportunity to capitalize! EDIT: My actual deps list here. require ( github.com/BurntSushi/toml v1.5.0 github.com/charmbracelet/bubbles v0.21.0 github.com/charmbracelet/bubbletea v1.3.5 github.com/charmbracelet/huh v0.7.0 github.com/charmbracelet/lipgloss v1.1.0 github.com/charmbracelet/log v0.4.2 github.com/mattn/go-sqlite3 v1.14.22 github.com/spf13/cobra v1.10.1 )
In Show HN: Write It Down – Personal finance tracker
Here is one of your empty argument being thrown away instead of respected bugs: * https://github.com/spf13/cobra/blob/6dec1ae26659a130bdb4c985... I could explain the single-quote argument quoting error if you were running it on Windows. The Go runtime library does not provide single-quoting on Windows. At all. (This is historically the behaviour of C runtime libraries on Windows, too.) It should be using a proper argument vector and not doing its own command-line parsing on other platforms, though. * https://cs.opensource.google/go/go/+/master:src/os/exec_wind... * https://cs.opensource.google/go/go/+/master:src/os/proc.go;l...
In Fang, the CLI Starter Kit
Very cool about the SEA feature, I haven't seen that before. Thanks for sharing that This is sort of the worst case comparison, but a hello world program in go is 1.5 MiB and the SEA node equivalent is 109 MiB. Obviously as your program becomes more complex that fixed overhead becomes less of an issue but I think it's still a useful comparison. For the packages, the thing I prefer even more so is writing an application with 0 dependencies at all. net/http, net/http/pprof, flag, pprof, etc are all built in and high quality and you can easily build clis/servers with them. Even a really full featured CLI builder package like cobra has just a few transitive deps and gorilla/mux has none: https://github.com/spf13/cobra/blob/main/go.sum https://github.com/gorilla/mux/blob/main/go.mod If I compare that with express.js or commander its a very dif
Read the rest
ferent story (though, in fairness to commander, they all seem to be dev deps). I don't think it's bad per se to have deps, just a different culture. https://news.ycombinator.com/item?id=43935067 kinda beat that horse already though
In Leaving Google
You did a really great job describing the project and documenting it in the README. Congrats. The project looks super clean and professional. That being said, TBH I don't see any real scenario where I would "prototype a CLI". Unlike a GUI where elements can be placed in some places vs others, a CLI is a CLI. For any developer, it would probably take less time to write it directly using one of the libraries listed here : https://bloomberg.github.io/stricli/blog/intro (TS/JS) or https://github.com/spf13/cobra (Go) with stub implementations for commands. The main problem for me is that defining the CLI in a JSON file lacks all the flexibility of code (reusability, etc.).
In Show HN: Protostar – A CLI Prototyping Tool

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.