Slop-O-Meter
/Documentation
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 slopometer
2. Scan any public repo (no account needed!)
slopometer scan facebook/react
Or 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

repoGitHub 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, --jsonOutput results as JSON
-q, --quietMinimal output (no progress spinner)
-h, --helpShow help
-V, --versionShow version
Scan with short format
slopometer scan expressjs/express
Scan with full URL
slopometer scan https://github.com/vercel/next.js
JSON output for CI/CD
slopometer scan owner/repo --json > report.json
Private repository
slopometer scan owner/private-repo --github-token $GITHUB_TOKEN

Exit Codes

CodeDecisionMeaning
0SHIP ITNo blockers found, safe to deploy
0SHIP WITH CAUTIONWarnings found, review recommended
1DO NOT SHIPBlockers 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.json

Environment Variables

VariableDescriptionRequired
GITHUB_TOKENGitHub personal access token for private reposFor private repos
SLOPOMETER_API_KEYSlopometer API key (for higher rate limits)Optional
SLOPOMETER_API_URLCustom 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_token
Option 2: Use environment variable
export GITHUB_TOKEN="ghp_your_token"
slopometer scan owner/private-repo

Get a GitHub token: Go to github.com/settings/tokens → Generate new token → Select "repo" scope