Shell Completion and Endpoint Test Redirects
Set up bash, zsh, PowerShell, or fish tab-completion for the primitive CLI, and understand the internal test-redirect helper that backs primitive routes-test and functions-test-function.
Shell completion#
The primitive CLI ships shell completion for bash, zsh, and PowerShell through oclif's official autocomplete plugin, plus a separately generated fish completion output. See What is the Primitive CLI? for the command-surface overview the completions are derived from.
bash, zsh, PowerShell#
Run the built-in autocomplete command to print the setup instructions for your shell:
primitive autocomplete
Pass the shell name explicitly to get the instructions for a shell other than your current one:
primitive autocomplete bash
primitive autocomplete zsh
primitive autocomplete powershell
Follow the exact commands the output prints. The generated script location and the shell hook are managed by oclif's autocomplete plugin, so they can differ across oclif versions.
fish#
Fish is not covered by oclif's autocomplete plugin, so the CLI emits its own fish completion output instead. Install that output as a fish completion for the primitive command, then start a new shell to pick up the CLI's subcommands and flags.
The fish output is produced separately from the bash/zsh/PowerShell path, so a newly added command or flag needs the fish completion re-installed rather than just a shell restart.
Endpoint test redirects#
endpoints-test-redirect is an internal CLI helper, not a command you invoke. It is the shared plumbing exercised by two public commands:
| Command | What it does |
|---|---|
primitive routes-test | Previews where a recipient address resolves under recipient routing rules, including the rule trace |
primitive functions-test-function | Runs a test invocation against a deployed Primitive Function so you can exercise its handler without waiting on real inbound mail |
Because the helper is plumbing rather than a user-facing command, look up its behavior through whichever command you are running:
- Route resolution and matching output:
primitive routes-test --help - Function invocation output and log correlation:
primitive functions-test-function --help(see Primitive Functions: Deploy, Route, and Manage)
For the API-level test-delivery behavior these commands sit on top of, including how a test delivery is signed, see Webhook Events Overview.
Next steps#
See the full oclif-based command surface and how it shares the Node SDK and api-core internally.
Managing Domains and Recipient RoutesConfigure recipient routing rules and preview resolution with routes-test.
Primitive Functions: Deploy, Route, and ManageDeploy, test, and route Primitive Functions from the terminal.
Direct API Access and Generic CommandsCall any generated operation directly and explore the API surface from the terminal.
Was this page helpful?