Quick Start
Installation
Requires Node.js 18 or later. Choose either method below — first-time setup takes about 2 minutes.
Run without installing (quick trial)
$ npx shennian
Install globally, then run directly (recommended for auto-start)
$ npm install -g shennian
$ shennian
Pairing Devices
Pairing is a one-time step. Once paired, the connection persists automatically. The whole process takes under 30 seconds.
1
Run the CLI on the target machine
Prefer npm install -g shennian, then run shennian. The CLI registers with the relay server and prints a QR code and pairing token; use npx shennian for one-off trials.
2
Open the Shennian app
On your phone, open Shennian, go to "Settings" and tap "Scan", or go to "My Machines" and tap "Add Machine".
3
Scan or paste the token
Scan the QR code shown in the terminal, or choose "Paste Token" and enter the sn-... code.
4
Done
The machine appears in your app as "Online". Next time the CLI starts, it reconnects automatically — no re-pairing needed.
Tip: If the token expires or the machine is reset, tap "Re-pair" in the machine detail screen to generate a new one.
Send Your First Message
Once a machine is paired and online, select it in the app, launch an Agent, and start chatting.
1
Select a machine
Switch to the Machines tab at the bottom of the app, then tap any machine marked as "Online".
2
Choose an Agent
Pick an Agent from the list (Claude, Codex, Gemini, Cursor, OpenClaw, or Nian) and set the working directory for the session.
3
Launch the Agent
Tap "Launch" and wait for the Agent to become ready (usually 3–5 seconds).
4
Send a message
Type your message and tap Send. The Agent's response streams back to the conversation in real time.
Tap the 📎 icon in the input bar to attach local files as context.
CLI Reference
All options can be set via CLI flags or environment variables. CLI flags take precedence.
Flags
--name <n>
Machine display name (default: hostname)
--relay <url>
Relay server URL (default: wss://relay.shennian.ai)
--token <t>
Use an existing pairing token, skip QR flow
--port <p>
Local port for the agent bridge (default: random)
--version
Print version and exit
Environment Variables
SHENNIAN_NAME
Same as --name
SHENNIAN_RELAY
Same as --relay
SHENNIAN_TOKEN
Same as --token
Custom Agent Integration
Shennian communicates with Agent processes via a lightweight Wire protocol. Any process that speaks stdio or WebSocket can be integrated with zero changes to existing Agent code.
Integration Modes
stdio mode (recommended): The CLI spawns the Agent as a child process and exchanges messages over stdin/stdout. Compatible with all existing Agent CLIs.
WebSocket mode: The Agent connects to a local WebSocket exposed by the CLI. Ideal for long-running daemon processes.
Full protocol spec, message format, and example integrations on GitHub:
GitHub Source
FAQ
Do I need to open any firewall ports?
+
Does my code and conversation pass through your servers?
+
Can I self-host the relay server?
+
Which Agents are supported?
+
Changelog
v0.1.0
2026-03-24
初始发布 · 支持 Claude / Codex / Nian,内置文件系统,HTTPS 全程加密。