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:
curl -fsSL https://raw.githubusercontent.com/viaalink/cli/main/install.sh | bashThe 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:
via --versionInstall on Windows
Install the Viaalink CLI for Windows (x64) from PowerShell:
irm https://raw.githubusercontent.com/viaalink/cli/main/install.ps1 | iexThe 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:
via --versionInstall on Android with Termux
On an Android phone or tablet with an ARM64 processor, the CLI runs inside Termux.
Install Termux from F-Droid. The Google Play version can be outdated.
Update the Termux packages and install
curl:bashpkg update && pkg upgrade -y pkg install curlRun the installer:
bashcurl -fsSL https://raw.githubusercontent.com/viaalink/cli/main/install.sh | bashThe installer detects Termux, installs the packages the CLI needs with
pkg, and downloads the Termux build.Verify the installation:
bashvia --version
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:
via relay add '<invite link>' --name officevia 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:
via expose 3000via 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:
via helpvia 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:
via help --allFor 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:
via init--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
via updateWithout 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, thenvia env init(it shows the old and the new location), then delete the old folder. - The
devincicommand is gone. Usevia ci install; see Viaalink CI/CD. - Run
via net applyonce 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 nowvia.localhost. - Caddy listens on this machine only. To reach a project from other devices on your network, set
network.caddy.lan_access: trueinvia.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 exportno longer prints the private key. Add--with-key, as ineval $(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 optionalVIA_TUNNEL_PORT); the old secrets are no longer read. Runvia gh setupagain in each repository that uses it and commit the workflow it writes. See Viaalink CI/CD. - A
via.yamlservice is published only when its app answers.via net apply --tunnelleaves 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 nextvia net apply, and the move is reported. - The login in front of a
public: trueservice invia.yamlnow follows yourpreferences.expose_authchoice, asvia exposealready did:via config set preferences.expose_auth always|sensitive-only|never. - If you published the studio (
via terminal tunnelorvia hub up), replace its login once: runvia expose auth --rotatein your personal project. The release notes of 4.0.0 give the exact folder under “Security”. - Scripts get stricter answers.
via net applyandvia downexit 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, usevia terminal tunnel, which starts it with a public tunnel through your Relay. - The network inspector’s password no longer shows in the process list.
viano longer runs scripts that abunfig.tomlin the current folder points to, so runningviainside a folder you downloaded does not start code from that folder.