npm package: @strideos/agent-bridge
Description: Connect your local machine to Stride's AI agent workforce dashboard. Runs Claude Code, Codex, or other CLI agents locally using your subscription.
Author: Stride Agents AI
Latest version: 0.1.2

# @strideos/agent-bridge

Connect your local machine to the Stride AI agent workforce dashboard. Run Claude Code, Codex, or other CLI agents locally using your own subscription while managing them from the Stride web dashboard.

## Quick Start

```bash
npx @strideos/agent-bridge connect --token YOUR_TOKEN
```

## Setup

### 1. Get a connection token

1. Go to your Stride dashboard at `https://app.strideagents.com`
2. Navigate to **Build > Sandboxes**
3. Under **Local Bridges**, click **New Bridge**
4. Give it a name (e.g., "Josh's MacBook")
5. Copy the connection token

### 2. Connect your machine

```bash
# Using npx (no install needed)
npx @strideos/agent-bridge connect --token YOUR_TOKEN

# Or install globally
npm install -g @strideos/agent-bridge
stride-bridge connect --token YOUR_TOKEN
```

### 3. Create an agent with Local Bridge

1. Go to **Build > Agents** and click **Create Agent**
2. Under **Sandbox**, select **Local Bridge (your machine)**
3. Pick your bridge from the dropdown
4. Create the agent

Now when the agent receives tasks from the dashboard, they'll execute on your machine using your local Claude Code CLI.

## Options

```bash
stride-bridge connect [options]

Options:
  -t, --token <token>        Bridge connection token (required)
  -s, --server <url>         Stride server URL (default: https://app.strideagents.com)
  -c, --command <cmd>        Agent CLI to use (default: claude)
  -p, --poll-interval <ms>   Poll interval in ms (default: 5000)
```

## How It Works

```
Stride Dashboard (web)
    │
    │  "Run this prompt"
    ▼
Your Machine (this bridge)
    │
    │  spawns: claude -p "prompt" --output-format json
    ▼
Claude Code CLI (your subscription)
    │
    │  result + cost
    ▼
Stride Dashboard (displays result)
```

1. The bridge connects to your Stride server and registers itself
2. It polls for pending commands assigned to agents using this bridge
3. When a command arrives, it spawns the Claude Code CLI with the prompt
4. Output streams to your terminal AND back to the dashboard
5. Results, cost, and token usage are reported to the dashboard

## Important Notes

- **Your credentials stay local.** Stride never sees your Anthropic API key or OAuth tokens.
- **Usage counts toward your subscription.** If you're on Claude Pro/Max, this uses your subscription hours.
- **The bridge must be running** for local agents to work. When you close the bridge, agents go idle until you reconnect.
- **One bridge per machine.** Each bridge represents a single machine's connection.

## Using with other agents

```bash
# Use Codex instead of Claude
stride-bridge connect --token YOUR_TOKEN --command codex

# Use a custom agent CLI
stride-bridge connect --token YOUR_TOKEN --command "my-agent"
```

## Programmatic Usage

```typescript
import { AgentBridge } from "@strideos/agent-bridge"

const bridge = new AgentBridge({
  token: "your-token",
  serverUrl: "https://app.strideagents.com",
  agentCommand: "claude",
})

const connection = await bridge.connect()
console.log("Connected:", connection.name)

// Bridge runs until disconnected
process.on("SIGINT", () => bridge.disconnect())
```