# Installation

RailProtocol provides a CLI, a TypeScript SDK, and a Python SDK. Install whichever fits your workflow.

***

## CLI

The CLI is the primary tool for managing wallets, policies, and transactions. It is open source and distributed as an npm package and a standalone binary.

### npm (recommended)

```bash
npm install -g @railprotocol/cli
```

### Standalone binary

Download the latest release for your platform from [github.com/railprotocol/cli/releases](https://github.com/railprotocol/cli/releases).

**macOS (Apple Silicon)**

```bash
curl -fsSL https://railprotocol.org/install.sh | sh
```

**macOS (Intel)**

```bash
curl -fsSL https://railprotocol.org/install.sh | sh -s -- --arch amd64
```

**Linux**

```bash
curl -fsSL https://railprotocol.org/install.sh | sh
```

**Windows**

Download the `.exe` from the releases page and add it to your `PATH`.

### Verify

```bash
rail --version
# railprotocol/cli v1.0.0 darwin-arm64
```

***

## TypeScript SDK

```bash
npm install @railprotocol/sdk
# or
pnpm add @railprotocol/sdk
# or
yarn add @railprotocol/sdk
```

Requires Node.js 18 or later. The SDK ships with full TypeScript declarations and has no runtime dependencies beyond the Solana web3.js client.

***

## Python SDK

```bash
pip install railprotocol
# or
uv add railprotocol
```

Requires Python 3.10 or later. The package includes both sync and async clients.

***

## CI/CD environments

For non-interactive environments, set the API key as an environment variable:

```bash
export RAIL_API_KEY=rp_live_...
rail wallet balance --agent my-agent
```

The CLI reads `RAIL_API_KEY` automatically. No `rail auth login` step required.

***

## Updating

```bash
npm update -g @railprotocol/cli
```

Or re-run the install script to get the latest binary.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.railprotocol.org/getting-started/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
