Skip to main content

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, on x86_64/amd64 and arm64/aarch64. It downloads distri-<platform>-<arch>.tar.gz from the latest GitHub release of distrihub/distri and installs distri (and distri-server when 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 if cargo is missing.
  • Install directory: /usr/local/bin when you run as root or can write to it, otherwise ~/.local/bin. If that directory is not on your PATH, the script prints the export PATH=... line to add to your shell profile.

Flags, passed after sh -s --:

FlagDoes
-y, --yesNon-interactive: approves the source build and the rustup install without asking
--build-from-sourceSkips the prebuilt download and builds from source
-h, --helpPrints the usage and exits
curl -fsSL https://distri.dev/install.sh | sh -s -- -y

Environment variables:

VariableDoes
DISTRI_VERSIONRelease tag to install (default: latest)
DISTRI_INSTALL_DIRDirectory to install into
DISTRI_YES=1Same as --yes
DISTRI_BUILD_FROM_SOURCE=1Same as --build-from-source
DISTRI_REPOGitHub 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:

  1. Sign in with your email and the one-time code sent to it.
  2. Pick a workspace, or name a new one.
  3. 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:

VariableMeaning
DISTRI_BASE_URLAPI base URL (default https://api.distri.dev/v1)
DISTRI_API_KEYWorkspace API key
DISTRI_WORKSPACE_IDWorkspace 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:

PackageFor
@distri/coreThe API client and tool types, used by every other package
@distri/stateThe shared chat state the UI packages build on
@distri/reactReact provider, hooks and the <Chat> component
@distri/react-nativeReact 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.