$ shellfirm

shellfirm init

Initialize shell hooks for command interception

The init command sets up shell hooks so shellfirm can intercept commands before they execute.

Usage

shellfirm init [OPTIONS] [SHELL]

Options

FlagDescriptionDefault
--uninstallRemove hooks from all configured shells-
--dry-runShow what would be done without making any changes-

Arguments

ArgumentDescription
SHELLTarget shell: zsh, bash, fish, nushell, powershell, elvish, xonsh, oils

Modes

Automatic setup

Install hooks for all detected shells:

shellfirm init

This scans your system for installed shells and appends the appropriate hook to each shell's configuration file. After running, restart your shell.

Automatic removal

Remove hooks from all shells:

shellfirm init --uninstall

Generate hook script

Print the hook script for a specific shell (useful for manual setup):

shellfirm init zsh

Output can be piped to your shell config:

shellfirm init zsh >> ~/.zshrc

Or used with eval:

eval "$(shellfirm init zsh)"

Examples

# Install for all detected shells
shellfirm init

# Generate Zsh hook script
shellfirm init zsh

# Generate Fish hook script
shellfirm init fish

# Remove all hooks
shellfirm init --uninstall

Shell-specific output

Each shell produces a different hook format:

ShellEval command
Zsheval "$(shellfirm init zsh)"
Basheval "$(shellfirm init bash)"
Fishshellfirm init fish | source
Nushellsource (shellfirm init nushell | save --force ~/.shellfirm.nu; echo ~/.shellfirm.nu)
PowerShellInvoke-Expression (shellfirm init powershell | Out-String)
Elvisheval (shellfirm init elvish | slurp)
Xonshexecx($(shellfirm init xonsh))
Oilseval "$(shellfirm init oils)"