> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://docs.ampdb.io/api/mcp` to find what you need.

# ampup

`ampup` installs Amp's binaries and keeps several versions of them side by side, so you can update, roll back, or try a
nightly build in one command. Each version holds [`ampd`](/running-amp/ampd), the daemon that runs Amp, and Amp's
[`ampctl`](/clis/ampctl) and [`ampsql`](/clis/ampsql) CLIs. `ampup` doesn't install [`ampsync`](/clis/ampsync#install)
or a PostgreSQL server.

## Install

`ampup` runs on Linux and macOS, on x86_64 or aarch64. Its installer needs `curl`:

```bash
curl --proto '=https' --tlsv1.2 -sSf https://ampup.sh/install | sh
```

The installer puts `ampup` in `~/.amp/bin`, adds that directory to your `PATH`, and installs the latest release. Open a
new terminal, or `source` the file it names, then check that the binaries are on your `PATH`:

:::terminal
```bash
ampd --version
```

```
ampd v0.0.42
```
:::

It adds `~/.amp/bin` to your `PATH` in the profile your shell reads: `~/.zshenv` for zsh (`$ZDOTDIR/.zshenv` if you set
`ZDOTDIR`), `~/.bashrc` for bash, `~/.config/fish/config.fish` for fish, and `~/.profile` for ash. For any other shell,
it prints a warning, and you add `~/.amp/bin` to your `PATH` yourself.

To install Amp another way, like with Nix or Docker, see [Installation](/running-amp/installation).

### Installer options

Pass options to the installer after `sh -s --`:

```bash
curl --proto '=https' --tlsv1.2 -sSf https://ampup.sh/install | sh -s -- --no-modify-path --install-dir ~/tools/amp
```

