From 701c53220087d29c4eece28b7dad0268e8072d2c Mon Sep 17 00:00:00 2001 From: Theo Ephraim Date: Thu, 18 Jun 2026 14:49:07 -0700 Subject: [PATCH 1/2] docs: clarify package manager completions delegate to local CLIs --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index e691729..8417e23 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,20 @@ yarn add --emoji= # Shows: true, false ``` +### Completing locally-installed CLIs + +Package manager completion does more than complete the package manager's own flags — it also **delegates to CLIs installed as local project dependencies**. If a CLI implements tab's completion protocol (directly or via a [framework adapter](#framework-adapters)), it becomes completable through your package manager *without* being on your `PATH` and without installing its completion script separately: + +```bash +pnpm exec my-cli # completes my-cli's subcommands and flags +pnpm dlx my-cli +pnpm my-cli # the bare form works too +``` + +Under the hood, tab strips the package-manager wrapper (`exec`, `x`, `run`, `dlx`), detects whether the target CLI supports completion, and forwards the request to it — falling back to running the CLI *through* the package manager (e.g. `pnpm my-cli complete -- …`) so locally-installed binaries resolve. The same works for `npm exec`, `yarn`, and `bun x`. + +> **Note:** Completion is registered against the package-manager binary (`npm`, `pnpm`, `yarn`, `bun`). `npx` and `bunx` are separate commands with no completion of their own, so `npx my-cli ` / `bunx my-cli ` won't complete — use `npm exec my-cli` / `bun x my-cli` instead. + ## Framework Adapters tab provides adapters for popular JavaScript CLI frameworks. From 2c98859c14b2f52fa7bf7992422a163b6add5c33 Mon Sep 17 00:00:00 2001 From: Theo Ephraim Date: Thu, 18 Jun 2026 15:21:45 -0700 Subject: [PATCH 2/2] docs: run prettier on README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8417e23..6ecba37 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ yarn add --emoji= ### Completing locally-installed CLIs -Package manager completion does more than complete the package manager's own flags — it also **delegates to CLIs installed as local project dependencies**. If a CLI implements tab's completion protocol (directly or via a [framework adapter](#framework-adapters)), it becomes completable through your package manager *without* being on your `PATH` and without installing its completion script separately: +Package manager completion does more than complete the package manager's own flags — it also **delegates to CLIs installed as local project dependencies**. If a CLI implements tab's completion protocol (directly or via a [framework adapter](#framework-adapters)), it becomes completable through your package manager _without_ being on your `PATH` and without installing its completion script separately: ```bash pnpm exec my-cli # completes my-cli's subcommands and flags @@ -166,7 +166,7 @@ pnpm dlx my-cli pnpm my-cli # the bare form works too ``` -Under the hood, tab strips the package-manager wrapper (`exec`, `x`, `run`, `dlx`), detects whether the target CLI supports completion, and forwards the request to it — falling back to running the CLI *through* the package manager (e.g. `pnpm my-cli complete -- …`) so locally-installed binaries resolve. The same works for `npm exec`, `yarn`, and `bun x`. +Under the hood, tab strips the package-manager wrapper (`exec`, `x`, `run`, `dlx`), detects whether the target CLI supports completion, and forwards the request to it — falling back to running the CLI _through_ the package manager (e.g. `pnpm my-cli complete -- …`) so locally-installed binaries resolve. The same works for `npm exec`, `yarn`, and `bun x`. > **Note:** Completion is registered against the package-manager binary (`npm`, `pnpm`, `yarn`, `bun`). `npx` and `bunx` are separate commands with no completion of their own, so `npx my-cli ` / `bunx my-cli ` won't complete — use `npm exec my-cli` / `bun x my-cli` instead.