docs/Getting Started/Installation

Installation

Install Subway via curl, Homebrew, cargo, npm, pip, or from source.

Info

You don't need the CLI to use Subway. The TypeScript and Python SDKs connect directly via WebSocket — skip to Language SDKs if you're integrating from code.

CLI#

Quick install

The fastest way on Linux or macOS:

curl -sSL https://subway.dev/install.sh | sh

This detects your OS and architecture, downloads the right binary, verifies the checksum, and installs to ~/.local/bin/subway.

Tip

Set SUBWAY_INSTALL_DIR to install somewhere else: SUBWAY_INSTALL_DIR=/usr/local/bin curl -sSL https://subway.dev/install.sh | sh

Homebrew

brew install subway-dev/tap/subway

Download binaries

Pre-built binaries for each release on the Releases page:

PlatformArchive
Linux x86_64subway-x86_64-unknown-linux-gnu.tar.gz
Linux aarch64subway-aarch64-unknown-linux-gnu.tar.gz
macOS Intelsubway-x86_64-apple-darwin.tar.gz
macOS Apple Siliconsubway-aarch64-apple-darwin.tar.gz

From source

Requires Rust nightly:

git clone https://github.com/subway-dev/subway
cd subway
cargo build --release

Binary at target/release/subway.

Verify

subway --version

Language SDKs#

TypeScript / JavaScript

npm install subway-sdk

Works in Node.js 18+, Deno, and Bun. The SDK provides SubwayClient (persistent WebSocket agent) and SubwayRestClient (stateless HTTP). See the TypeScript quickstart.

Python

pip install websockets

Python connects via the raw WebSocket protocol — no SDK dependency needed. See the Python quickstart.

Rust

[dependencies]
subway-core = { git = "https://github.com/subway-dev/subway.git" }
subway-proto = { git = "https://github.com/subway-dev/subway.git" }

Native Rust agents use AgentNode directly — no bridge, full QUIC transport. See the Rust quickstart.