Add completion auto-install and plugin completion protocol#1486
Closed
mnorth-stripe wants to merge 2 commits into
Closed
Add completion auto-install and plugin completion protocol#1486mnorth-stripe wants to merge 2 commits into
mnorth-stripe wants to merge 2 commits into
Conversation
Contributor
Author
|
Part of completion auto-install work (2 of 2) This PR adds the Stack:
|
6 tasks
f75b855 to
f73fcba
Compare
49dd246 to
bdac08e
Compare
f73fcba to
84752fd
Compare
bdac08e to
2430232
Compare
84752fd to
501737d
Compare
2430232 to
54ab73c
Compare
Enables dynamic shell completion for plugin subcommands by invoking the plugin binary with Cobra's __complete protocol and parsing the response. When a user presses tab on a plugin command, the host CLI delegates completion to the plugin process. - GetPluginCompletions: invokes plugin binary with __complete args, parses Cobra-format output (completions + directive) - parseCompletionOutput: parses the tab-separated completion format - resolvePluginBinary / buildPluginCommand: locate and construct the plugin invocation, including Node.js runtime detection - Wires ValidArgsFunction into plugin template commands Committed-By-Agent: claude
Adds --install and --uninstall flags to `stripe completion` that automatically write the completion script and configure the user's shell profile. Detects and warns about pre-existing manual completion references to avoid double-loading. Also adds the plugin completion protocol: when a plugin command receives tab completion requests, the host CLI invokes the plugin binary with Cobra's __complete protocol and returns the results. Committed-By-Agent: claude
54ab73c to
e39678d
Compare
Contributor
Author
|
Splitting into two smaller PRs for easier review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
--installand--uninstallflags tostripe completionthat automatically write the completion script to the right location and configure the user's shell profile. Also adds the plugin completion protocol for dynamic tab completion of plugin subcommands.Depends on #1485 (sentinel block management utilities).
stripe completion --install$SHELL~/.stripe/stripe-completion.{bash,zsh}(or~/.config/fish/completions/stripe.fishfor fish)sourceline to the shell config filestripe completion --uninstallstripe completion --install: Output examplestripe completion --installwith pre-existing manual configstripe completion --help: New flagsPlugin completion protocol
When a plugin command receives a tab completion request, the host CLI now invokes the plugin binary with Cobra's
__completeprotocol and parses the response. This enables dynamic completion for plugin subcommands and flags.Test plan
--install --uninstallrejected by Cobra