StarForge ships pre-generated completion scripts for bash, zsh, and
fish in the completions/ directory and can also generate them on-demand
via the starforge completions subcommand.
# One-time — generate and install to the user completion directory
mkdir -p ~/.local/share/bash-completion/completions
starforge completions bash > ~/.local/share/bash-completion/completions/starforge
# Or source it directly from your shell profile
echo 'source <(starforge completions bash)' >> ~/.bashrc
source ~/.bashrc# Ensure a completions directory is on your $fpath, then install
mkdir -p ~/.zsh/completions
starforge completions zsh > ~/.zsh/completions/_starforge
# Add the directory to $fpath in ~/.zshrc (if not already present)
echo 'fpath=(~/.zsh/completions $fpath)' >> ~/.zshrc
echo 'autoload -Uz compinit && compinit' >> ~/.zshrc
source ~/.zshrcstarforge completions fish > ~/.config/fish/completions/starforge.fishChanges take effect in new shell sessions (or after source-ing the file).
The completions/ directory in the repository contains scripts generated from
the current CLI definition:
| File | Shell |
|---|---|
completions/starforge.bash |
bash |
completions/_starforge |
zsh |
completions/starforge.fish |
fish |
Copy the relevant file to the location shown above instead of running
starforge completions <shell>.
| Shell | Status |
|---|---|
| bash | Fully supported |
| zsh | Fully supported |
| fish | Fully supported |
PowerShell completion is not currently supported.
After installing, open a new terminal session and type:
starforge <TAB>
You should see a list of available subcommands. Press <TAB> again after
typing a subcommand prefix to narrow the choices.
$ starforge w<TAB>
wallet$ starforge <TAB>
wallet -- Manage test wallets (create, list, fund, show, remove)
new -- Generate Soroban project boilerplate
deploy -- Deploy a compiled Soroban contract (.wasm)
...$ starforge <TAB>
wallet (Manage test wallets)
new (Generate Soroban project boilerplate)
...Completions not working after install
- Open a new terminal window — changes are not applied to running sessions.
- Verify the file is in the correct location:
- bash:
~/.local/share/bash-completion/completions/starforge - zsh: a directory on your
$fpath, e.g.~/.zsh/completions/_starforge - fish:
~/.config/fish/completions/starforge.fish
- bash:
- Check that
bash-completion(bash) orcompinit(zsh) is active in your shell profile.
Completions are stale after upgrading StarForge
Re-run the install command to regenerate:
starforge completions bash > ~/.local/share/bash-completion/completions/starforgeZsh: command not found: compdef
Add the following lines to ~/.zshrc before the fpath entry:
autoload -Uz compinit
compinitCompletion scripts are generated from the live CLI definition, so they always reflect the current set of commands and flags. Re-generate after any StarForge upgrade to pick up new subcommands.
The completions/ scripts in the repository are regenerated automatically as
part of the release process.