CLI Tool
Manage Stockyard from the terminal with the sy command.
Installation
Install with Go:
go install github.com/stockyard-dev/stockyard/cmd/sy@latest
Or build from source:
git clone https://github.com/stockyard-dev/stockyard
cd stockyard
make cli
# Binary at dist/sy
Configuration
Set your Stockyard server URL and admin key via environment variables:
export STOCKYARD_URL=https://your-instance.com
export STOCKYARD_ADMIN_KEY=your-admin-key
Or create ~/.stockyard/config.json:
{
"url": "https://your-instance.com",
"admin_key": "your-admin-key"
}
Commands
| Command | Description |
|---|---|
| sy status | System status, uptime, running apps |
| sy costs [today|week|month] | Cost breakdown by provider and model |
| sy modules list | List all proxy modules with enabled status |
| sy modules enable <name> | Enable a middleware module |
| sy modules disable <name> | Disable a middleware module |
| sy traces [--limit N] [--model X] | List recent traces |
| sy traces --follow | Follow traces in real-time via SSE |
| sy providers health | Provider health status grid |
| sy config export | Export full config to stdout |
| sy config import <file> | Import config from JSON file |
| sy version | CLI and server version |
Examples
# Check system status
$ sy status
Stockyard — healthy
Uptime: 3d 5h 42m
Version: v1.0.0
Requests: 15.4K
APP DESCRIPTION API
proxy Middleware & providers /api/proxy
observe Traces & costs /api/observe
trust Policies & audit /api/trust
# Follow traces in real-time
$ sy traces --follow
Following traces (Ctrl+C to stop)...
[14:23:01] gpt-4o tokens=1523 cost=$0.0152 latency=432ms
[14:23:03] claude-sonnet-4-20250514 tokens=892 cost=$0.0089 latency=1205ms
# Toggle a module
$ sy modules disable cache
Module "cache" disabled.
# Export config for backup
$ sy config export > backup.json