# aindrive

> Local agent for aindrive — connects any folder to a running aindrive web server (local or remote) via an outbound WebSocket. No inbound ports opened on your machine.

Latest version **0.2.4** (published 2026-06-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install aindrive
pnpm add aindrive
yarn add aindrive
bun add aindrive
```

## Health

**Score 45/100 (D)** — status: active.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.4 |
| Published | 2026-06-15 |
| First published | 2026-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | dev_ainetwork |
| Keywords | drive, tunnel, file-manager, self-hosted, cli |

## Links

- npm: https://www.npmjs.com/package/aindrive
- npm.io page: https://npm.io/package/aindrive

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.2.4 (latest) — 2026-06-15
- 0.2.3 — 2026-06-10
- 0.2.2 — 2026-06-08
- 0.2.1 — 2026-04-25
- 0.2.0 — 2026-04-25
- 0.1.6 — 2026-04-25
- 0.1.5 — 2026-04-25
- 0.1.3 — 2026-04-25
- 0.1.2 — 2026-04-25
- 0.1.1 — 2026-04-25
- 0.1.0 — 2026-04-25

## README

# aindrive

> Local agent for [aindrive](https://aindrive.app) — connects any folder on
> your machine to an aindrive web server through an **outbound** WebSocket.
> No inbound ports are opened. Bytes never leave your machine unless requested
> over a signed RPC.

```
npm i -g aindrive
cd ~/Documents
aindrive
# first run: opens browser → click Authorize → folder is served at
# https://aindrive.ainetwork.ai/d/<drive-id>
```

`aindrive` will sign you in on first use. If you prefer to do it explicitly,
`aindrive login` does the same thing — it opens
`https://aindrive.ainetwork.ai/cli-login/<linkId>`, polls for your approval,
and then immediately starts serving the current folder. Each pairing link is
single-use and expires in 10 minutes.

## Commands

```
aindrive [folder]          serve a folder (default: current dir; logs in on first use)
aindrive -d [folder]       serve in the BACKGROUND (returns your terminal)
aindrive login             sign in and serve the current folder
aindrive status [folder]   show drive id, server URL, and whether the agent is running
aindrive logs [folder]     follow the background agent's output (tail -f; Ctrl+C to stop)
aindrive stop [folder]     stop the background agent
aindrive rotate-token      rotate the per-drive agent token
aindrive mcp               run a Model Context Protocol stdio server
```

The agent is a long-lived process — it's the live bridge between the web app
and your files, so the drive is online only while it runs. Plain `aindrive`
stays in the foreground (Ctrl+C to stop); `aindrive -d` runs it in the
background and hands your terminal back. Background state (pid + log) lives in
the folder's `.aindrive/`, so you can background several folders independently
and reattach to any with `aindrive logs`. First-time pairing must run in the
foreground once (it needs the browser sign-in); after that `-d` works.

### MCP integration

`aindrive mcp` exposes every drive operation (list/read/write/share/grant
/ask-agent/x402-resolve) to MCP-aware AI assistants — Claude Code, Claude
Desktop, Cursor, etc. The same single npm install enables it; no extra
package needed.

```json
// claude_desktop_config.json or .mcp.json
{
  "mcpServers": {
    "aindrive": { "command": "aindrive", "args": ["mcp"] }
  }
}
```

Auth precedence:
1. `AINDRIVE_SESSION` env (raw `aindrive_session=...` cookie)
2. `AINDRIVE_WALLET_COOKIE` env (raw `aindrive_wallet=...` cookie)
3. `~/.aindrive/credentials.json` from `aindrive login`.

`AINDRIVE_CAP` env attaches a Meadowcap cap to every request; useful for
agents that paid via x402 and want to reuse the cap from another box.

## Flags

```
--server <url>   server URL (default: $AINDRIVE_SERVER or https://aindrive.ainetwork.ai)
--name <name>    name for this drive on first pairing
--no-open        do not open the browser
--version        print version
```

## How it works

`aindrive` dials out to the configured server over WSS and waits for signed RPC
calls (`list`, `read`, `write`, `mkdir`, …). Each request carries an HMAC built
from a per-drive secret negotiated at pairing time; the server cannot read or
write files without a valid signature. The server is a relay — it never touches
your disk.

State lives in two places:

- **`~/.aindrive/credentials.json`** — login session for the configured server.
- **`<folder>/.aindrive/config.json`** — per-folder drive id, secret, and agent token.
  Same directory also holds `<folder>/.aindrive/willow.db` (Y.Doc updates) and
  `<folder>/.aindrive/yjs/<docId>.bin` (latest snapshots) once the agent runs.

Pair a new folder with `aindrive` (uses your global login), or re-attach an
existing drive by running `aindrive` inside a folder that already has
`.aindrive/config.json`.

## Self-hosting

Point at your own server with `--server` or `AINDRIVE_SERVER`:

```
AINDRIVE_SERVER=https://drive.example.com aindrive login
AINDRIVE_SERVER=https://drive.example.com aindrive ~/work
```

## Requirements

- Node.js ≥ 20

## License

MIT

---
_Source: https://npm.io/package/aindrive · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
