frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

CLI's completion should know what options you've typed

https://hackers.pub/@hongminhee/2026/optique-context-aware-cli-completion
29•dahlia•3w ago

Comments

queenkjuul•3w ago
I think fish does this? I know it gives me branch names as completion options sometimes, idk how aware it is of the specific flags.
tiltowait•3w ago
fish is a bit insonsistent on it. For instance, `git add <tab>` will only autocomplete for modified files. It will also fill in wildcards, e.g. `cat *.txt <tab>` will expand to show all .txt files. On the failure side, `rm foo <tab>` will still show `foo` as an option.

IME, zsh has better autocompletion (which, at the time at least, was a separate install).

epage•3w ago
There are a couple differen things going on

- completions being aware of the subcommand

- dynamic look ups for specific values

- completions being aware of previous options, flags, and values

A lot of completions have the first. Some have the second. The last is rare. The completer needs knowledge of when flags, options, and value can be repeated and change which future options and values are suggested.

hnlmorg•3w ago
All shells do. Even alternate shells like Murex and Nushell.

The problem isn’t that they can’t, it’s that writing context aware shell completions is hard because every tool does things slightly differently, and typically completions are not done by the same people who wrote the CLI tool to begin with.

So you end up with a thousand edge cases where stuff isn’t 100% correct.

dgunay•3w ago
I have a small tool to manage agents, and one thing it does is let you select an --agent [codex|opencode|etc] and a --model. Valid --model values are specific to the agent though, and some agents like opencode support a huge amount of models.

When I added tab completion for --model that accounts for what --agent is set to, it made it 100x easier to use and I stopped relying on the defaults so much.

It's such a small thing but makes a big difference for discoverability.

frabonacci•3w ago
+1 to this. I’ve seen the same thing - once completion respects earlier flags, defaults matter less and the CLI becomes self-discoverable. Fish gets part of the way there, but having it modeled at the parser level feels like the missing piece
pvtmert•3w ago
shell completions consist of basically a state, and DAG (directed acyclic graph)

consider following

- git -> [ -C, <sub-commands> ]

- <sub-commands> -> [ add, branch, checkout, clone, remote, stash ]

- -C -> [ <directories> ]

- add -> [ <files>, <directories ]

...

- checkout -> [ <refs>, <files>, <directories> ]

---

obviously you could dump all these at every <tab> invocation, i usually create base+completions script considering completions for the base.

this way, i have tools & tools-completion, tools have sub-commands of fix, restart, connect, review, retrieve, etc.

each of these also have completions, like tools-restart-completions. those lists available services/daemons only

while installing, you only need to install "tools completions", that handles the redirect(s) to sub-commands and their sub-commands, making things easier to maintain, simple to operate, and independent.

fainpul•3w ago
I have to praise PowerShell here. You get tab completion [0], type checking, automatically generated syntax help text etc. for free, just by writing your CLI tool in PowerShell.

Then you can also use a simple, built-in, declarative DSL to gradually enhance the robustness of your CLI by adding more checks or constraints, or use "parameter sets" [1] to define which parameters can and cannot be used together — tab completion will behave accordingly and suggest only what's allowed.

Dynamic completers, like mentioned in the article, can also be done [2].

[0] https://learn.microsoft.com/en-us/powershell/scripting/learn...

[1] https://learn.microsoft.com/en-us/powershell/module/microsof...

[2] https://learn.microsoft.com/en-us/powershell/module/microsof...

DoNotNotify is now Open Source

https://donotnotify.com/opensource.html
157•awaaz•3h ago•24 comments

Show HN: LocalGPT – A local-first AI assistant in Rust with persistent memory

https://github.com/localgpt-app/localgpt
237•yi_wang•9h ago•112 comments

Reverse Engineering Raiders of the Lost Ark for the Atari 2600

https://github.com/joshuanwalker/Raiders2600
12•pacod•1h ago•1 comments

Matchlock: Linux-based sandboxing for AI agents

https://github.com/jingkaihe/matchlock
23•jingkai_he•3h ago•1 comments

Haskell for all: Beyond agentic coding

https://haskellforall.com/2026/02/beyond-agentic-coding
133•RebelPotato•9h ago•39 comments