| Option                          | Type   | Default                        | Description                                                                                                         |
| ------------------------------- | ------ | ------------------------------ | ------------------------------------------------------------------------------------------------------------------- |
| `--install-dir <INSTALL_DIR>`   | path   | [`~/.amp`](/clis/ampup#install-directory) | Where to install `ampup` and Amp's versions, like `--install-dir ~/tools/amp`. Set `AMP_DIR` to the same directory. |
| `--no-modify-path`              | flag   | off                            | Leaves your shell profile alone. Add the install directory's `bin` to your `PATH` yourself.                         |
| `--no-install-latest`           | flag   | off                            | Installs only `ampup`. Run [`ampup install`](/clis/ampup#ampup-install) when you're ready.                                     |
| `--github-token <GITHUB_TOKEN>` | string | `$GITHUB_TOKEN`                | A GitHub token, for the [rate limits](/clis/ampup#github-authentication) of signed-in requests.                                |

To update an installed `ampup`, run [`ampup self update`](/clis/ampup#ampup-self-update).

## Versions

Amp publishes two kinds of [releases](https://github.com/edgeandnode/amp/releases), and `ampup` installs either by its
tag:

* **Releases**, like `v0.0.42`. `ampup` installs the latest one unless you name another. These docs describe the
  latest release.
* **Nightly builds** of the main branch, like `nightly-cd41e82`, tagged with the commit they're built from.

`ampup` can also [build a version from source](/clis/ampup#ampup-build): a branch, a commit, a pull request, or a local clone.

Only one version is active at a time: the one `ampd`, `ampctl`, and `ampsql` run. Installing or building a version
makes it active, and [`ampup use`](/clis/ampup#ampup-use) switches between the ones you've installed.

### Install directory

`ampup` keeps everything in one directory, `~/.amp` by default:

```
~/.amp/
├── bin/
│   ├── ampup        # ampup itself
│   ├── ampd         # Links to the active version's binaries
│   ├── ampctl
│   └── ampsql
├── versions/
│   ├── v0.0.42/
│   │   ├── ampd
│   │   ├── ampctl
│   │   ├── ampsql
│   │   └── amp-adbc-driver-postgresql.dylib   # An ADBC driver, when you install one
│   └── v0.0.41/
│       ├── ampd
│       ├── ampctl
│       └── ampsql
└── .version         # The active version
```

Each command looks for it in this order: its `--install-dir` flag, the `AMP_DIR` environment variable,
`$XDG_CONFIG_HOME/.amp` if you set `XDG_CONFIG_HOME`, then `~/.amp`. If you installed somewhere else, set `AMP_DIR` in
your shell profile, so every command finds it:

```bash
export AMP_DIR="$HOME/tools/amp"
```

## Commands

```
ampup [COMMAND]
```

Run `ampup` with no command to install the latest release, like [`ampup update`](/clis/ampup#ampup-update). Every command takes
`-h` (`--help`), and `ampup` takes `-V` (`--version`).

### `ampup install`

Downloads a version's binaries and makes it the active version.

```
ampup install [OPTIONS] [VERSION]
```

| Argument / flag                 | Type                  | Default                        | Description                                                                                |
| ------------------------------- | --------------------- | ------------------------------ | ------------------------------------------------------------------------------------------ |
| `VERSION`                       | string                | the latest release             | The version's tag, like `v0.0.41` or `nightly-cd41e82`.                                    |
| `--install-dir <INSTALL_DIR>`   | path                  | [`~/.amp`](/clis/ampup#install-directory) | The install directory. Also set by `AMP_DIR`.                                              |
| `--repo <REPO>`                 | string, `owner/repo`  | `edgeandnode/amp`              | The GitHub repository to download releases from, like `--repo your-org/amp-fork`.          |
| `--github-token <GITHUB_TOKEN>` | string                | `$GITHUB_TOKEN`                | A GitHub token, for [private repositories and higher rate limits](/clis/ampup#github-authentication). |
| `--arch <ARCH>`                 | `x86_64` or `aarch64` | this machine's                 | Downloads the binaries for another architecture, like `--arch x86_64`.                     |
| `--platform <PLATFORM>`         | `linux` or `darwin`   | this machine's                 | Downloads the binaries for another operating system, like `--platform linux`.              |
| `-j`, `--jobs <JOBS>`           | integer               | `4`                            | How many binaries to download at once, like `-j 2`.                                        |

```bash
ampup install v0.0.41
```

If the tag doesn't exist, it fails and installs nothing.

### `ampup list`

Lists the installed versions, marking the active one.

```
ampup list [OPTIONS]
```

| Flag                          | Type | Default                        | Description                                   |
| ----------------------------- | ---- | ------------------------------ | --------------------------------------------- |
| `--install-dir <INSTALL_DIR>` | path | [`~/.amp`](/clis/ampup#install-directory) | The install directory. Also set by `AMP_DIR`. |

:::terminal
```bash
ampup list
```

```
→ Installed versions:
    v0.0.41
  * v0.0.42 (current)
```
:::

With nothing installed, it prints `→ No versions installed`.

### `ampup use`

Makes an installed version the active one.

```
ampup use [OPTIONS] [VERSION]
```

| Argument / flag               | Type   | Default                        | Description                                                                             |
| ----------------------------- | ------ | ------------------------------ | --------------------------------------------------------------------------------------- |
| `VERSION`                     | string | none                           | The installed version to switch to, like `v0.0.42`. Without it, `ampup` asks which one. |
| `--install-dir <INSTALL_DIR>` | path   | [`~/.amp`](/clis/ampup#install-directory) | The install directory. Also set by `AMP_DIR`.                                           |

```bash
ampup use v0.0.41
```

Without `VERSION`, `ampup use` lists the installed versions to pick from with the arrow keys, which needs an interactive
terminal. In a script, it fails with `✗ Failed to get user selection`, so pass the version.

To use a version you haven't installed, install it with [`ampup install`](/clis/ampup#ampup-install). `ampup use` fails otherwise.

### `ampup uninstall`

Deletes an installed version, with its ADBC drivers.

```
ampup uninstall [OPTIONS] VERSION
```

| Argument / flag               | Type   | Default                        | Description                                      |
| ----------------------------- | ------ | ------------------------------ | ------------------------------------------------ |
| `VERSION`                     | string | required                       | The installed version to delete, like `v0.0.41`. |
| `--install-dir <INSTALL_DIR>` | path   | [`~/.amp`](/clis/ampup#install-directory) | The install directory. Also set by `AMP_DIR`.    |

```bash
ampup uninstall v0.0.41
```

You can uninstall the active version. `ampd`, `ampctl`, and `ampsql` then stop working until you switch to another
one.

### `ampup update`

Installs the latest release, if you don't have it, and makes it the active version.

```
ampup update [OPTIONS]
```

It takes the same flags as [`ampup install`](/clis/ampup#ampup-install), except `VERSION`.

```bash
ampup update
```

`ampup update` keeps the versions you had. To delete them, run [`ampup uninstall`](/clis/ampup#ampup-uninstall).

### `ampup build`

Builds a version from Amp's source code with Cargo, installs it, and makes it the active version. Use it to try a
branch or a pull request before it's released, or to run your own changes.

```
ampup build [OPTIONS]
```

You need [Rust's toolchain](https://rustup.rs) and Git. Amp's repository pins the Rust version it builds with, which
`rustup` installs on the first build. A first build compiles every dependency, so it takes a while; later builds of the
same clone are faster.

`ampup build` builds `ampd`, then `ampctl` and `ampsql`. If one of those two doesn't build, it skips it with a warning
(`⚠ Skipping ampctl: build did not produce a binary`) and installs the rest.

| Flag                          | Type                 | Default                           | Description                                                                                                  |
| ----------------------------- | -------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `-p`, `--path <PATH>`         | path                 | none                              | Builds a local clone instead of cloning from GitHub, like `--path ~/src/amp`.                                |
| `-r`, `--repo <REPO>`         | string, `owner/repo` | `edgeandnode/amp`                 | The GitHub repository to clone, like `--repo your-org/amp-fork`.                                             |
| `-b`, `--branch <BRANCH>`     | string               | the main branch                   | The branch to build, like `--branch my-feature`.                                                             |
| `-C`, `--commit <COMMIT>`     | string               | none                              | The commit to build, like `--commit f27102fd`.                                                               |
| `-P`, `--pr <PR>`             | integer              | none                              | The pull request to build, like `--pr 3183`.                                                                 |
| `-n`, `--name <NAME>`         | string               | [from the source](/clis/ampup#version-names) | The version's name, like `--name my-build`. Required to build a local directory that isn't a Git repository. |
| `-j`, `--jobs <JOBS>`         | integer              | Cargo's default, one per CPU      | How many CPU cores Cargo uses, like `-j 4`.                                                                  |
| `--install-dir <INSTALL_DIR>` | path                 | [`~/.amp`](/clis/ampup#install-directory)    | The install directory. Also set by `AMP_DIR`.                                                                |

Pick one source: `--path`, `--branch`, `--commit`, or `--pr`. Without any, `ampup build` builds the main branch.
`--repo` works with all of them except `--path`.

```bash
ampup build --pr 3183
```

#### Version names

`ampup build` names the version after its source and the first 8 characters of the commit it built, unless you pass
`--name`:

| Source                   | Version name                 |
| ------------------------ | ---------------------------- |
| the main branch          | `main-f27102fd`              |
| `--branch my-feature`    | `branch-my-feature-f27102fd` |
| `--commit f27102fd5960…` | `commit-f27102fd`            |
| `--pr 3183`              | `pr-3183-f27102fd`           |
| `--path ~/src/amp`       | `local-f27102fd`             |

With `--repo`, the name starts with the repository, its `/` replaced by `-`: `your-org-amp-fork-main-f27102fd`.

Building the same name again replaces that version. Switch between builds and releases with [`ampup use`](/clis/ampup#ampup-use).

### `ampup adbc`

Manages ADBC drivers, the optional libraries `ampd` loads to write data into other databases. A [job that exports a
dataset](/clis/ampctl/job#ampctl-job-create-adbc) into PostgreSQL needs the `postgresql` driver. Drivers belong to one
Amp version, so install one for each version you use.

#### `ampup adbc install`

Downloads a driver from the version's release, checks it against the release's checksum, and saves it in the version's
directory.

```
ampup adbc install [OPTIONS] DRIVER
```

| Argument / flag                 | Type                  | Default                        | Description                                                                                |
| ------------------------------- | --------------------- | ------------------------------ | ------------------------------------------------------------------------------------------ |
| `DRIVER`                        | `postgresql`          | required                       | The driver to install.                                                                     |
| `--version <VERSION>`           | string                | the active version             | The installed version to add the driver to, like `--version v0.0.41`.                      |
| `--install-dir <INSTALL_DIR>`   | path                  | [`~/.amp`](/clis/ampup#install-directory) | The install directory. Also set by `AMP_DIR`.                                              |
| `--repo <REPO>`                 | string, `owner/repo`  | `edgeandnode/amp`              | The GitHub repository to download the driver from.                                         |
| `--github-token <GITHUB_TOKEN>` | string                | `$GITHUB_TOKEN`                | A GitHub token, for [private repositories and higher rate limits](/clis/ampup#github-authentication). |
| `--arch <ARCH>`                 | `x86_64` or `aarch64` | this machine's                 | Downloads the driver for another architecture.                                             |
| `--platform <PLATFORM>`         | `linux` or `darwin`   | this machine's                 | Downloads the driver for another operating system.                                         |

```bash
ampup adbc install postgresql
```

Any other driver name fails: ``✗ unknown ADBC driver `mysql` (supported: postgresql)``.

Drivers come from the release with the version's name, so a version you built with [`ampup build`](/clis/ampup#ampup-build) can't
get one this way. Install the driver for a release or nightly build instead, then start `ampd` with
`AMP_ADBC_DRIVERS_DIR` set to that version's directory, like `~/.amp/versions/v0.0.42`.

#### `ampup adbc list`

Lists a version's installed drivers.

```
ampup adbc list [OPTIONS]
```

| Flag                          | Type   | Default                        | Description                                              |
| ----------------------------- | ------ | ------------------------------ | -------------------------------------------------------- |
| `--version <VERSION>`         | string | the active version             | The installed version to list, like `--version v0.0.41`. |
| `--install-dir <INSTALL_DIR>` | path   | [`~/.amp`](/clis/ampup#install-directory) | The install directory. Also set by `AMP_DIR`.            |

:::terminal
```bash
ampup adbc list
```

```
→ Installed ADBC drivers for amp v0.0.42:
    postgresql
```
:::

With none installed, it prints `→ No ADBC drivers installed for amp v0.0.42`.

#### `ampup adbc uninstall`

Deletes a driver from a version.

```
ampup adbc uninstall [OPTIONS] DRIVER
```

| Argument / flag               | Type         | Default                        | Description                                   |
| ----------------------------- | ------------ | ------------------------------ | --------------------------------------------- |
| `DRIVER`                      | `postgresql` | required                       | The driver to delete.                         |
| `--version <VERSION>`         | string       | the active version             | The installed version to delete it from.      |
| `--install-dir <INSTALL_DIR>` | path         | [`~/.amp`](/clis/ampup#install-directory) | The install directory. Also set by `AMP_DIR`. |

```bash
ampup adbc uninstall postgresql
```

If the version doesn't have it, it fails with `✗ the postgresql driver is not installed for amp v0.0.42`.

### `ampup self update`

Updates `ampup` itself to its latest release. It doesn't change your Amp versions.

```
ampup self update [OPTIONS]
```

| Flag                            | Type                 | Default             | Description                                                                                |
| ------------------------------- | -------------------- | ------------------- | ------------------------------------------------------------------------------------------ |
| `--repo <REPO>`                 | string, `owner/repo` | `edgeandnode/ampup` | The GitHub repository to download `ampup` from.                                            |
| `--github-token <GITHUB_TOKEN>` | string               | `$GITHUB_TOKEN`     | A GitHub token, for [private repositories and higher rate limits](/clis/ampup#github-authentication). |

```bash
ampup self update
```

### `ampup self version`

Prints `ampup`'s version, like `ampup --version`.

:::terminal
```bash
ampup self version
```

```
ampup v0.1.3
```
:::

## GitHub authentication

`ampup` downloads from GitHub, which limits how many requests it accepts without signing in. If you hit the limit, or
download from a private repository with `--repo`, give `ampup` a GitHub token. It uses the first of:

1. The `--github-token` flag, or the `GITHUB_TOKEN` environment variable.
2. The token of the [GitHub CLI](https://cli.github.com), from `gh auth token`, if you've signed in with it.
3. No token.

```bash
export GITHUB_TOKEN=$(gh auth token)
```

Prefer the environment variable to the flag: other users of the machine can read a command's flags in its process list.

## Environment variables

| Variable          | Description                                                                     |
| ----------------- | ------------------------------------------------------------------------------- |
| `AMP_DIR`         | The [install directory](/clis/ampup#install-directory), like `--install-dir`.              |
| `XDG_CONFIG_HOME` | When set and `AMP_DIR` isn't, the install directory is `$XDG_CONFIG_HOME/.amp`. |
| `GITHUB_TOKEN`    | A [GitHub token](/clis/ampup#github-authentication), like `--github-token`.                |

## Uninstall ampup

`ampup` has no command to remove itself. Delete its install directory, then remove the line that adds its `bin` to your
`PATH` from your shell profile:

```bash
rm -rf ~/.amp
```
