| title | thv config set-build-auth-file | ||
|---|---|---|---|
| hide_title | true | ||
| description | Reference for ToolHive CLI command `thv config set-build-auth-file` | ||
| last_update |
|
||
| slug | thv_config_set-build-auth-file | ||
| mdx |
|
Set an auth file for protocol builds
Set authentication file content that will be injected into the container during protocol builds (npx://, uvx://, go://). This is useful for authenticating to private package registries.
Supported file types:
npmrc - NPM configuration (/.npmrc) for npm/npx registries
netrc - Netrc file (/.netrc) for pip, Go, and other tools
yarnrc - Yarn configuration (~/.yarnrc)
The file content is injected into the build stage only and is NOT included in the final container image.
Examples:
thv config set-build-auth-file npmrc '//npm.corp.example.com/:_authToken=TOKEN'
thv config set-build-auth-file netrc 'machine github.com login git password TOKEN'
cat ~/.npmrc | thv config set-build-auth-file npmrc --stdin thv config set-build-auth-file npmrc --stdin < ~/.npmrc
Note: For multi-line content, use quotes, heredoc syntax, or --stdin.
thv config set-build-auth-file <name> [content] [flags]
-h, --help help for set-build-auth-file
--stdin Read file content from stdin instead of command line argument (default false)
--debug Enable debug mode
- thv config - Manage application configuration