Installation
AI Agents that live natively in your product. This page installs the pieces:
the distri CLI, a login to Distri Cloud, and the npm
packages your app uses to talk to an agent.
1. Install the CLI
curl -fsSL https://distri.dev/install.sh | sh
distri --version
What the script does:
- Prebuilt binaries for macOS (
Darwin) and Linux, onx86_64/amd64andarm64/aarch64. It downloadsdistri-<platform>-<arch>.tar.gzfrom the latest GitHub release of distrihub/distri and installsdistri(anddistri-serverwhen the archive has it). - Other platforms, or a failed download: it asks before building from source
with
cargo install --git https://github.com/distrihub/distri distri-cli distri-server-cli, and asks again before installing Rust through rustup ifcargois missing. - Install directory:
/usr/local/binwhen you run as root or can write to it, otherwise~/.local/bin. If that directory is not on yourPATH, the script prints theexport PATH=...line to add to your shell profile.
Flags, passed after sh -s --:
| Flag | Does |
|---|---|
-y, --yes | Non-interactive: approves the source build and the rustup install without asking |
--build-from-source | Skips the prebuilt download and builds from source |
-h, --help | Prints the usage and exits |
curl -fsSL https://distri.dev/install.sh | sh -s -- -y
Environment variables:
| Variable | Does |
|---|---|
DISTRI_VERSION | Release tag to install (default: latest) |
DISTRI_INSTALL_DIR | Directory to install into |
DISTRI_YES=1 | Same as --yes |
DISTRI_BUILD_FROM_SOURCE=1 | Same as --build-from-source |
DISTRI_REPO | GitHub repo, owner/name (default: distrihub/distri) |
2. Sign in with distri login
distri login
The CLI prints Opening browser for authentication... and opens
https://app.distri.dev/cli-login. In the browser:
- Sign in with your email and the one-time code sent to it.
- Pick a workspace, or name a new one.
- Click Authorize CLI.
Back in the terminal the CLI prints ✓ Successfully authenticated!, the profile
it saved (Profile: default), a masked API key and the workspace id.
distri login --profile <name> saves the credentials under another profile; see
the CLI reference for profiles
and the other login flags.
Without a browser (CI, scripts)
The CLI reads these environment variables:
| Variable | Meaning |
|---|---|
DISTRI_BASE_URL | API base URL (default https://api.distri.dev/v1) |
DISTRI_API_KEY | Workspace API key |
DISTRI_WORKSPACE_ID | Workspace id |
API keys are created in the dashboard; see API keys.
3. Add the npm packages to your app
The client SDK is published under the @distri scope:
| Package | For |
|---|---|
@distri/core | The API client and tool types, used by every other package |
@distri/state | The shared chat state the UI packages build on |
@distri/react | React provider, hooks and the <Chat> component |
@distri/react-native | React Native provider, hooks and a native <Chat> |
React:
npm install @distri/core @distri/react
React Native (Expo):
npm install @distri/core @distri/react-native
The Packages page lists every package, Angular included. Step-by-step guides:
Self-hosting
The install script also installs distri-server when the release archive
includes it. To run the whole stack on your own machine instead of Distri
Cloud, see Run Distri locally and
Self-hosted setup.
Next
Getting Started applies a sample agent and runs it.