|
| 1 | +--- |
| 2 | +title: thv config set-build-auth-file |
| 3 | +hide_title: true |
| 4 | +description: Reference for ToolHive CLI command `thv config set-build-auth-file` |
| 5 | +last_update: |
| 6 | + author: autogenerated |
| 7 | +slug: thv_config_set-build-auth-file |
| 8 | +mdx: |
| 9 | + format: md |
| 10 | +--- |
| 11 | + |
| 12 | +## thv config set-build-auth-file |
| 13 | + |
| 14 | +Set an auth file for protocol builds |
| 15 | + |
| 16 | +### Synopsis |
| 17 | + |
| 18 | +Set authentication file content that will be injected into the container |
| 19 | +during protocol builds (npx://, uvx://, go://). This is useful for authenticating |
| 20 | +to private package registries. |
| 21 | + |
| 22 | +Supported file types: |
| 23 | + npmrc - NPM configuration (~/.npmrc) for npm/npx registries |
| 24 | + netrc - Netrc file (~/.netrc) for pip, Go, and other tools |
| 25 | + yarnrc - Yarn configuration (~/.yarnrc) |
| 26 | + |
| 27 | +The file content is injected into the build stage only and is NOT included |
| 28 | +in the final container image. |
| 29 | + |
| 30 | +Examples: |
| 31 | + # Set npmrc for private npm registry |
| 32 | + thv config set-build-auth-file npmrc '//npm.corp.example.com/:_authToken=TOKEN' |
| 33 | + |
| 34 | + # Set netrc for pip/Go authentication |
| 35 | + thv config set-build-auth-file netrc 'machine github.com login git password TOKEN' |
| 36 | + |
| 37 | + # Read content from stdin (avoids exposing secrets in shell history) |
| 38 | + cat ~/.npmrc | thv config set-build-auth-file npmrc --stdin |
| 39 | + thv config set-build-auth-file npmrc --stdin < ~/.npmrc |
| 40 | + |
| 41 | +Note: For multi-line content, use quotes, heredoc syntax, or --stdin. |
| 42 | + |
| 43 | +``` |
| 44 | +thv config set-build-auth-file <name> [content] [flags] |
| 45 | +``` |
| 46 | + |
| 47 | +### Options |
| 48 | + |
| 49 | +``` |
| 50 | + -h, --help help for set-build-auth-file |
| 51 | + --stdin Read file content from stdin instead of command line argument |
| 52 | +``` |
| 53 | + |
| 54 | +### Options inherited from parent commands |
| 55 | + |
| 56 | +``` |
| 57 | + --debug Enable debug mode |
| 58 | +``` |
| 59 | + |
| 60 | +### SEE ALSO |
| 61 | + |
| 62 | +* [thv config](thv_config.md) - Manage application configuration |
| 63 | + |
0 commit comments