@rafter-security/cli
v0.1.0
Published
A Node.js CLI for Rafter Security that supports npm, pnpm, and yarn package managers.
Readme
@rafter-security/cli
A Node.js CLI for Rafter Security that supports npm, pnpm, and yarn package managers.
Installation
# Using npm
npm install -g @rafter-security/cli
# Using pnpm
pnpm add -g @rafter-security/cli
# Using yarn
yarn global add @rafter-security/cliQuick Start
# Set your API key
export RAFTER_API_KEY="your-api-key-here"
# Run a security scan
rafter run
# Get scan results
rafter get <scan-id>
# Check API usage
rafter usageCommands
rafter run [options]
Trigger a new security scan for your repository.
Options:
-r, --repo <repo>- Repository in formatorg/repo(default: auto-detected)-b, --branch <branch>- Branch name (default: auto-detected)-k, --api-key <key>- API key (or setRAFTER_API_KEYenv var)-f, --format <format>- Output format:jsonormd(default:json)--skip-interactive- Don't wait for scan completion--quiet- Suppress status messages
Examples:
# Basic scan with auto-detection
rafter run
# Scan specific repo/branch
rafter run --repo myorg/myrepo --branch feature-branch
# Non-interactive scan
rafter run --skip-interactiverafter get <scan-id> [options]
Retrieve results from a completed scan.
Options:
-k, --api-key <key>- API key (or setRAFTER_API_KEYenv var)-f, --format <format>- Output format:jsonormd(default:json)--interactive- Poll until scan completes--quiet- Suppress status messages
Examples:
# Get scan results
rafter get <scan-id>
# Wait for scan completion
rafter get <scan-id> --interactiverafter usage [options]
Check your API quota and usage.
Options:
-k, --api-key <key>- API key (or setRAFTER_API_KEYenv var)
Example:
rafter usageConfiguration
Environment Variables
RAFTER_API_KEY- Your Rafter API key (alternative to--api-keyflag)
Git Auto-Detection
The CLI automatically detects your repository and branch from the current Git repository:
- Repository: Extracted from Git remote URL
- Branch: Current branch name, or
mainif on detached HEAD
Note: The CLI only scans remote repositories, not your current local branch.
Documentation
For comprehensive documentation, API reference, and examples, see https://docs.rafter.so.
