Skip to content

Krythiq CLI Commands

Complete reference for all krythiq commands and options.

init

Initialize krythiq in your project. Creates config file, .krythiq/ directory, and updates .gitignore.

krythiq init

Options

--skip-gitignore

Don't modify .gitignore (default: false)

What It Does

  • Detects your project stack (Node.js, TypeScript, Go, etc)
  • Creates krythiq.config.mjs with sensible defaults
  • Creates .krythiq/ directory for custom rules and data
  • Adds .krythiq/ to .gitignore to avoid committing cache

Example

Output
$ cd my-project
$ krythiq init

→ Detecting project stack...
✓ Node.js / TypeScript detected
✓ Created krythiq.config.mjs
✓ Added .krythiq/ to .gitignore

Ready. Run: krythiq run "npm start"
run

Wrap a process and intercept stack traces for AI analysis. Streams explanations as errors occur.

krythiq run "npm start"

Options

--no-ai

Disable AI analysis, just pipe output through (default: false)

--model <model>

Specify Anthropic model (default: claude-sonnet-4-20250514)

--verbose

Print debug info from krythiq itself

Examples

# Wrap your dev server
krythiq run "npm start"

# Works with any process
krythiq run "python app.py"
krythiq run "go run ."
krythiq run "cargo run"

# Use a different AI model for faster analysis
krythiq run --model claude-haiku-3.5 "npm test"

# Disable AI (just pipe output through)
krythiq run --no-ai "npm start"

# Debug krythiq itself
krythiq run --verbose "npm start"

Requirements

  • Anthropic API key configured (run krythiq auth)
  • krythiq.config.mjs present in project root
scan

Scan a directory for security vulnerabilities and code quality issues. Supports multiple output formats and CI integration.

krythiq scan [path]

Options

--fix

Auto-apply safe patches where possible

--ci

Exit with code 1 if issues found (for CI pipelines)

--fail-on <severity>

Fail when issues of this severity or higher are found: low | medium | high | critical (default: high)

--format <fmt>

Output format: text | json | markdown | sarif (default: text)

--ignore <patterns...>

Glob patterns to exclude from scan (can specify multiple)

--rules <path>

Path to custom rules JSON (default: .krythiq/rules.json)

--watch

Daemon mode: rescan on file changes

--publish

Publish scan summary to Supabase scan_history table

--ai

Enable AI refactoring suggestions via Mistral

--ai-model <model>

Mistral model name (default: mistral-large-latest)

Examples

# Scan current directory
krythiq scan

# Scan specific path
krythiq scan ./src

# Scan and auto-fix safe issues
krythiq scan --fix

# CI/CD integration
krythiq scan --ci --fail-on high

# Export as JSON for tooling
krythiq scan --format json > scan-results.json

# Ignore certain paths
krythiq scan --ignore "**/*.test.js" --ignore "**/node_modules/**"

# Watch mode for development
krythiq scan --watch

# Get AI suggestions
krythiq scan --ai --ai-model mistral-large-latest

What It Detects

  • Hardcoded secrets and credentials
  • eval() usage and code injection risks
  • dangerouslySetInnerHTML and XSS vulnerabilities
  • Child process execution risks
  • Custom security rules (from .krythiq/rules.json)
auth

Configure your Anthropic API key for AI-powered features. Stores credentials securely in your home directory.

krythiq auth

Options

--clear

Remove stored API key credentials

Examples

# Set up API key (prompts for input)
krythiq auth

# Clear stored credentials
krythiq auth --clear

# Alternative: Set via environment variable
export ANTHROPIC_API_KEY="sk-ant-..."
krythiq run "npm start"

Getting Your API Key

  1. Visit console.anthropic.com
  2. Sign up or log in to your account
  3. Navigate to API Keys section
  4. Create a new API key
  5. Run krythiq auth and paste the key when prompted
Global Options

These options work with any krythiq command:

-v, --version

Print krythiq version

-h, --help

Show help message

krythiq --version
krythiq --help
krythiq run --help
Getting Help
# General help
krythiq --help

# Help for specific command
krythiq init --help
krythiq run --help
krythiq scan --help
krythiq auth --help