> ## Documentation Index
> Fetch the complete documentation index at: https://namespace.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# nsc vault export

Resolve vault references into a temporary environment file.

`vault export` reads an envdef file that maps environment variable names to
[vault](/docs/workspaces/security) references, resolves each reference to its
secret value, and writes the result out as a temporary environment file. This
is useful when a shell session or CI job needs secrets available as
environment variables without ever hard-coding the secret values themselves.

With `--shell`, instead of writing a file `vault export` prints commands for
the given shell, so the output can be sourced directly, e.g.
`source <(nsc vault export --envdef secrets.envdef --shell bash)`.

## Usage

```bash theme={null}
nsc vault export --envdef <file> [--shell <shell>]
```

### Example

```bash theme={null}
source <(nsc vault export --envdef secrets.envdef --shell bash)
```

## Options

<h3 id="--envdef-file">
  \--envdef \<file>
</h3>

Load environment variable names and vault references from this file, rather
than literal values. `vault export` resolves each reference against your
workspace's [vault](/docs/workspaces/security) before emitting it.

<h3 id="--shell-shell">
  \--shell \<shell>
</h3>

Emit commands for the specified shell instead of writing a temporary
environment file. Currently only `bash` is supported.

## Related Topics

* [nsc vault add](/docs/reference/cli/vault-add)
* [nsc vault list](/docs/reference/cli/vault-list)
* [nsc vault set](/docs/reference/cli/vault-set)
