Back to home
CLI & API Documentation
Integrate Slopometer into your workflow with the command-line tool and API.
Quick Start
1. Install the CLI
npm install -g slopometer2. Scan any public repo (no account needed!)
slopometer scan facebook/reactOr scan the current directory
slopometer scan .Automatically detects GitHub remote from your git config
No API key required! Public repos work out of the box. Only need auth for private repos.
Usage
slopometer scan <repo> [options]
Arguments
| repo | GitHub repository (owner/repo or full URL) |
Options
| -k, --api-key <key> | Slopometer API key (or use SLOPOMETER_API_KEY env var) |
| -t, --github-token <token> | GitHub token for private repos (or use GITHUB_TOKEN env var) |
| -j, --json | Output results as JSON |
| -q, --quiet | Minimal output (no progress spinner) |
| -h, --help | Show help |
| -V, --version | Show version |
Scan with short format
slopometer scan expressjs/expressScan with full URL
slopometer scan https://github.com/vercel/next.jsJSON output for CI/CD
slopometer scan owner/repo --json > report.jsonPrivate repository
slopometer scan owner/private-repo --github-token $GITHUB_TOKENExit Codes
| Code | Decision | Meaning |
|---|---|---|
| 0 | SHIP IT | No blockers found, safe to deploy |
| 0 | SHIP WITH CAUTION | Warnings found, review recommended |
| 1 | DO NOT SHIP | Blockers found, fix before deploying |
CI/CD Integration
GitHub Actions
name: Code Quality Check
on: [push, pull_request]
jobs:
slopometer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Slopometer
run: npx slopometer scan ${{ github.repository }}
env:
SLOPOMETER_API_KEY: ${{ secrets.SLOPOMETER_API_KEY }}
- name: Upload Report
if: always()
run: npx slopometer scan ${{ github.repository }} --json > slopometer-report.json
- uses: actions/upload-artifact@v4
if: always()
with:
name: slopometer-report
path: slopometer-report.jsonEnvironment Variables
| Variable | Description | Required |
|---|---|---|
| GITHUB_TOKEN | GitHub personal access token for private repos | For private repos |
| SLOPOMETER_API_KEY | Slopometer API key (for higher rate limits) | Optional |
| SLOPOMETER_API_URL | Custom API URL (default: https://www.slopometer.com) | Optional |
Scanning Private Repos
For private repositories, you need to provide a GitHub personal access token with repo scope.
Option 1: Pass token directly
slopometer scan owner/private-repo --github-token ghp_your_tokenOption 2: Use environment variable
export GITHUB_TOKEN="ghp_your_token"
slopometer scan owner/private-repoGet a GitHub token: Go to github.com/settings/tokens → Generate new token → Select "repo" scope
