ShainShain/docs
Reference

CLI

The shain command. A small Rust binary for local operators — initialize, open and close sessions, inspect config, verify manifest parity.

Build

terminalbash
git clone https://github.com/shain-labs/shain-engine
cd shain-engine
cargo build --release -p shain-cli
./target/release/shain --help

The binary is named shain (the crate is shain-cli). Drop it on your PATH to call it from anywhere.

Subcommands

CommandPurpose
shain initSeed the config + treasury ATA (authority only)
shain session openOpen a 24h session for the configured wallet
shain session closeClose an expired session, refund rent
shain session statusPrint current session state (JSON or human)
shain config showDump the decoded ShainConfig PDA
shain config runtimePrint the CLI's own runtime config
shain pdasCompute and print PDAs for the program id + holder
shain verifyCross-verify site / API / .well-known program ids

Environment

VariableDefaultPurpose
SHAIN_RPC_URLhttps://api.devnet.solana.comRPC endpoint
SHAIN_KEYPAIR_PATH~/.config/solana/id.jsonSigner
SHAIN_NETWORKdevnetlocalnet / devnet / mainnet
SHAIN_PROGRAM_IDbaked-in devnet idOverride if rotating
SHAIN_LOG_LEVELinfoerror/warn/info/debug/trace

Global flags

Every subcommand accepts the same set of global flags. They override the env values:

flagsbash
--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 | trace

Manifest parity

shain verify --json prints the four surfaces a bot/user must cross-check before trusting a program id:

verifybash
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