Skip to content

Latest commit

 

History

History
81 lines (50 loc) · 2.09 KB

File metadata and controls

81 lines (50 loc) · 2.09 KB

tome-cli completion

Generate completion script

Synopsis

To load completions:

Bash:

$ source <(tome-cli completion bash)

To load completions for each session, execute once:

Linux:

$ tome-cli completion bash > /etc/bash_completion.d/tome-cli

macOS:

$ tome-cli completion bash > $(brew --prefix)/etc/bash_completion.d/tome-cli

Zsh:

If shell completion is not already enabled in your environment,

you will need to enable it. You can execute the following once:

$ echo "autoload -U compinit; compinit" >> ~/.zshrc

To load completions for each session, execute once:

$ tome-cli completion zsh > "${fpath[1]}/_tome-cli"

You will need to start a new shell for this setup to take effect.

fish:

$ tome-cli completion fish | source

To load completions for each session, execute once:

$ tome-cli completion fish > ~/.config/fish/completions/tome-cli.fish

PowerShell:

PS> tome-cli completion powershell | Out-String | Invoke-Expression

To load completions for every new session, run:

PS> tome-cli completion powershell > tome-cli.ps1

and source this file from your PowerShell profile.

Using completions from within child scripts

Once completions discover an executable and non-ignored script, tome-cli will check if the script has TOME_COMPLETION declared in file. If so, it will attempt fetch completions from the script itself.

This is accomplished by passing --complete to the script and capturing the output.

The output syntax is newline-separated strings where each line is composed of a completion (e.g. a flag or argument), a tab character, and a description of the completion.

tome-cli completion [bash|zsh|fish|powershell]

Options

  -h, --help   help for completion

Options inherited from parent commands

  -d, --debug               debug logs
  -e, --executable string   executable name
  -r, --root string         root directory containing scripts (default ".")

SEE ALSO

  • tome-cli - A cli tool to manage scripts as a set of subcommands
Auto generated by spf13/cobra on 10-Dec-2025