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

# Install

> Install the free bqto or bqto Pro on macOS or Linux with the install script or Homebrew, then update it, turn on shell completion or remove it.

## Requirements

* macOS or Linux, on amd64 or arm64.
* The [Google Cloud CLI](https://cloud.google.com/sdk/docs/install) on `PATH`, version 550.0.0 or
  later.
* An SSH client (`ssh`) on `PATH`.
* A network that allows outbound HTTPS with WebSockets to `tunnel.cloudproxy.app`.

Slim Linux images also need `openssh-client` and `ca-certificates`.

Your Google Cloud project also needs some APIs, a firewall rule, and IAM roles.
[First connection](https://docs.bqto.dev/quickstart.md) lists them.

## Install the free bqto

> [tab] Install script
>
> ```sh theme={null}
> curl -fsSL https://raw.githubusercontent.com/pilef-co/bqto/main/install.sh | sh
> ```
>
> The script downloads the newest release for your machine. It checks the SHA-256 of the
> archive against the `checksums.txt` of the release, and puts `bqto` in `/usr/local/bin`.
>
> * To install one release, set `BQTO_VERSION`, for example `BQTO_VERSION=v0.16.0`.
> * To install into another folder, set `BQTO_INSTALL_DIR`, for example
>   `BQTO_INSTALL_DIR=~/.local/bin`.
> * If GitHub limits the requests from your address, give the script a token:
>   `curl … | GITHUB_TOKEN=$(gh auth token) sh`.

> [tab] Homebrew
>
> ```sh theme={null}
> brew install pilef-co/tap/bqto
> ```

> [tab] By hand
>
> Download the archive for your machine from the release page, check it, and put `bqto` on your
> `PATH`:
>
> ```sh theme={null}
> gh release download --repo pilef-co/bqto --pattern 'bqto_*_darwin_arm64.tar.gz' --pattern checksums.txt
> shasum -a 256 --ignore-missing -c checksums.txt
> tar -xzf bqto_*_darwin_arm64.tar.gz bqto && sudo mv bqto /usr/local/bin/
> ```
>
> On an Intel Mac, use `darwin_amd64`. On Linux, use `linux_amd64` or `linux_arm64`.

> [tab] From source
>
> With Go 1.26 or later:
>
> ```sh theme={null}
> go install github.com/pilef-co/bqto/cmd/bqto@latest
> ```
>
> Or, from a checkout of [pilef-co/bqto](https://github.com/pilef-co/bqto):
>
> ```sh theme={null}
> go build -o bqto ./cmd/bqto
> ./bqto version
> ```

## Install bqto Pro

> [!NOTE]
>
> bqto Pro turns on its Pro features only with a license key.
> [Start a free trial or buy a seat](https://bqto.dev/#pro) to get one. Without a valid key, bqto Pro works as the free bqto.

bqto Pro is published in the public repository
[pilef-co/bqto-pro-releases](https://github.com/pilef-co/bqto-pro-releases). It has one archive for
each system and a `checksums.txt` with their SHA-256.

> [tab] Install script
>
> ```sh theme={null}
> curl -fsSL https://raw.githubusercontent.com/pilef-co/bqto-pro-releases/main/install.sh | sh
> ```
>
> The script installs `bqto` in `/usr/local/bin`. If that folder needs your password, the script
> asks for it. To use another folder, set `BQTO_INSTALL_DIR`. The script replaces a free bqto
> that is already in that folder. If another `bqto` comes first on your `PATH`, the script tells
> you.

> [tab] Homebrew
>
> ```sh theme={null}
> brew install --cask pilef-co/tap/bqto-pro
> ```

Then activate your key:

```sh theme={null}
bqto license activate YOUR-KEY
```

[License key](https://docs.bqto.dev/pro/license-key.md) explains the key, its 2 computers, and CI.

The Mac app has its own install. [Mac app](https://docs.bqto.dev/guides/mac-app.md) shows it.

### If you already have the free bqto

bqto Pro does everything the free bqto does, and both are called `bqto`. So you can replace the
free one.

1. If the free bqto came from Homebrew, remove it first. The two casks conflict.

   ```sh theme={null}
   brew uninstall --cask bqto
   ```

2. To see which `bqto` runs, run:

   ```sh theme={null}
   command -v bqto
   ```

   If another `bqto` comes first on your `PATH`, delete it or change the order of your `PATH`. A
   free bqto from `go install` is in `$(go env GOPATH)/bin`.

3. Open a new terminal, or run `hash -r`.

4. To check that it is bqto Pro, run `bqto version`. bqto Pro prints `bqto Pro` and its release:

   ```text theme={null}
   bqto Pro vX.Y.Z
   ```

   The free bqto prints only `bqto` and its release, such as `bqto v0.10.0`.

## Update

`bqto version` prints the version and asks GitHub for the newest release. If a newer release
exists, it says so on stderr:

```text theme={null}
bqto v0.16.0
bqto 0.16.1 is available (you have 0.16.0).
Fix: bqto update
```

In the free bqto, if the release fixes a security issue, the second line is
`bqto 0.16.1 fixes a security issue in your version.` No other command looks for updates, and
nothing runs in the background.

`bqto update` installs the newest release. It updates bqto only when you run it. What it does
depends on how you installed bqto:

| Installed with | `bqto update` does |
| - | - |
| Homebrew, free bqto | It runs `brew upgrade bqto` |
| `go install` | It runs `go install github.com/pilef-co/bqto/cmd/bqto@latest` |
| The install script or by hand | It downloads the newest archive for your system and its `checksums.txt`, checks the SHA-256, and replaces the `bqto` binary that ran |

If the folder of the binary is not yours, such as `/usr/local/bin`, `bqto update` asks for your
password once, through `sudo`. Do not run `sudo bqto update`.

bqto Pro looks for a newer version in the releases of `pilef-co/bqto-pro-releases`. It stops
waiting after about 5 seconds. If GitHub limits requests from your address, set `GITHUB_TOKEN`. A bqto Pro from
Homebrew updates with Homebrew:

```sh theme={null}
brew upgrade --cask pilef-co/tap/bqto-pro
```

`bqto version --output json` prints `version`, `latest`, `update_available`, and `security`
(always `false` for bqto Pro). It prints no notice.

## Shell completion

`bqto completion` prints a completion script for bash (3.2 or later), zsh, or fish. With the script,
Tab completes the commands, the flags of `bqto connect`, and the values of `--service` and
`--output`.

To turn completion on, add the line for your shell to its startup file. Then open a new terminal.

> [tab] Bash
>
> ```sh theme={null}
> echo 'eval "$(bqto completion bash)"' >> ~/.bashrc
> ```
>
> On macOS, Terminal starts bash as a login shell, which reads `~/.bash_profile` instead of
> `~/.bashrc`. Put the line there.

> [tab] Zsh
>
> ```sh theme={null}
> echo 'source <(bqto completion zsh)' >> ~/.zshrc
> ```

> [tab] Fish
>
> ```sh theme={null}
> echo 'bqto completion fish | source' >> ~/.config/fish/config.fish
> ```

## Uninstall

Delete the `bqto` binary. `command -v bqto` shows where it is:

* The install script puts it in `/usr/local/bin`, or in the folder that you gave in
  `BQTO_INSTALL_DIR`.
* `go install` puts it in `$(go env GOPATH)/bin`.

With bqto Pro, run `bqto license deactivate` first, to free the computer's place on your seat. Then you can
also delete `config.toml` and `license.json` in the bqto config folder.

[Cleanup](https://docs.bqto.dev/reference/cleanup.md#what-can-stay-behind) lists the files that a session can leave behind.
You can delete them too.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.