acton completions
Reference manual for the acton completions command
Synopsis
acton completions [options] shell
Description
Generate a static completion script for the selected shell.
Acton also supports dynamic completions through the COMPLETE=<shell> acton
mechanism. Dynamic completions are usually more powerful because they can use
project context such as contract and script names.
Quick Start
- for dynamic completions, prefer
COMPLETE=<shell> acton - for a static script without editing shell startup files yet, run
acton completions <shell>and inspect the output first - regenerate static completion files after upgrading Acton
Options
Completion Options
Shell to generate completions for.
bash, elvish, fish, powershell, zsh, nushell
Display Options
Control when to use colored output.
auto, always, never
Project Options
Accepted as a global Acton option for CLI consistency.
This command does not require an existing project manifest for its primary
workflow. It remains mutually exclusive with --project-root.
Accepted as a global Acton option for CLI consistency.
This command does not require an existing project root for its primary
workflow. It remains mutually exclusive with --manifest-path.
Dynamic Completions
Dynamic completions are recommended when your shell supports them.
Zsh
Add this to ~/.zshrc:
source <(COMPLETE=zsh acton)Bash
Add this to ~/.bashrc:
source <(COMPLETE=bash acton)Fish
Add this to ~/.config/fish/config.fish:
COMPLETE=fish acton | sourceStatic Installation
acton completions writes the completion script to standard output. Typical
installation patterns include:
Bash
For the current shell session:
source <(acton completions bash)For a persistent setup, either append to ~/.bashrc:
acton completions bash >> ~/.bashrcor install into the system completion directory:
acton completions bash | sudo tee /usr/share/bash-completion/completions/actonZsh
Zsh usually expects the completion file in a directory listed in $fpath:
mkdir -p ~/.zsh/completions
acton completions zsh > ~/.zsh/completions/_acton
echo 'fpath=(~/.zsh/completions $fpath)' >> ~/.zshrc
echo 'autoload -Uz compinit && compinit' >> ~/.zshrcReload the shell or run:
source ~/.zshrcFish
acton completions fish > ~/.config/fish/completions/acton.fishPowerShell
For the current session:
acton completions powershell | Out-String | Invoke-ExpressionFor a persistent setup, add the generated script to your PowerShell profile.
Elvish
acton completions elvish > ~/.elvish/completions/acton.elvThen load it from ~/.elvish/rc.elv:
use completions/actonNushell
acton completions nushell | save --force ~/.config/nushell/completions/acton.nuThen load it from config.nu:
source ~/.config/nushell/completions/acton.nuVerifying Installation
After installation, try:
acton <TAB>
acton test --<TAB>You should see command names and flag suggestions from the selected shell.
Troubleshooting
- if static completions show old commands, regenerate them after updating Acton
- Zsh usually needs
compinitafter changing completion locations - if Zsh still does not complete, delete
~/.zcompdumpand reruncompinit - Bash may require the shell-specific completion package to be installed
- if PowerShell completions do not persist, verify that the generated script is
loaded from
$PROFILE
Exit Status
0: The completion script was generated successfully.1: The shell value was unsupported or output could not be written.
Examples
-
Generate a static Zsh script:
acton completions zsh -
Enable dynamic Bash completions:
source <(COMPLETE=bash acton) -
Inspect generated output without installing it:
acton completions zsh | head
See Also
Last updated on