{
  "id": 2182811,
  "title": "Tab completion, without writing a completion script",
  "url": "https://urgent.news/2026/08/20/tab-completion-without-writing-a-completion-script",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-20T16:45:24.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/mauvilsa/tab-completion-without-writing-a-completion-script-4nab"
  },
  "original_language": "en",
  "account": "The story discusses an innovative solution for providing tab completion functionality in command line tools without the need to write a completion script. Traditional methods require writing scripts in the shell's own language, which can be tedious and prone to going out of date. The article highlights how the jsonargparse library, when paired with a Python package called shtab, can generate the required completion script automatically. This integration allows the parser to utilize the choices, paths, and types defined in the client's signatures, eliminating the need for manual intervention. The complete tab completion feature is optional and can be enabled via a module-level call or an environment variable. It extends to subcommands and offers context-aware options and choices, as well as detailed type information. The process is seamless and does not require modifications to existing code or additional dependencies, making it a practical solution for developers looking to enhance their tools with intelligent tab completion.",
  "summary": "The first post derived a whole command line interface from a client class, and the second turned it into a command that runs from any directory. Both left the same gap in place: the tool knows a great deal that its user does not. order_by is one of four strings. distance_unit is one of two. level is one of five. The client says so in its type hints, and jsonargparse enforces every one of them, to…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}