CLI: shell completions (kgdiff completion bash|zsh|fish)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 57/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- cli
Research direction
Start with the option tables and constants in packages/cli/src/args.ts, then read parseCommandLine to see how apply and help are dispatched; check locale values in locale.ts. The issue calls for generated bash, zsh, and fish scripts, tests and snapshots, help and English and Chinese docs, and a changeset. Done means those checks and docs are in place and at least one shell has been tried by hand.
Written by the indexing model from the issue text.
Description
What
kgdiff completion <shell> prints a completion script for bash, zsh or fish, to be installed
the usual way:
kgdiff completion zsh > "${fpath[1]}/_kgdiff"
kgdiff completion bash > ~/.local/share/bash-completion/completions/kgdiff
kgdiff completion fish > ~/.config/fish/completions/kgdiff.fish
The script should complete:
- options, with their short forms (
-o,-f,-q…); - the values of options that take a fixed set:
--format,--before-format,
--after-format,--match,--edge-identity,--theme,--mode,--scope,--color,
--locale; - file names for the two graph arguments and for options that take a file (
-o,--json…); - the
applyandhelpsubcommands and their own options.
Where to start
- The options and their types are tables in
packages/cli/src/args.ts(COMMONat
#L112
and the ones after it), and the allowed values are the constants at the top of the file
(FORMATS,MATCH_STRATEGIES,EDGE_IDENTITIES,THEMES,MODES,SCOPES,
COLOR_MODES; locales come fromLOCALESinlocale.ts). Generate the
scripts from these tables rather than writing the lists by hand, so completions never fall
behind the options. - Subcommands are dispatched in
parseCommandLine
(#L584):
completiongoes next toapplyandhelp, with a newkindin theCommandunion. - Help text:
packages/cli/src/help.ts. Docs:docs/cli.mdanddocs/zh/cli.md.
Done when
- A test checks that every option in the tables appears in each script, and snapshot tests pin
the three scripts. - You tried at least one shell by hand (say which in the pull request).
kgdiff helpanddocs/cli.md(en + zh) mention it, and there is a changeset.
- Dominant language
- TypeScript
- Stars
- 47
- Forks
- 6
- Avg merge
- 2h 32m
- Merged PRs (30d)
- 22
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
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 iiwish/kgdiff
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
accessibility help wanted viewer
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
iiwish/kgdiff#16 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 1/100
iiwish/kgdiff#21 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation help wanted
Difficulty 3/5 1-2 days Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
help wanted i18n
Difficulty 5/5 Over a week Newbie friendliness 55/100
Maintainers usually reply within 1 day
Similar issues
-
maintenance
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
assistant-ui/assistant-ui#10499 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug server-sequentialthinking v2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
modelcontextprotocol/servers#5526 · 1 comment ·
Maintainers usually reply within 1 day
-
app-server bug CLI
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
cimd: default originBoundFields rejects a cross-origin client_uri, which the CIMD draft forbidsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
better-auth/better-auth#12458 · 1 reaction ·
Maintainers usually reply within 1 day