Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI

Note

Reference: draft. The commands marked “works today” run from a source build. Published alpha archives are described in installation; registry packages are not published.

$ shiin <command>

Commands

CommandWhat it doesStatus
shiin initWrites a starter policy to .shiin/policy.toml, refusing to overwrite oneworks today
shiin policy validate [path]Parses and compiles a policy, reporting rule and signal counts or a diagnosticworks today
shiin check <request.json>Decides one action request and prints the decision and reason codeworks today
shiin explain <request.json>Decides, and also prints the stage that decided and the rules that matchedworks today
shiin hook claude-codeServes one Claude Code PreToolUse hook call, reading the payload on standard inputworks today
shiin log [count]Prints recent audit events, most recent lastworks today
shiin verifyChecks the audit log’s hash chainworks today
shiin verify <evidence.json> <public.json>Verifies a signed receipt or checkpoint; checkpoints also require matching local audit historyimplemented in source; platform validation incomplete
shiin replay <encrypted-replay.json> [policy.toml]Replays captured inputs with the original or alternate policyimplemented in source; requires the originating OS keyring
shiin key init, shiin key rotate, shiin key publicInitializes or rotates the evidence key and prints its public keyimplemented in source on supported keyring platforms
shiin doctorReports this workspace’s policy, audit log, mode, and enforcement levelworks today
shiin policy test [dir]Runs policy cases from .shiin/tests, using the same runner as the conformance corpusworks today
shiin task start | show | endDeclares what the agent is working on, shows it with its usage, or ends itworks today
shiin hook codex, shiin hook cursorThe same hook service for those hostsworks today, untested against a running host
shiin exec --session ID -- /ABSOLUTE/PROGRAM [ARG ...]Authorizes and audits one command, then starts it only after allowsource implementation on Unix; host routing remains unvalidated
shiin pending, shiin approveLists and resolves approval requests using a separate operator credential and terminal confirmationimplemented in source on Unix; validation in progress
shiin grants, shiin revokeInspects and revokes grants or unresolved ticketsimplemented in source on Unix; validation in progress
shiind --operatorRuns the local approval daemon and displays its in-memory operator credential in a dedicated terminalimplemented in source on Unix; validation in progress

shiin policy test exits non-zero when any case fails, so it belongs in whatever runs your checks.

Exit codes

shiin check and shiin explain report the decision as an exit code, so a script can branch on it.

CodeMeaning
0The action is allowed
1The action is denied, or the command failed
2The action is pending, so a person needs to decide

shiin hook claude-code exits 0 whenever it produced a response, including a denial, because the host reads the decision from the response rather than from the exit code. It exits 2 only when it could not produce a response at all, which the host treats as blocking.

shiin exec returns 1 on denial, failure, or an unavailable daemon, and 2 for pending. After allow it returns the child’s exit code when that code is in 0–255, or 1 when no such code is available. The executable path must be absolute, and the session id must stay the same when retrying an approved ticket. Arguments are passed directly to the executable; the wrapper does not interpret them through a shell.

Files it uses

See configuration. In short, policy is read from .shiin/policy.toml and events are appended to .shiin/audit.jsonl.