Skip to main content

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.

bash
sigil install

# Install to a different directory
sigil install --path ~/.local/bin
FlagDescription
-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.

bash
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:

AliasExpands toDescription
gclonesigil cloneQuarantine-first git clone
safepipsigil pipQuarantine-first pip install
safenpmsigil npmQuarantine-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.

bash
# 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>
FlagDescription
-l, --listPrint 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.

bash
cd /path/to/repo
sigil setup git

# Installs .git/hooks/pre-commit, which runs: sigil scan . --fail-on high

Audit 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.

bash
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
FlagDescription
-b, --branch <name>Branch to clone
--auto-approveApprove 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.

bash
sigil pip <package> [flags]

# Examples
sigil pip requests
sigil pip flask==3.0.0
sigil pip requests --version 2.32.3
FlagDescription
-V, --version <ver>Specific version to download
--auto-approveApprove 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.

bash
sigil npm <package> [flags]

# Examples
sigil npm express
sigil npm lodash@4.17.21
sigil npm typescript --version 5.4.5
FlagDescription
-V, --version <ver>Specific version to download
--auto-approveApprove 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.

bash
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
FlagDescription
-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-cacheForce a fresh scan even if content is unchanged
--enrichEnrich the scan with cloud threat intelligence (hash lookup)
--enhancedLLM-powered analysis (Pro feature, requires authentication)
--submitSubmit results to Sigil cloud
--ignore-ledgerReport findings even when the content digest matches an approved ledger pin
-f, --format <fmt>Global: text, json, sarif, or html (default: text)
-v, --verboseGlobal: 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.

bash
sigil fetch

# Re-download even if the local signatures are fresh
sigil fetch --force
FlagDescription
-f, --forceForce 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.

bash
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
FlagDescription
-s, --status <status>Filter by status: pending, approved, rejected
-d, --detailedShow 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.

bash
sigil approve <id> [--reason "<text>"]

# <id> is the 8-character id shown by sigil list
FlagDescription
-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.

bash
sigil reject <id> [--reason "<text>"]

# <id> is the 8-character id shown by sigil list
FlagDescription
-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.

bash
# Interactive login (browser-based device authorization)
sigil login
FlagDescription
-t, --tokenAPI token; if omitted, a browser-based device authorization flow runs. API token issuance is not yet available — use the device flow
--endpointAPI 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:

bash
rm ~/.sigil/token

Other commands

Remaining subcommands, as listed by sigil --help. Run sigil <command> --help for flags.

CommandDescription
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|presetGenerate 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|discoverManage credential providers for sandboxed execution
sigil residue scan|plan|apply|rollbackFind, 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 corpusShow the active detection corpus: which packs are loaded, from where
sigil known-goodKnown-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-cacheClear 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.

#PhaseWeightWhat it scans
1Install Hooks10xsetup.py cmdclass, npm postinstall, Makefile targets
2Code Patterns5xeval(), exec(), pickle.loads, child_process, subprocess shell=True
3Network / Exfil3xrequests.post, fetch(), axios, WebSockets, ngrok, Discord/Telegram webhooks
4Credentials2xos.environ, .aws/credentials, SSH keys, API key patterns
5Obfuscation5xbase64.b64decode, atob(), String.fromCharCode, hex escapes
6Provenance1-3xGit history depth, binary files, hidden dotfiles, large files
7Prompt Injection10xHidden instructions in comments, docstrings, markdown, and config files targeting AI agents
8AI Skill Security5xMalicious 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.

ScoreVerdictMeaningRecommended action
0–9LOW RISKNo known malicious patterns detectedAuto-approve eligible
10–24MEDIUM RISKMultiple findingsManual review
25+HIGH RISKSignificant suspicious patterns, no critical-severity findingDo not approve without thorough review
Any scoreCRITICAL RISKAt least one critical-severity finding, regardless of scoreReject 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.

CodeMeaning
0No finding at or above the --fail-on threshold (default: high)
1At least one finding at or above --fail-on. For sigil clone, pip, and npm, 1 means any verdict other than LOW RISK
2Scan error — invalid path or flags, or the scan could not run. Never a verdict
CI/CD usage
Use the exit code to gate deployments. Exit 1 means a finding met your --fail-on threshold; exit 2 means the scan itself failed and should also block, but for a different reason.
bash
# 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 ;;
esac

Environment variables

The CLI reads these environment variables. Cloud endpoint overrides use the --endpoint flag on sigil login, not an environment variable.

VariableDefaultDescription
SIGIL_QUARANTINE_DIR~/.sigil/quarantineQuarantine directory
SIGIL_HOME~Home directory that sigil residue inspects (tests and CI)
SIGIL_GUARD_MODEenforceClaude Code hook guard (sigil hook); set to off to disable
SIGIL_BYPASSunsetSet to 1 to bypass the Claude Code hook guard for one command
SIGIL_PACK_PUBLIC_KEYunset64-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:

node_modules.gittarget.next__pycache__.venvvenv.tox.mypy_cache.pytest_cache

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.