CLI Last verified:

Install the Viaalink CLI

Install the via command-line tool on Linux, macOS, Windows or Android, connect it to your Viaalink Relay and publish a local port.

Install on Linux and macOS

Install the Viaalink CLI (via) with one command:

bash

The installer puts the via command in ~/.local/bin (set INSTALL_DIR to choose another folder). If that folder is not on your PATH yet, add it, open a new terminal, then verify the installation:

bash

Install on Windows

Install the Viaalink CLI for Windows (x64) from PowerShell:

powershell

The installer downloads the Windows build into a folder in your user profile and adds it to your user PATH automatically; set VIA_NO_MODIFY_PATH=1 to opt out. Open a new PowerShell window so the change takes effect, then verify the installation:

powershell

Install on Android with Termux

On an Android phone or tablet with an ARM64 processor, the CLI runs inside Termux.

  1. Install Termux from F-Droid. The Google Play version can be outdated.

  2. Update the Termux packages and install curl:

    bash
  3. Run the installer:

    bash

    The installer detects Termux, installs the packages the CLI needs with pkg, and downloads the Termux build.

  4. Verify the installation:

    bash

Android may stop Termux when it runs in the background for a long time; a published address stays up only while Termux keeps running.

Manual download

The one-liner is the recommended way; download the archive directly if you cannot run a script. Checksums are linked below to verify your download.

Connect to your Relay

Publishing with the Viaalink CLI follows this order: via relay add '<invite link>', then via expose 3000. Signing in to your viaalink.com account with via login is a separate step (to view your account and licenses with via whoami — see Sign in to your Viaalink account), not required to publish.

Before you publish, register this device with your Viaalink Relay. Ask the Relay’s operator for an invite link, then run:

bash

via creates a device key, registers it with the Relay and makes that Relay your default. The full set of via relay commands is on Connect to a Relay. To sign in to your viaalink.com account with via login, see Sign in to your Viaalink account.

Publish a local port

Once via is installed and connected, publish a local HTTP port (for example port 3000) to a public HTTPS address on your Viaalink Relay:

bash

via expose publishes a local port on your Relay, with a login in front. It uses your default Relay; --server <relay-name> picks another one you added. It runs in the background; add --foreground to keep it in the terminal until you press Ctrl+C. A bare via expose 3000 is named service-3000 (also the interactive default). Always use the URL it prints rather than expecting an exact hostname.

For more options, including custom subdomains, TCP database ports, multi-port forwarding, and background sessions, see Publishing Services with the Viaalink CLI.

Discover commands and project setup

Run via help to list the commands:

bash

via help shows the main commands, grouped by task: Get started, Relays, Publish, Tools in the browser and Check and update. via help --all lists every command:

bash

For one command and its options, add --help, for example via expose --help.

In a project folder, run via init to set up the current folder (the folder you are in) as a project, with your project file:

bash

--yes (or -y) answers yes to every question.

Options a command does not take

A command refuses an option it does not take: via names the option, suggests the closest one it knows (Did you mean --json?) and exits with status 1. Earlier versions ignored such options, so a script that passed extra flags can now stop at that line; check the command’s options with via <command> --help and remove the ones it does not list.

Update the CLI

bash

Without options, via update shows a picker. Scripts pass --channel <stable|nightly> or --version <v> instead; via update check only says whether an update is available.

Updating from 3.x to 4.0

Viaalink CLI 4.0 is a major release. From 3.x, update by running the installer again (the commands at the top of this page): it replaces the CLI, its module files, the relay client and the helpers. The via update of 3.x replaces only the program itself; from 4.0 on, via update also replaces the module files. Then check these before you rely on it in a project, a script or a pipeline:

  • Project state now lives in .via/. A project set up with 3.x keeps using its old state folder while services that 3.x started still run from it, and the CLI names them. To move: via down, then via env init (it shows the old and the new location), then delete the old folder.
  • The devinci command is gone. Use via ci install; see Viaalink CI/CD.
  • Run via net apply once in each project. It puts the login back in front of services published with an earlier version, and makes old local addresses redirect: the default local host is now via.localhost.
  • Caddy listens on this machine only. To reach a project from other devices on your network, set network.caddy.lan_access: true in via.yaml. If you run your own Viaalink Relay that serves HTTPS through Caddy, update the Relay to 1.40.5 or later, or set that option in its config first.
  • via auth export no longer prints the private key. Add --with-key, as in eval $(via auth export --with-key).
  • ${{ macro.exposedOriginWithAuth() }} is removed, because it wrote a login into a URL in .env. Use ${{ macro.exposedOrigin() }} and pass the login separately.
  • The GitHub terminal workflow has new secret names (VIA_TUNNEL_KEY, VIA_TUNNEL_KEY_ID, VIA_TUNNEL_HOST, VIA_TUNNEL_HOST_KEY_FINGERPRINTS, VIA_TERMINAL_PASSWORD, and the optional VIA_TUNNEL_PORT); the old secrets are no longer read. Run via gh setup again in each repository that uses it and commit the workflow it writes. See Viaalink CI/CD.
  • A via.yaml service is published only when its app answers. via net apply --tunnel leaves a service unpublished when nothing listens on its port (not published — app down). Start the app first.
  • A public address can change once. A name with _ or . in it, or longer than 48 characters, moves to a cleaned host on the next via net apply, and the move is reported.
  • The login in front of a public: true service in via.yaml now follows your preferences.expose_auth choice, as via expose already did: via config set preferences.expose_auth always|sensitive-only|never.
  • If you published the studio (via terminal tunnel or via hub up), replace its login once: run via expose auth --rotate in your personal project. The release notes of 4.0.0 give the exact folder under “Security”.
  • Scripts get stricter answers. via net apply and via down exit with status 1 when they report an error, and more commands refuse an option they do not know.

The full list is in the release notes of 4.0.0 and 4.0.1.

4.1 adds via gh code (VS Code on the runner, in place of via gh terminal --interface codeserver) and via gh logs, and stores the Relay’s address (VIA_TUNNEL_HOST, VIA_TUNNEL_PORT) as repository variables instead of secrets, so a run’s log can show the session’s address. Run via gh setup again in each repository that uses the terminal workflow. The rest is in the 4.1.0 release notes. 4.1.1 is a security update (zod 4): 4.1.1 release notes.

Security

  • The web terminal (via terminal) and the network inspector (via inspect) listen on this machine only (127.0.0.1). To open the terminal from elsewhere, use via terminal tunnel, which starts it with a public tunnel through your Relay.
  • The network inspector’s password no longer shows in the process list.
  • via no longer runs scripts that a bunfig.toml in the current folder points to, so running via inside a folder you downloaded does not start code from that folder.