Skip to content

Install the CLI

The viewport command sends your branch and your agent conversation to Viewport. You install it once per machine.

  • macOS or Linux, on arm64 or x86_64. Windows is not supported.
  • curl, git, and sha256sum or shasum.
Terminal window
curl -fsSL https://tryviewport.ai/install.sh | sh

The installer:

  1. Downloads the viewport binary for your platform and checks it against its published checksum.
  2. Installs it to ~/.local/bin/viewport.
  3. Runs viewport install, which adds the /viewport command and conversation capture to each coding agent it finds. See Connect your coding agent.

If ~/.local/bin is not on your PATH, the installer says so and prints the line to add. For bash and zsh it is:

Terminal window
export PATH="$HOME/.local/bin:$PATH"

Add it to your shell’s rc file (for example ~/.zshrc), then open a new terminal. Check the install with viewport --version.

Terminal window
viewport login

The terminal prints a code and a URL and opens your browser on the page Sign in the Viewport CLI. If you are not signed in to the app, it asks you to sign in first. The page shows the code, the Device (your machine’s hostname and operating system) and the Client (the CLI’s version).

The CLI pairing page, dark theme

The CLI pairing page

  1. Check that the code matches the one in your terminal.
  2. Click Authorize. Click Cancel if you did not start this sign-in.
  3. The page says the CLI is signed in, and the terminal prints logged in.

The CLI waits up to 10 minutes for you to authorize. On a machine without a browser, or over SSH, set VIEWPORT_NO_BROWSER=1 and open the printed URL on any device where you are signed in:

Terminal window
VIEWPORT_NO_BROWSER=1 viewport login

Each viewport login creates a token, stored on your machine in ~/.viewport/credentials.json. To see your tokens, open the menu under your name at the bottom left of the app and choose CLI tokens.

The account menu with CLI tokens, Documentation and Log out, dark theme

The account menu with CLI tokens, Documentation and Log out

The page lists each token by the machine’s name, with when it was created, when it was last used and whether it was revoked. Click Revoke to sign that machine out. Run viewport login on it again to sign it back in.

The CLI tokens page, dark theme

The CLI tokens page

Run the installer again. It replaces the binary and reruns viewport install.

Terminal window
viewport uninstall

This removes the /viewport skill and the capture hooks that viewport install added to your agents. It leaves the binary and your ~/.viewport folder in place; delete them yourself if you want them gone:

Terminal window
rm ~/.local/bin/viewport
rm -rf ~/.viewport

Deleting ~/.viewport removes your sign-in and the conversations recorded on this machine. To also invalidate the token on the server, revoke it on the CLI tokens page.