cli: help examples are fixed at construction and can't reflect where a command is mounted
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- typescript
- Área
- cli
Línea de trabajo
Start at Command.withExamples and buildHelpDoc, which already receives commandPath for the USAGE line. Trace how examples are stored and rendered, then verify that the new callback form resolves against the mounted path while the existing array form remains unchanged. Confirm the generated help examples work for commands mounted directly and as subcommands.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What is the problem this feature would solve?
USAGE reflects where a command is mounted; its examples don't — they're fixed strings written at construction. Mount one command in two places (own bin, and subcommand of a larger CLI) and its examples describe an invocation that doesn't work.
It can't be fixed in user land: a child is built before withSubcommands attaches it, so the path isn't knowable when withExamples runs. The only workaround is threading the mount path into every command factory by hand.
What is the feature you are proposing to solve the problem?
An overload of Command.withExamples taking (commandPath: ReadonlyArray<string>) => ReadonlyArray<Example>, resolved in buildHelpDoc, which already receives commandPath for the USAGE line. Additive — the array form is unchanged.
Command.withExamples(create, (path) => [
{ command: `${path.join(" ")} --yes`, description: "Take every default." },
])
What alternatives have you considered?
- Threading the mount path in by hand — what we do now: every command factory takes the path it's mounted at and interpolates it into its own examples. Works, but re-supplies what the parser already computes, and nothing checks the two agree.
- Prefixing examples at the mount site via the public
examplesfield andwithExamples. Same information written in the same place, and it doesn't recurse into grandchildren. - Auto-prefixing relative examples with the usage path. Nicest to write, but breaks every existing absolute example — would need its own combinator.
- A custom help renderer that rewrites examples against the path. Not available:
runtakes only{ version }.
- Lenguaje dominante
- TypeScript
- Estrellas
- 16.7k
- Forks
- 808
- Merge medio
- 11 h 11 min
- PR fusionados (30 d)
- 840
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 Effect-TS/effect
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
@effect/ai-anthropic: text_editor_20250728 insert decodes `new_str`, but the API sends `insert_text`Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
[email protected]: crypto/KeyFormat declarations require the global JsonWebKey, breaking Node-only type-checksPosiblemente ocupada @effect-bot la tomó hoy. Abierto
Effect-TS/effect#10115 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 4/5 1-2 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
-
sql-pg: send several statements in one extended-query Sync (transaction-local context without extra round trips)Posiblemente ocupada @effect-bot la tomó hoy. Abierto
Effect-TS/effect#10113 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de Effect-TS/effect
Issues similares
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
area:plugins area:security area:skills bug has repro
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
anthropics/claude-code#105911 ·
Los mantenedores suelen responder en 1 día
-
[ko] Translate /team into KoreanAbiertodocumentation good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
dev-five-git/devup-ui#879 ·
Los mantenedores suelen responder en 11 días
-
openspec-apply-change skill: when blocked, may select a ready artifact unrelated to missingArtifactsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Fission-AI/OpenSpec#2165 ·
Los mantenedores suelen responder en 1 día
-
🐞 bug 🧐 unconfirmed
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Tencent/tdesign-vue-next#7032 · 1 comentario ·
Los mantenedores suelen responder en 1 día