Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
name: Git
version: "1.0.0"
author: "Jane Doe <>"
about: Git Command Completion
- name: branch
short: br
long: branch
# optional_arguments are completed by the engine based on the input text.
# These fields are static. For example, when you type `git branch -<TAB>`,
# the engine will look in the optional_arguments and provide all of them.
# When you type `git branch --co<TAB>`, only the optional_arguments that
# start with `--co` will be displayed.
- "--color"
- "--no-color"
- "-v"
# When a completion item requires dynamic processing, a chain of scripts
# can be used to return the list of items that will be used in completion.
# Each item is a OS specific or OS agnostic command that gets run, and its
# output gets fed to the next command in chain. The resulting string is
# used to complete.
# For example, the following sample commands will return a list of
# branches that the engine uses to complete the `git branch ma<TAB>`
# command.
- command: git
- "branch"
- "-a"
- command: sed
os: macos
- "s/origin\///"
- command: sed
os: macos
- "s/\*/\ /"
- command: ForEach-Object
os: windows
- '{ $_.Replace("origin/","").Replace("*", " ") }'
- name: stash
- positional_argument: "push"
- "-m"
# When positional_arguments is provided, they take priorty. If this list
# doesn't provide any completed item, then custom_completers is used.
- "push"
- "pop"
# Example
# complete --command-name git --arguments "branch dev" --cursor-position 10
# complete --command-name git --arguments "checkout dev" --cursor-position 12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment