[Other] Terminal: shell tab completion for the strata command
Los mantenedores suelen responder en 5 días
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 74/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- bash, fish, python, zsh
- Área
- cli, developer-experience
Línea de trabajo
Empieza con parser() en strata_cli/cli.py para ver cómo se definen los subcomandos y luego lee las pruebas de Terminal existentes y docs/TERMINAL.md. Añade el comando opcional de autocompletado usando el paquete opcional shtab, manteniendo su importación diferida y gestionando el caso en que falte el paquete con el código de salida 2. El trabajo estará completo cuando los scripts generados cubran los comandos actuales de nivel superior, superen las comprobaciones de sintaxis de shell indicadas y la configuración esté documentada.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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").
- Lenguaje dominante
- C++
- Estrellas
- 11.6k
- Forks
- 1k
- Merge medio
- 18 d 13 h
- PR fusionados (30 d)
- 4
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Niko1221/Strata
-
needs-format
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Niko1221/Strata#6251 · 1 comentario ·
Los mantenedores suelen responder en 5 días
-
[TUI] A leftover run config marks a model installed: the list checks the file name, not the filesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 5 días
-
needs-format
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Niko1221/Strata#6229 · 1 comentario ·
Los mantenedores suelen responder en 5 días
-
[Engine] qsa_rows_bench: --ctx below 32768 makes the dense step read outside the page table (Xid 31)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 5 días
-
[Engine] explicit --layer-split reloads CUDA0 dense weights a second time at startup (0 MiB freed)Posiblemente ocupada @wronglebowsk la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 5 días
Todos los issues de Niko1221/Strata
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
HarperFast/rocksdb-js#1131 ·
Los mantenedores suelen responder en 1 día
-
area/daemon bug good first issue platform/linux priority/p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ToshiNamura/Deimos#5 ·
-
[Bug]: NP 管理器文件编辑器里删除键无效Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
metasequoiaime/msime#11666 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
patrick-hudson/put.gd-desktop#1679 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Detokenizer keeps ▁ for BPE tokenizers with a top-level Metaspace decoder (NLLB, Reformer)Posiblemente ocupada @0z5a la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
openvinotoolkit/openvino_tokenizers#840 ·
Los mantenedores suelen responder en 1 día