---
title: "vlt setup"
description: "Documentation for the vlt client and the vlt registry."
url: "https://docs.vlt.io/client/commands/setup"
image: "https://docs.vlt.io/og/client/commands/setup"
lang: "en"
---

# vlt setup

Usage:

```bash title="Terminal"
$ vlt setup [<account>]
$ vlt setup --path
$ vlt setup --skills
```

Connect vlt to your vlt.io account. vlt installs public packages without it, through vlt's public npm mirror; setup points the `npm` alias at your account's npm mirror (no usage limits) and adds your private `main` registry.

`vlt setup` is optional: with no config, bare specifiers (like `vlt install express`) resolve through the built-in `npm` alias, [vlt's public npm mirror](https://docs.vlt.io/registry/public-mirror.md), a shared service with usage limits. It is recommended for an account mirror with no usage limits, private packages, tokens, and publishing. Sign up or log in at [https://www.vlt.io](https://www.vlt.io/) first, then run the wizard.

## What it does

1. Prompts for your vlt.io account (or organization) slug if not passed as an argument.

2. Stages the two registry aliases every account is provisioned with:

   - `npm` → `https://registry.vlt.io/<account>/npm/` (the default [bare-spec alias](https://docs.vlt.io/client/registries.md#bare-specs-and---default-registry-alias))
   - `main` → `https://registry.vlt.io/<account>/main/` (your account's primary private registry)

3. Optionally authenticates against those registries via the browser web-login flow. A single token covers every registry on your account, so the browser opens once and the token it returns is saved for both the public `npm` mirror and your private `main` registry.

4. Loops to let you add any additional custom aliases (for partner or team registries), optionally authenticating against each.

5. Writes the staged aliases into your user `vlt.json` (merging with, not clobbering, existing entries). Aliases that already live in a `vlt.json` are left where they are, so a project-local alias does not get copied into your user config (or the reverse).

6. If your keychain has a token for only one of `npm` / `main`, copies it to the other. Existing tokens are never overwritten, and `VLT_TOKEN*` environment tokens are never saved. This also runs with `--yes` or when you skip authentication.

7. In a terminal, if the global bin folder isn't on your `PATH` or set up yet, asks `Setup PATH for global installs? (Y/n)`. Yes adds it (see [below](https://docs.vlt.io/client/commands/setup#add-global-bins-to-your-path)); no skips it, and `vlt setup --path` does just that step later. Not asked with `--yes`, without a terminal, or with `--no-modify-path`.

8. With `--config=project`, in a project with a `package.json`, asks `Do you want to install vlt skills? (Y/n)`. Yes installs [vlt's agent skills](https://docs.vlt.io/client/commands/setup#install-vlts-agent-skills) in the project; no skips it, and `vlt setup --skills` does just that step later. `--yes` accepts without asking. Not asked without a terminal (and without `--yes`), or when the project already has them. Plain `vlt setup` (user config) never asks: in a project without the skills, it ends with a hint to run `vlt setup --skills`.

If the project you run this in configures its own registries, the output says so: [project config takes precedence](https://docs.vlt.io/client/configuring.md#registry-selection-across-layers) for registry selection, so writing your user config would not take effect there. Re-run with `--config=project` to configure that project.

## Options

| Flag                       | Description                                                                                                                                                                                                                          |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `--config=<user\|project>` | Which config file to write to. Defaults to `user`; use `project` for the project.                                                                                                                                                    |
| `--registries=<name=url>`  | Additional registry aliases to stage non-interactively. Can be set multiple times.                                                                                                                                                   |
| `--yes`                    | Skip interactive prompts. Requires `<account>`, no browser auth; step 6 still runs, step 7 is skipped, step 8 installs the skills (with `--config=project`, in a project with a `package.json`). With `--path`: edit without asking. |
| `--path`                   | Only add the global bin folder to your `PATH`, see [below](https://docs.vlt.io/client/commands/setup#add-global-bins-to-your-path).                                                                                                  |
| `--skills`                 | Only install vlt's agent skills in the current project, see [below](https://docs.vlt.io/client/commands/setup#install-vlts-agent-skills). No prompt.                                                                                 |
| `--global-bin-dir=<path>`  | The folder to add.                                                                                                                                                                                                                   |

## Examples

Interactive setup for an account:

```bash title="Terminal"
$ vlt setup my-account
```

Unattended setup (for CI or setup scripts):

```bash title="Terminal"
$ vlt setup my-account --yes --registries team=https://registry.example.com/
```

Write to the project's `vlt.json` instead of your user config:

```bash title="Terminal"
$ vlt setup my-account --config=project
```

Add global bins to your `PATH`:

```bash title="Terminal"
$ vlt setup --path
```

Install vlt's agent skills in an existing project:

```bash title="Terminal"
$ vlt setup --skills
```

## Add global bins to your PATH

Adds the global bin folder (see [Global installs](https://docs.vlt.io/client/commands/install.md#global-installs)) to your `PATH` in new terminals. `vlt setup` offers it at its end; `vlt setup --path` runs just that step (after skipping it, or on an older setup). `vlt install -g` also offers it once, in a terminal, when that folder isn't on your `PATH` (`--yes` accepts without asking).

On macOS and Linux, it writes `<global-dir>/env` (and `env.fish`), which adds the folder to `PATH`, and a section that loads it into your shell config:

| Shell         | File                                                                                                                                                                     |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| zsh           | `$ZDOTDIR/.zshrc` or `~/.zshrc`                                                                                                                                          |
| bash          | each of `~/.bash_profile`, `~/.bash_login`, `~/.bashrc` that exists, and `~/.profile` when there's none (on macOS: when there's no `~/.bash_profile` or `~/.bash_login`) |
| sh, dash, ksh | `$ENV` or `~/.profile`                                                                                                                                                   |
| fish          | `~/.config/fish/conf.d/vlt.fish` (`$XDG_CONFIG_HOME` when set)                                                                                                           |

```bash title="~/.zshrc"
# vlt
if [ -f "$HOME/.local/share/vlt/global/env" ]; then . "$HOME/.local/share/vlt/global/env"; fi
# vlt end
```

On Windows it adds the folder to the start of your user `Path` (_Edit environment variables for your account_) instead, whatever the shell. If the folder changes, the new one is added and the old entry stays.

- Asks first, unless `--yes` (required without a terminal).
- Backs files (on Windows, the old `Path`) up to `<global-dir>/backups`.
- Running it again changes nothing. On macOS and Linux, if the folder changes, only `env` is rewritten.
- Already in your `PATH`: nothing changes.
- A different `# vlt` section is replaced.
- A symlinked file (dotfile managers) is followed: its target is edited and the link is kept.
- `--global-bin-dir=<path>` picks the folder.
- `VLT_NO_MODIFY_PATH=1` (any value but `0`), or `--no-modify-path`, turns this and the install offer off (the line to add is printed instead), and skips the `vlt setup` prompt.
- Other shells (like nu) aren't supported on macOS and Linux yet: it prints the line to add.

Open a new terminal afterwards (on Windows, also restart editors like VS Code), or run the line it prints.

## Install vlt's agent skills

`@vltpkg/skills` packages vlt's [agent skills](https://docs.vlt.io/client/commands/skills.md) (`vlt-cli`, `dss-query`, `vlt-registry-migration`), so coding agents in the project know how to use vlt. `vlt setup --config=project` offers them at its end; `vlt setup --skills` runs just that step, in a project that was set up earlier or by someone else. It never prompts, so agents and scripts can run it as is.

```bash title="Terminal"
$ vlt setup --skills
Added @vltpkg/skills to devDependencies
🔗 Linked 3 agent skills into .agents/skills, .claude/skills
Saved allow-skills=":not(:malware), #@vltpkg/skills" to vlt.json
```

It works like `vlt install -D @vltpkg/skills --allow-skills="<query>"` on the project root:

1. Adds `@vltpkg/skills` to the root `devDependencies` and installs. If it already is a dependency of the root, its type and spec are kept. In a monorepo, the dependency goes to the root.
2. Links the skills the query selects into the project's [agent skill dirs](https://docs.vlt.io/client/commands/skills.md#where-skills-are-linked) (`.agents/skills`, `.claude/skills`, …, or `skills-dir`), writing their `.gitignore` blocks. Like any install, it only adds links.
3. Saves `allow-skills` to the project `vlt.json`, so a fresh clone and `vlt ci` link the skills too. Commit `package.json`, `vlt-lock.json` and `vlt.json`.

Unlike `vlt install --allow-skills`, which keeps a stored query, it adds a `#@vltpkg/skills` selector to it (a comma list is a union, so nothing that was selected is dropped):

| Stored `allow-skills` (project `vlt.json`, else user)                 | Saved to the project `vlt.json`   |
| --------------------------------------------------------------------- | --------------------------------- |
| none                                                                  | `:not(:malware), #@vltpkg/skills` |
| a query with no `#@vltpkg/skills` selector, e.g. `#other`             | `#other, #@vltpkg/skills`         |
| a query with a `#@vltpkg/skills` selector, with or without `:skill()` | unchanged                         |
| `:not(*)` (skills turned off)                                         | `#@vltpkg/skills`                 |

`:not(:malware)` is the default of `vlt skills link`. With it, installs in the project link the skills of every installed package that is not flagged as malware, and need security data to do so: skills of packages Socket has not scanned are left out ([fail closed](https://docs.vlt.io/client/commands/skills.md#safety)), as in any project that ran `vlt skills link`. Narrow it with `vlt skills link <query>`.

- Running it again changes nothing.
- It installs through `registries.npm` (vlt's public npm mirror unless configured), like any install.
- No `package.json` at the project root is an error: run `vlt init` first.
- It always acts on the current project: `--config=user` isn't supported yet, and it can't be combined with `--path`.
- `vlt setup --skills` fails like `vlt install`. In the wizard, the registries are already saved, so a failed install (e.g. a 401 after skipping authentication) is a warning with the command to run later, and setup still succeeds. Nothing is saved to `vlt.json` when the install or the link fails.
- `--view=json` reports it under `skills`: `status` (`installed`, `unchanged`, `cancelled` or `failed`), the `query`, and the linked skills.

## See also

- [Working with Named Registries](https://docs.vlt.io/client/registries.md)
- [Authentication](https://docs.vlt.io/client/auth.md)
- [`vlt login`](https://docs.vlt.io/client/commands/login.md)
- [Global Installs](https://docs.vlt.io/client/global-installs.md)
- [`vlt skills`](https://docs.vlt.io/client/commands/skills.md)
