Ziti Shell Auto-Complete

I'm crafting developer experiences with zrok and OpenZiti from NetFoundry
Search for a command to run...

I'm crafting developer experiences with zrok and OpenZiti from NetFoundry
An identity for every pod and every AI agent, born when the workload starts and gone when it stops
What harness builders save by avoiding a retrofit

Backend-agnostic LLM routing with dark endpoints for the workloads that can't leave the building.

Correlated Observability for AI: One Identity, Three Surfaces

Cross-org agent collaboration needs more than a common protocol

This one's for the shell ninjas. The ziti CLI comes with auto-complete! You can use completions in any shell supported by Cobra. This post will distill the Cobra instructions with correct examples for ziti in BASH and ZSH.
zitiFirst, make sure you have the ziti CLI. You can download the latest executable for your OS from GitHub.
You must install bash-completion to enable completions for BASH. This is a standard package name for Homebrew, Apt, and Yum/DNF.
ziti Completions for BASHBASH completions are loaded directly into the shell's environment with the source command like this:
source <(ziti completion bash)
That's it! You're done setting up completion in your currently-running BASH shell. Now you can type ziti (followed by a space) and hit the TAB key to auto-complete subcommands and options.
To install this configuration permanently, add the same source command to your BASH configuration file, e.g., ~/.bashrc.
ziti AliasWhat if you want to save some typing and say z, instead of ziti, to run a command? Unfortunately, this breaks BASH completion, but it's easily fixed. You must add a completion alias to your BASH config file like this:
alias z=ziti
complete -o default -F __start_ziti z
You must load compinit to enable completion in ZSH. You can run this command to test and then add the same command to your ZSH config, e.g., ~/.zshrcto auto-configure future shells.
autoload -U compinit
compinit
ziti Completions for ZSHZSH completions work with the $fpath environment variable and you must generate the completion script and install it with the correct filename in any one of the directories listed in your $fpath.
# assuming ~/.zsh/completion/ is in $fpath
ziti completion zsh > ~/.zsh/completion/_ziti
ziti AliasGood news! Shell aliases work automatically with ZSH completions.
alias z=ziti
# now you can say "z" (space) and tab auto-complete "ziti" commands!
If you didn't change your shell on purpose, you're probably running ZSH on macOS and BASH on Linux (including Windows Subsystem for Linux [WSL]). You can try these two commands to see if the ps command can tell you which shell you're using.
$ ps -p$$ -ocommand=
/usr/bin/zsh
# try this variant if the first one gave you an error
$ ps -p$$ -ocmd=
/usr/bin/zsh
With the command chsh, you may change your default shell for all future terminal sessions in macOS or Linux.
# use zsh for future shells
chsh -s /usr/bin/zsh