Offline Protocol CLI (offline)
One CLI to build offline-first apps on the Offline Protocol ecosystem — and the MCP server that makes the whole ecosystem AI-native.
What's inside
| Crate | Purpose |
|---|---|
crates/offline-cli |
The offline binary: login, create, init, add, plan, doctor, update, registry, skills, mcp |
crates/offline-registry |
Knowledge core: packages, skills, workflows, templates — embedded, fully offline |
crates/offline-generator |
Tera-based project scaffolding (used by create and MCP scaffold_project) |
crates/offline-mcp |
Model Context Protocol server: plan, scaffold, and integrate Offline Protocol components |
crates/offline-registry/registry/ |
Content: packages, skills, workflows, starter templates |
Workflows & templates
| Workflow | Templates |
|---|---|
offline-social-network |
react-native-social, nextjs-social, react-vite-social |
nearby-chat |
react-native-mesh-app |
group-messaging |
react-native-mesh-app |
local-marketplace |
react-native-mesh-app |
referral-system |
nextjs-social |
Install
The installed command is always offline.
npm (recommended):
crates.io:
From source (developers):
From GitHub Releases (archives + SHA256SUMS):
- Download the archive for your platform from Offline-Protocol/CLI releases
- Verify with
SHA256SUMSor the matching.sha256file - Extract and put
offlineon yourPATH - Run
offline doctorandoffline update
Maintainer release process: docs/RELEASING.md.
Homebrew distribution is still planned.
Command reference
Quick map of top-level commands. Full descriptions, flags, and examples: docs/COMMANDS.md.
| Command | Purpose |
|---|---|
offline login / logout / whoami |
Interactive auth (localhost callback + poll); logout revokes the key server-side when possible |
offline create |
Scaffold from workflow, template, or --prompt; runs npm install and starts the dev server (Metro for React Native) unless --skip-setup |
offline plan |
Plan only (workflow + packages + optional architecture docs) |
offline init |
Wire offline.config.json, .mcp.json, AGENTS.md into an existing app |
offline add <package> |
Add package (+ transitive requires) to package.json |
offline doctor |
Toolchain + auth + API reachability checks |
offline update |
Check GitHub Releases for a newer CLI |
offline registry … |
List / search / show packages, workflows, skills, templates, capabilities; export llms.txt |
offline skills list / show |
List or read an integration skill |
offline mcp serve |
Run the MCP server (stdio) |
offline mcp install <client> |
Print client config (cursor, claude-desktop, vscode, claude-code) |
offline mcp tools |
List MCP tools |
offline completions <shell> |
Shell completions |
Every informational command supports --json. Config: ~/.offline/config.json (0600).
Overrides: OFFLINE_API_KEY, OFFLINE_API_BASE, OFFLINE_ENV (prod or dev/local),
OFFLINE_PORTAL_BASE, OFFLINE_CONFIG_DIR, OFFLINE_REGISTRY_DIR,
OFFLINE_CALLBACK_PORT (localhost login callback; default 9876).
For AI agents (MCP)
The MCP server is local stdio inside the CLI — no separate cloud deploy. Agents plan and integrate Offline Protocol components via tools (not from memory).
Set up Cursor / Claude
# Pick ONE client (do not use | — the shell treats it as a pipe):
# Claude Code shortcut:
Paste the printed JSON into the client’s MCP config. Ensure offline is on PATH,
then reload the agent / MCP session.
Ask the agent to create a project
Use Agent mode and a prompt like:
Using the offline-protocol MCP only (do not invent package names or SDK APIs):
1. Call generate_architecture with my idea.
2. Follow nextActions.
3. Call scaffold_project with name="festival-pulse" and platform="react-native".
4. Call get_skill for every skill listed before writing Offline Protocol code.
Idea: nearby festival chat with Offline ID login and BLE mesh messaging
Or use the MCP prompt plan-app with description, optional platform, and name.
Flow: generate_architecture → scaffold_project (new) or integrate_packages + init_project (existing) → get_skill → app code.
Full tool list and rules: docs/MCP.md.
Development
# live registry content (not the embedded copy):
OFFLINE_REGISTRY_DIR=./crates/offline-registry/registry
# local API gateway (typically :3010):
OFFLINE_ENV=dev
CI & releases
| Workflow | Trigger | What it does |
|---|---|---|
.github/workflows/ci.yml |
PR + push to main |
fmt, clippy, tests; release-build smoke on main |
.github/workflows/release.yml |
tag v* or manual bump |
Bumps version, updates CHANGELOG.md, builds binaries, publishes GitHub Release |
Manual release: Actions → Release → bump patch/minor/major (needs RELEASE_PAT).
Or push a tag: git tag v0.1.2 && git push origin v0.1.2 (add a CHANGELOG.md section for that version first if you skip the bump job).
Release notes on GitHub come from the matching ## [x.y.z] section in CHANGELOG.md, which git-cliff refreshes during the bump job (cliff.toml).
Documentation
- docs/COMMANDS.md — full command reference
- docs/ARCHITECTURE.md — crates, planner, MCP integrate loop
- docs/REGISTRY.md — registry schema and authoring
- docs/MCP.md — MCP tools, agent prompts, local vs hosted
- docs/AUTH.md — device-flow login / logout
- CHANGELOG.md — release history
Contributing
See CONTRIBUTING.md for setup, PR expectations, and registry guidelines. Please follow the Code of Conduct.
Security reports: SECURITY.md (do not file public issues for vulnerabilities).
License
Licensed under the Apache License, Version 2.0. See NOTICE for copyright attribution.
Status
Shipped: device-flow auth, deterministic planning, Tera scaffolds, MCP plan + scaffold + integrate,
CI, multi-platform GitHub Releases, offline update.
Not yet: hosted MCP (Streamable HTTP), hosted registry refresh, Homebrew tap, official crates.io publish (install via git or GitHub Releases until then), usage analytics.