---
title: thv config set-build-auth-file
hide_title: true
description: Reference for ToolHive CLI command `thv config set-build-auth-file`
last_update:
  author: autogenerated
slug: thv_config_set-build-auth-file
mdx:
  format: md
---

## thv config set-build-auth-file

Set an auth file for protocol builds

### Synopsis

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:
  # Set npmrc for private npm registry
  thv config set-build-auth-file npmrc '//npm.corp.example.com/:_authToken=TOKEN'

  # Set netrc for pip/Go authentication
  thv config set-build-auth-file netrc 'machine github.com login git password TOKEN'

  # Read content from stdin (avoids exposing secrets in shell history)
  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]
```

### Options

```
  -h, --help    help for set-build-auth-file
      --stdin   Read file content from stdin instead of command line argument (default false)
```

### Options inherited from parent commands

```
      --debug   Enable debug mode
```

### SEE ALSO

* [thv config](thv_config.md)	 - Manage application configuration