SectorC: A C Compiler in 512 bytes (2023)

https://xorvoid.com/sectorc.html
316•valyala•17h ago•61 comments

Modern and Antique Technologies Reveal a Dynamic Cosmos

https://www.quantamagazine.org/how-modern-and-antique-technologies-reveal-a-dynamic-cosmos-20260202/
9•sohkamyung•5d ago•0 comments

LLMs as the new high level language

https://federicopereiro.com/llm-high/
132•swah•5d ago•227 comments

The Architecture of Open Source Applications (Volume 1) Berkeley DB

https://aosabook.org/en/v1/bdb.html
42•grep_it•5d ago•6 comments

Software factories and the agentic moment

https://factory.strongdm.ai/
235•mellosouls•20h ago•396 comments

Speed up responses with fast mode

https://code.claude.com/docs/en/fast-mode
195•surprisetalk•17h ago•198 comments

LineageOS 23.2

https://lineageos.org/Changelog-31/
72•pentagrama•5h ago•14 comments

Stories from 25 Years of Software Development

https://susam.net/twenty-five-years-of-computing.html
208•vinhnx•20h ago•24 comments

Hoot: Scheme on WebAssembly

https://www.spritely.institute/hoot/
196•AlexeyBrin•22h ago•36 comments

uLauncher

https://github.com/jrpie/launcher
36•dtj1123•4d ago•8 comments

In the Australian outback, we're listening for nuclear tests

https://www.abc.net.au/news/2026-02-08/australian-outback-nuclear-tests-listening-warramunga-faci...
12•defrost•1h ago•1 comments

Brookhaven Lab's RHIC concludes 25-year run with final collisions

https://www.hpcwire.com/off-the-wire/brookhaven-labs-rhic-concludes-25-year-run-with-final-collis...
83•gnufx•16h ago•66 comments

Vocal Guide – belt sing without killing yourself

https://jesperordrup.github.io/vocal-guide/
373•jesperordrup•1d ago•111 comments

Wood Gas Vehicles: Firewood in the Fuel Tank (2010)

https://solar.lowtechmagazine.com/2010/01/wood-gas-vehicles-firewood-in-the-fuel-tank/
56•Rygian•3d ago•24 comments

Show HN: I saw this cool navigation reveal, so I made a simple HTML+CSS version

https://github.com/Momciloo/fun-with-clip-path
111•momciloo•17h ago•24 comments

First Proof

https://arxiv.org/abs/2602.05192
154•samasblack•19h ago•94 comments

Rabbit Ear "Origami": programmable origami in the browser (JS)

https://rabbitear.org/book/origami.html
4•molszanski•3d ago•2 comments

Substack confirms data breach affects users’ email addresses and phone numbers

https://techcrunch.com/2026/02/05/substack-confirms-data-breach-affecting-email-addresses-and-pho...
68•witnessme•6h ago•30 comments

Start all of your commands with a comma (2009)

https://rhodesmill.org/brandon/2009/commands-with-comma/
617•theblazehen•3d ago•222 comments

Al Lowe on model trains, funny deaths and working with Disney

https://spillhistorie.no/2026/02/06/interview-with-sierra-veteran-al-lowe/
114•thelok•19h ago•25 comments

The AI boom is causing shortages everywhere else

https://www.washingtonpost.com/technology/2026/02/07/ai-spending-economy-shortages/
353•1vuio0pswjnm7•23h ago•585 comments

Where did all the starships go?

https://www.datawrapper.de/blog/science-fiction-decline
191•speckx•4d ago•281 comments

OpenCiv3: Open-source, cross-platform reimagining of Civilization III

https://openciv3.org/
928•klaussilveira•1d ago•282 comments

LLMs as Language Compilers: Lessons from Fortran for the Future of Coding

https://cyber-omelette.com/posts/the-abstraction-rises.html
13•birdculture•2h ago•2 comments

Show HN: A luma dependent chroma compression algorithm (image compression)

https://www.bitsnbites.eu/a-spatial-domain-variable-block-size-luma-dependent-chroma-compression-...
49•mbitsnbites•3d ago•7 comments