Reference
CLI
The shain command. A small Rust binary for local operators — initialize, open and close sessions, inspect config, verify manifest parity.
Build
git clone https://github.com/shain-labs/shain-engine
cd shain-engine
cargo build --release -p shain-cli
./target/release/shain --helpThe binary is named shain (the crate is shain-cli). Drop it on your PATH to call it from anywhere.
Subcommands
| Command | Purpose |
|---|---|
shain init | Seed the config + treasury ATA (authority only) |
shain session open | Open a 24h session for the configured wallet |
shain session close | Close an expired session, refund rent |
shain session status | Print current session state (JSON or human) |
shain config show | Dump the decoded ShainConfig PDA |
shain config runtime | Print the CLI's own runtime config |
shain pdas | Compute and print PDAs for the program id + holder |
shain verify | Cross-verify site / API / .well-known program ids |
Environment
| Variable | Default | Purpose |
|---|---|---|
SHAIN_RPC_URL | https://api.devnet.solana.com | RPC endpoint |
SHAIN_KEYPAIR_PATH | ~/.config/solana/id.json | Signer |
SHAIN_NETWORK | devnet | localnet / devnet / mainnet |
SHAIN_PROGRAM_ID | baked-in devnet id | Override if rotating |
SHAIN_LOG_LEVEL | info | error/warn/info/debug/trace |
Global flags
Every subcommand accepts the same set of global flags. They override the env values:
--rpc <URL> # override SHAIN_RPC_URL
--network <CLUSTER> # localnet | devnet | mainnet
--keypair <PATH> # override SHAIN_KEYPAIR_PATH
--program-id <BASE58> # override SHAIN_PROGRAM_ID
--log-level <LEVEL> # error | warn | info | debug | traceManifest parity
shain verify --json prints the four surfaces a bot/user must cross-check before trusting a program id:
shain verify --site https://shain.fun --json
# run these commands and confirm each returns the same program id:
# curl -fsSL https://shain.fun/.well-known/shain.json | jq -r .program_id
# curl -fsSL https://shain.fun/api/health | jq -r .program
# grep -E "2T1Qs7f2hiy1sUQBWC7226xhXvCees97UfeqReRrnE66" README.md
# CLI program id: 2T1Qs7f2hiy1sUQBWC7226xhXvCees97UfeqReRrnE66