Reference
CLI Reference
Commands, flags, exit codes, and scan phases in the Sigil CLI. Eight scan phases run locally — no account required for the open-source tier.
Setup commands
sigil install
Copy the running sigil binary to /usr/local/bin (or the directory given with --path). May require sudo. It creates no data directories: ~/.sigil/quarantine/ is created on the first sigil clone, sigil pip, or sigil npm. For shell aliases, Claude Code wiring, and git hooks, use sigil setup below.
sigil install
# Install to a different directory
sigil install --path ~/.local/bin| Flag | Description |
|---|---|
| -p, --path <dir> | Installation directory (default: /usr/local/bin) |
sigil setup shell
Append drop-in aliases that route commands through Sigil's quarantine-first workflow to ~/.zshrc or ~/.bashrc (bash or zsh, chosen from $SHELL; other shells get manual instructions). Idempotent — re-running never duplicates the block. ./install.sh --with-aliases writes the same block. Other targets: sigil setup claude (Claude Code plugin), sigil setup git (pre-commit hook, below), and sigil setup all.
sigil setup shell
# Reload your shell (or source the rc file) to activate the aliases
# Manual alternative — add to your rc file yourself:
alias gclone='sigil clone' safepip='sigil pip' safenpm='sigil npm'Aliases written:
| Alias | Expands to | Description |
|---|---|---|
| gclone | sigil clone | Quarantine-first git clone |
| safepip | sigil pip | Quarantine-first pip install |
| safenpm | sigil npm | Quarantine-first npm install |
sigil config
View or modify the Sigil configuration, stored as JSON at ~/.sigil/config.json. Running sigil config with no key exits 1 — pass a key or --list.
# Print the whole config file
sigil config --list
# Read one value
sigil config <key>
# Set a value (creates ~/.sigil/config.json if missing)
sigil config <key> <value>| Flag | Description |
|---|---|
| -l, --list | Print all configuration values from ~/.sigil/config.json |
sigil setup git
Install a pre-commit hook in the current repository's .git/hooks that runs sigil scan . --fail-on high before each commit and blocks on HIGH/CRITICAL findings. Skips with a warning if sigil is not on PATH; refuses to overwrite a pre-commit hook it did not write. Bypass a single commit with git commit --no-verify.
cd /path/to/repo
sigil setup git
# Installs .git/hooks/pre-commit, which runs: sigil scan . --fail-on highAudit commands
sigil clone
Clone a git repository into quarantine and scan it. The clone lands under ~/.sigil/quarantine/; approve it with sigil approve before using the code. Drop-in replacement for git clone.
sigil clone <repo-url> [flags]
# Examples
sigil clone https://github.com/user/repo
sigil clone git@github.com:user/repo.git --branch main
sigil clone https://github.com/user/repo --auto-approve| Flag | Description |
|---|---|
| -b, --branch <name> | Branch to clone |
| --auto-approve | Approve automatically when the verdict is LOW RISK |
sigil pip
Download a Python package into quarantine (pip download --no-deps), extract it, and scan it. Nothing is installed into your environment; approve it with sigil approve first. Quarantine-first replacement for pip install.
sigil pip <package> [flags]
# Examples
sigil pip requests
sigil pip flask==3.0.0
sigil pip requests --version 2.32.3| Flag | Description |
|---|---|
| -V, --version <ver> | Specific version to download |
| --auto-approve | Approve automatically when the verdict is LOW RISK |
sigil npm
Download an npm package into quarantine (npm pack), extract it, and scan it. Nothing is installed into your project; approve it with sigil approve first. Quarantine-first replacement for npm install.
sigil npm <package> [flags]
# Examples
sigil npm express
sigil npm lodash@4.17.21
sigil npm typescript --version 5.4.5| Flag | Description |
|---|---|
| -V, --version <ver> | Specific version to download |
| --auto-approve | Approve automatically when the verdict is LOW RISK |
sigil scan
Scan a directory or file already on disk. Runs all eight analysis phases and outputs a verdict with a risk score. To scan a package or repo, use sigil npm, sigil pip, or sigil clone — they download into quarantine first.
sigil scan <path> [flags]
# Examples
sigil scan ./local-directory
sigil scan ./downloaded-skill/skill.yaml
# Packages and repos go through quarantine commands instead:
sigil npm express
sigil pip requests
sigil clone https://github.com/user/repo
# Gate CI on findings at or above a severity
sigil scan . --fail-on high
# Machine-readable output (global flag)
sigil scan . --format json| Flag | Description |
|---|---|
| -p, --phases <list> | Phases to run, comma-separated, or all (default: all) |
| -s, --severity <level> | Minimum severity to report: low, medium, high, critical (default: low) |
| --fail-on <level> | Exit 1 when a finding at or above this severity is present: low, medium, high, critical (default: high) |
| --no-cache | Force a fresh scan even if content is unchanged |
| --enrich | Enrich the scan with cloud threat intelligence (hash lookup) |
| --enhanced | LLM-powered analysis (Pro feature, requires authentication) |
| --submit | Submit results to Sigil cloud |
| --ignore-ledger | Report findings even when the content digest matches an approved ledger pin |
| -f, --format <fmt> | Global: text, json, sarif, or html (default: text) |
| -v, --verbose | Global: verbose output |
sigil fetch
Fetch the latest threat signatures from Sigil cloud. This command does not download arbitrary URLs — use sigil clone, sigil pip, or sigil npm to quarantine code.
sigil fetch
# Re-download even if the local signatures are fresh
sigil fetch --force| Flag | Description |
|---|---|
| -f, --force | Force re-download even if signatures are fresh |
Quarantine management
sigil list
List quarantined items with their status, ID, source, and source type (git, pip, or npm). IDs are 8-character hex strings. Add --detailed for the path, timestamps, reason, and score.
sigil list
# Output format, one line per entry:
# <STATUS> [<id>] <source> (<type>)
# e.g. PENDING, APPROVED, or REJECTED, then the 8-character id,
# the package spec or repo URL, and git | pip | npm
# Only pending items, with path, timestamps, reason, and score
sigil list --status pending --detailed
# JSON
sigil list --format json| Flag | Description |
|---|---|
| -s, --status <status> | Filter by status: pending, approved, rejected |
| -d, --detailed | Show path, created/updated timestamps, reason, and score |
sigil approve
Approve a pending quarantined item. The code stays at its quarantine path (printed on approval) and its content hashes are pinned in the trust ledger, so later drift from the approved content is detected.
sigil approve <id> [--reason "<text>"]
# <id> is the 8-character id shown by sigil list| Flag | Description |
|---|---|
| -r, --reason <text> | Reason for approval |
sigil reject
Reject a pending quarantined item. Its files are deleted from the quarantine directory and any trust-ledger pin for it is revoked.
sigil reject <id> [--reason "<text>"]
# <id> is the 8-character id shown by sigil list| Flag | Description |
|---|---|
| -r, --reason <text> | Reason for rejection |
Account commands
sigil login
Authenticate with the Sigil cloud API. Required for Pro and Team features including cloud threat intelligence and the web dashboard.
# Interactive login (browser-based device authorization)
sigil login| Flag | Description |
|---|---|
| -t, --token | API token; if omitted, a browser-based device authorization flow runs. API token issuance is not yet available — use the device flow |
| --endpoint | API endpoint URL (default: https://api.sigilsec.ai) |
Logging out
There is no logout subcommand. To clear the stored authentication token and revert the CLI to open-source mode, delete the token file:
rm ~/.sigil/tokenOther commands
Remaining subcommands, as listed by sigil --help. Run sigil <command> --help for flags.
| Command | Description |
|---|---|
| sigil setup <claude|shell|git|all> | Wire Sigil into AI agent and developer workflows |
| sigil sbom <path> | Generate a Software Bill of Materials (table, cyclonedx, or json via -F) |
| sigil diff --baseline <file> <path> | Compare a fresh scan against a baseline scan JSON to find new and resolved findings |
| sigil explain <scan.json> | Explain a scan finding with AI adjudication (Pro feature, server-side) |
| sigil policy generate|validate|preset | Generate or inspect security policies |
| sigil run -- <command> | Run a command in a sandboxed environment with policy enforcement |
| sigil safe-run <path> -- <command> | Scan a path, generate a policy, and run a command in a sandbox |
| sigil provider create|list|show|delete|discover | Manage credential providers for sandboxed execution |
| sigil residue scan|plan|apply|rollback | Find, and reversibly clean up, what installed agent tooling left on this machine |
| sigil ledger show <id> | Show the pinned content hashes for an approved quarantine id |
| sigil corpus | Show the active detection corpus: which packs are loaded, from where |
| sigil known-good | Known-good corpus: recognise published code instead of re-judging it |
| sigil report <sha256> | Report a threat to the Sigil cloud (-t threat type, -d description) |
| sigil clear-cache | Clear all cached scan results |
| sigil hook <event> | Respond to a Claude Code hook event (reads the hook JSON from stdin) |
Scan phases
Every scan runs eight analysis phases. Each phase has a weight multiplier that determines how much findings contribute to the total risk score.
| # | Phase | Weight | What it scans |
|---|---|---|---|
| 1 | Install Hooks | 10x | setup.py cmdclass, npm postinstall, Makefile targets |
| 2 | Code Patterns | 5x | eval(), exec(), pickle.loads, child_process, subprocess shell=True |
| 3 | Network / Exfil | 3x | requests.post, fetch(), axios, WebSockets, ngrok, Discord/Telegram webhooks |
| 4 | Credentials | 2x | os.environ, .aws/credentials, SSH keys, API key patterns |
| 5 | Obfuscation | 5x | base64.b64decode, atob(), String.fromCharCode, hex escapes |
| 6 | Provenance | 1-3x | Git history depth, binary files, hidden dotfiles, large files |
| 7 | Prompt Injection | 10x | Hidden instructions in comments, docstrings, markdown, and config files targeting AI agents |
| 8 | AI Skill Security | 5x | Malicious AI skills, MCP servers, suspicious permissions, and publisher reputation signals |
Verdicts and scoring
Each scan produces a numeric risk score and a corresponding verdict. The score is the weighted sum of all findings across the eight phases. CRITICAL is evidence-gated: it requires at least one critical-severity finding, not just a high score.
| Score | Verdict | Meaning | Recommended action |
|---|---|---|---|
| 0–9 | LOW RISK | No known malicious patterns detected | Auto-approve eligible |
| 10–24 | MEDIUM RISK | Multiple findings | Manual review |
| 25+ | HIGH RISK | Significant suspicious patterns, no critical-severity finding | Do not approve without thorough review |
| Any score | CRITICAL RISK | At least one critical-severity finding, regardless of score | Reject and report |
Exit codes
Exit codes follow a three-value contract driven by finding severity against the --fail-on threshold, not by score bands, so CI/CD pipelines can gate on them directly.
| Code | Meaning |
|---|---|
| 0 | No finding at or above the --fail-on threshold (default: high) |
| 1 | At least one finding at or above --fail-on. For sigil clone, pip, and npm, 1 means any verdict other than LOW RISK |
| 2 | Scan error — invalid path or flags, or the scan could not run. Never a verdict |
--fail-on threshold; exit 2 means the scan itself failed and should also block, but for a different reason.# Block on HIGH or CRITICAL findings; treat scan errors separately
sigil scan . --fail-on high
case $? in
0) ;;
1) echo "Findings at or above high"; exit 1 ;;
2) echo "Scan error"; exit 2 ;;
esacEnvironment variables
The CLI reads these environment variables. Cloud endpoint overrides use the --endpoint flag on sigil login, not an environment variable.
| Variable | Default | Description |
|---|---|---|
| SIGIL_QUARANTINE_DIR | ~/.sigil/quarantine | Quarantine directory |
| SIGIL_HOME | ~ | Home directory that sigil residue inspects (tests and CI) |
| SIGIL_GUARD_MODE | enforce | Claude Code hook guard (sigil hook); set to off to disable |
| SIGIL_BYPASS | unset | Set to 1 to bypass the Claude Code hook guard for one command |
| SIGIL_PACK_PUBLIC_KEY | unset | 64-char hex Ed25519 public key; when set, user-installed detection packs must carry a valid signature |
Files scanned
There is no extension allowlist. Every text file is scanned, including dotfiles and agent instruction files such as .cursorrules, CLAUDE.md, AGENTS.md, and SKILL.md. Directories that are never content-scanned:
dist/ and build/ are scanned — in a published npm package they are the shipped code. .sigilignore (gitignore syntax) is always honoured; .gitignore only inside real git repositories, so a .gitignore in an extracted tarball cannot hide files. Files over 10 MB are not skipped: their head and tail are scanned.
Need help?
Ask a question in GitHub Discussions or check the troubleshooting guide.