routstrd
v0.3.1
Published
Routstr daemon - A CLI tool for managing routstr processes, similar to `cocod` (a Cashu wallet daemon).
Readme
routstrd
Routstr daemon - A CLI tool for managing routstr processes, similar to cocod (a Cashu wallet daemon).
Overview
routstrd is a Bun-based CLI tool that provides a background daemon for the Routstr protocol. It integrates with cocod for wallet management and uses the Routstr SDK to handle provider routing and model discovery.
Features
- Daemon Mode: Run routstrd as a background HTTP server
- Wallet Integration: Works with cocod for Cashu token management
- Provider Routing: Automatically discovers and routes requests to available providers
- Config Management: Stores configuration in
~/.routstrd/
Requirements
- Bun runtime
curl -fsSL https://bun.com/install | bashInstallation
Step 1: Install
Global with bun:
bun i -g routstrdOR - From source:
git clone https://github.com/routstr/routstrd.git
cd routstrd
bun install
bun linkStep 2: Setup & Fund
routstrd onboard
routstrd receive <cashu> # receive a Cashu token
routstrd receive 2100 # to top up 2100 sats with lightningStep 3: Integrate with Claude Code
routstrd clients add --claude-code # or --pi-agent / --opencodeUse Routstrd Skill
Tip: You can also install the routstrd skill so the agent can manage routstrd for you.
More Commands
Start Daemon
Start the background daemon:
routstrd startWith custom port:
routstrd start --port 9000With specific provider:
routstrd start --provider https://your-provider.comCLI Commands
Check daemon status:
routstrd statusGet wallet balance:
routstrd balanceTest connection:
routstrd pingStop the daemon:
routstrd stopDaemon API
The daemon exposes an HTTP server (default port 8008) with the following endpoints:
Health Check
GET /healthRoute Request
POST /Request body:
{
"model": "model-id",
"messages": [...],
"stream": false
}Response:
{
"choices": [...],
"usage": {...}
}Configuration
Configuration is stored in ~/.routstrd/config.json:
{
"port": 8008,
"provider": null,
"cocodPath": null
}Environment Variables
ROUTSTRD_DIR- Config directory (default:~/.routstrd)ROUTSTRD_SOCKET- Socket path (default:~/.routstrd/routstrd.sock)ROUTSTRD_PID- PID file path (default:~/.routstrd/routstrd.pid)
Development
Install dependencies:
bun installRun CLI:
bun run startRun daemon:
bun run startTypecheck:
bun run lintProject Structure
routstrd/
├── src/
│ ├── index.ts # Entry point with shebang
│ ├── cli.ts # Commander CLI commands
│ ├── cli-shared.ts # IPC utilities
│ ├── daemon.ts # HTTP server daemon
│ └── utils/
│ └── config.ts # Path configuration
├── package.json
└── tsconfig.jsonLicense
MIT
