chainsaw install-hook

Wire chainsaw into a package manager

Wire chainsaw into a package manager

chainsaw install-hook [manager] [flags]

Aliases: wire

Insert the chainsaw-managed configuration block into a supported package manager’s user config file. Supported clients: npm, yarn, bun, pip, cargo, maven, gradle, sbt, nuget, go, docker.

The Chainsaw server URL baked into the block comes from the standard config chain: the root –server flag, the CHAINSAW_SERVER environment variable, or the saved config (set via chainsaw auth login). If no server is configured, the block is still written but without a server URL.

The generated URLs are <server>/repository/@<org-slug>/<ecosystem>/, matching the dashboard’s “Save this secret now” snippet exactly. Any base path comes from the configured server URL itself, so the hosted service (--server https://chain305.com/chainproxy) and a proxy you run yourself at the root of a host (--server http://localhost:8787) each get a URL their own proxy serves.

The org slug is resolved from –org when set, then from your account after chainsaw auth login, and finally falls back to a visible placeholder so a misconfigured install fails loud: the proxy rejects SLUG-less URLs with CHW-4314 (“legacy URLs without the org slug are disabled”).

Examples: chainsaw install-hook npm chainsaw install-hook –all chainsaw –server https://chain305.com/chainproxy install-hook npm –org acme-corp

Flags

FlagTypeDefaultDescription
--allbool—Wire every installed manager
--credentialsstring—Embed the given “client_id:client_secret” pair in the generated config. When unset the CLI offers to issue a fresh pair for you on a TTY.
--no-credentialsbool—Skip the credentials prompt and emit an unauthenticated block (the pre-2026-04 behaviour).
--orgstring—Org slug to splice into the generated URLs (e.g. acme-corp). Auto-discovered from your account when unset and you are logged in. Required by the proxy — slug-less URLs fail with CHW-4314.
--scopestring—Where to write config: “user” (global) or “project” (current dir). Prompts when unset on a TTY.

The global flags apply here too.