[Other] Terminal: shell tab completion for the strata command
Maintainers usually reply within 5 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- bash, fish, python, zsh
- Domain
- cli, developer-experience
Research direction
Start with parser() in strata_cli/cli.py to see how subcommands are defined, then read the existing Terminal tests and docs/TERMINAL.md. Add the opt-in completion command using the optional shtab package, keeping its import lazy and handling the missing-package case with exit code 2. Done when generated scripts cover current top-level commands, pass the listed shell syntax checks, and the setup is documented.
Written by the indexing model from the issue text.
Description
Problem: typing strata and pressing Tab in bash, zsh or fish completes nothing. The command grammar lives in strata_cli/cli.py (parser(), about 25 subcommands and many nested ones), and there is no way to get it into a shell. Workaround today: none, short of hand-writing a completion script, which drifts from the grammar as soon as a subcommand changes.
Version and system this was written and tested on: strata 0.2.15 (build 0.1.61; python 3.13.14) from a source checkout at c77572806. NVIDIA GeForce RTX 5080 with 16 GB VRAM, plus an AMD Radeon 610M iGPU; 60 GB RAM; CachyOS Linux, kernel 7.3.4-1-cachyos, x86_64. No GPU work is involved: this is a CLI-only change, validated with the mock-free Terminal test suite.
Proposal (small, opt-in): a strata complete --shell bash|zsh|fish subcommand that prints a completion script generated from the installed CLI's own argparse grammar with the optional shtab package, so there is no second grammar to maintain.
strata_cli/cli.py: one subparser and one ~10-line handler that printsshtab.complete(parser(), shell=...)to stdout.shtabis imported lazily inside the handler only. The default path (serve,launch,status, …) changes by zero lines, and the hash-locked Terminal bundle gains no new package. Withoutshtabthe command prints what to install and exits 2.- Tests:
tests/terminal/test_shell_completions.pyregenerates each script, checks it names every current top-level command and parses (bash -n,zsh -n,fish -n). - Docs: one short section in
docs/TERMINAL.md. - No installer changes: the user adds one line to their shell profile.
Limits: PowerShell output is not generated (shtab has no PowerShell target); value completion (profile names, model IDs) is not in this scope. Subcommand and flag completion is the whole grammar already in the parser.
Related: I found no existing issue or PR about shell completion (searched "tab completion", "shell completion", "autocomplete", "shtab", "argcomplete").
- Dominant language
- C++
- Stars
- 11.6k
- Forks
- 1k
- Avg merge
- 18d 13h
- Merged PRs (30d)
- 4
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Niko1221/Strata
-
needs-format
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Niko1221/Strata#6251 · 1 comment ·
Maintainers usually reply within 5 days
-
[TUI] A leftover run config marks a model installed: the list checks the file name, not the filesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 5 days
-
needs-format
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Niko1221/Strata#6229 · 1 comment ·
Maintainers usually reply within 5 days
-
[Engine] qsa_rows_bench: --ctx below 32768 makes the dense step read outside the page table (Xid 31)Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 5 days
-
[Engine] explicit --layer-split reloads CUDA0 dense weights a second time at startup (0 MiB freed)Possibly taken @wronglebowsk claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 5 days
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
metasequoiaime/msime#11666 ·
Maintainers usually reply within 1 day
-
DAE2 crashes on call.without.effects with a non ref.func expressionPossibly taken @stevenfontanella claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
WebAssembly/binaryen#9404 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
CodeZombie/goodluckOS#178 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
CVO-Org/immersive-cigs-rewrite#313 ·
Maintainers usually reply within 1 day
-
windows-latest (20261116.315.1) ships with incompatible MSVC (18.12) and pinned LLVM/Clang (20)Openbug report
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
actions/runner-images#15367 · 4 comments ·
Maintainers usually reply within 2 days