{"schema_version":"1.0","publisher":"Primitive SDKs","canonical_url":"https://test.abhinandan.one/cli-completion-and-utilities","markdown_url":"https://test.abhinandan.one/cli-completion-and-utilities.md","article":{"id":"1329924e-0d71-4c61-a6b6-2c1fda061849","article_slug":"cli-completion-and-utilities","parent_article_slug":null,"parent_article_title":null,"kind":"reference","published_at":"2026-08-11T18:55:04.750575+00:00","keywords":["primitive autocomplete","primitive completion","fish completion","oclif autocomplete","routes test","functions test-function"],"meta_description":"Bash, zsh, and PowerShell completion for the primitive CLI use oclif's built-in autocomplete plugin, while fish is generated by a custom script.","og_image_url":null,"source_file_paths":[],"recording_id":null,"replayable":false,"task_name":"Shell Completion and Endpoint Test Redirects","category":"CLI","summary":null,"description":"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.","content_kind":"repo_page","content_markdown":"## Shell completion\n\nThe `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?](cli-overview) for the command-surface overview the completions are derived from.\n\n### bash, zsh, PowerShell\n\nRun the built-in `autocomplete` command to print the setup instructions for your shell:\n\n```bash\nprimitive autocomplete\n```\n\nPass the shell name explicitly to get the instructions for a shell other than your current one:\n\n```bash\nprimitive autocomplete bash\nprimitive autocomplete zsh\nprimitive autocomplete powershell\n```\n\nFollow 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.\n\n### fish\n\nFish 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.\n\n<Note>\n\nThe 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.\n\n</Note>\n\n## Endpoint test redirects\n\n`endpoints-test-redirect` is an internal CLI helper, not a command you invoke. It is the shared plumbing exercised by two public commands:\n\n| Command | What it does |\n|---|---|\n| `primitive routes-test` | Previews where a recipient address resolves under [recipient routing](cli-domains-and-routes) rules, including the rule trace |\n| `primitive functions-test-function` | Runs a test invocation against a deployed [Primitive Function](cli-functions) so you can exercise its handler without waiting on real inbound mail |\n\nBecause the helper is plumbing rather than a user-facing command, look up its behavior through whichever command you are running:\n\n- Route resolution and matching output: `primitive routes-test --help`\n- Function invocation output and log correlation: `primitive functions-test-function --help` (see [Primitive Functions: Deploy, Route, and Manage](cli-functions))\n\nFor the API-level test-delivery behavior these commands sit on top of, including how a test delivery is signed, see [Webhook Events Overview](webhook-events).\n\n## Next steps\n\n<CardGroup cols={2}>\n\n<Card title=\"What is the Primitive CLI?\" href=\"cli-overview\">\n\nSee the full oclif-based command surface and how it shares the Node SDK and api-core internally.\n\n</Card>\n\n<Card title=\"Managing Domains and Recipient Routes\" href=\"cli-domains-and-routes\">\n\nConfigure recipient routing rules and preview resolution with routes-test.\n\n</Card>\n\n<Card title=\"Primitive Functions: Deploy, Route, and Manage\" href=\"cli-functions\">\n\nDeploy, test, and route Primitive Functions from the terminal.\n\n</Card>\n\n<Card title=\"Direct API Access and Generic Commands\" href=\"cli-generic-api-access\">\n\nCall any generated operation directly and explore the API surface from the terminal.\n\n</Card>\n\n</CardGroup>","canonical_base_url":"https://test.abhinandan.one","seo_indexing_enabled":true,"last_modified":"2026-08-21T18:22:43.359885+00:00","video_url":null,"voiceover_url":null,"tools_used":[],"demonstrated_by":[],"steps":[],"related_links":[],"intro":null,"prerequisites":[],"verification":[],"troubleshooting":[],"suggest_edit_url":null,"raise_issue_url":"https://github.com/abhi-browzer/primitive-sdks/issues/new?title=Docs+feedback%3A+Shell+Completion+and+Endpoint+Test+Redirects&body=Page%3A+https%3A%2F%2Ftest.abhinandan.one%2Fcli-completion-and-utilities","page_feedback_enabled":true,"verified_ref":null,"verified_at":"2026-08-11T18:38:45.205849+00:00"}}