Quick Start
Create a policy, scan a project, mask a prompt, encrypt .env files, and install Git and AI tool hooks in a few minutes.
On this page
This page walks through the most common shk workflows. It assumes the CLI is already installed; see Installation if not.
1. Create a project policy
Create a project policy file:
shk initThis writes shk.toml in the current directory. Read-only commands work without it, but commands that write files or tool configuration require a project policy. When package.json is present, shk init can also apply package-manager supply-chain hardening such as ignore-scripts=true and release age gates; pass --no-npm-hardening to skip that step.
For a stricter starting point that fails on medium-severity findings:
shk init --strict2. Scan the project
Scan the current project:
shk scan .Output a machine-readable report:
shk scan . --jsonScan only staged files, or only files changed relative to a base branch:
shk scan --staged
shk scan . --changed-since origin/mainSee shk scan for Git history scanning, SARIF output, and exit code semantics.
3. Mask content before sharing it with AI
Mask sensitive content from stdin:
shk mask < prompt.txtMask an Office document into a new file:
shk mask report.docx --output report.redacted.docxScan or mask the clipboard directly:
shk clipboard scan
shk clipboard mask --write4. Encrypt .env files
Encrypt a .env file in place and run a command with decrypted values injected only at runtime:
shk env encrypt .env --in-place
shk env run -- npm testPrivate keys are stored in the OS keyring by default. Teams can opt in to 1Password; see Env Secret Store.
5. Install hooks
Install a Git pre-commit hook that scans staged files:
shk hooks installInstall AI tool hooks in audit mode to observe without blocking:
shk hooks install-ai --auditInstall AI tool hooks that block but keep metadata-only block logs, then review them:
shk hooks install-ai --log-blocked
shk auditHooks are supported for Claude Code, Cursor, Codex, GitHub Copilot, Antigravity, and Windsurf. See shk hooks install-ai for tool-specific options.
6. Add CI
Generate a GitHub Actions workflow that scans every pull request:
shk ci init github
# Add GitHub code scanning alerts and PR annotations:
shk ci init github --upload-sarifAlternatively, use the repository's composite action after checkout on a Linux or macOS runner:
permissions:
contents: read
security-events: write
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: Kazuki-tam/security-harness-kit@v1
with:
path: .
fail-on: high
upload-sarif: trueSee GitHub Actions for modes, pinning, and troubleshooting.
7. Install the agent skill and check coverage
Install the shk agent skill for Claude Code, Codex, Cursor, Copilot, Antigravity, and Windsurf:
shk skills installCheck ignore coverage:
shk doctor ignoreCommon commands at a glance
shk init
shk init --strict
shk init --yes --no-npm-hardening
shk scan .
shk scan . --json
shk scan . --json --with-value-hash
shk scan . --sarif
shk scan --staged
shk scan . --changed-since origin/main
shk scan --git-history
shk scan --git-history --preview
shk scan --git-history --ref HEAD~50..HEAD
shk allowlist suggest --from report-with-hashes.json --value-hash
shk mask < prompt.txt
shk mask --json < prompt.txt
shk mask report.docx --output report.redacted.docx
shk mask orders.csv --pseudonymize --columns "Email:email,Phone:phone" --output orders.pseudo.csv
shk pseudonymize key show
shk clipboard scan
shk clipboard mask
shk clipboard mask --write
shk doctor
shk doctor --strict
shk doctor ignore --fix
shk doctor env --dotenvx
shk doctor workflows --fix
shk audit
shk audit --reason action-guard
shk audit --since 7d --tool cursor
shk audit --json
shk mcp audit
shk mcp audit --json
shk mcp audit --sarif
shk mcp audit --global
shk env dotenvx import-keys .env.keys
shk env encrypt .env --in-place
shk env run -- npm test
shk env key import
shk env key list
shk env key delete --env staging
shk env key export --instructions
shk env key migrate --to 1password
shk env decrypt .env --output .env.local
shk secrets push --profile prod --dry-run
shk hooks install
shk hooks install-ai --dry-run
shk hooks install-ai --audit
shk hooks install-ai --log-blocked
shk hooks install-ai --tool copilot
shk hooks install-ai --tool antigravity
shk hooks install-ai --tool windsurf
shk ci init github
shk ci init github --upload-sarif
shk ci init github --dry-run
shk ci init github --mode audit
shk ci init github --shk-version v0.7.0
shk skills install
shk skills install --tool claude-code --global
shk skills install --tool windsurf
shk skills status