Install the CLI, run your first scan, and understand your results
Install the Spec This CLI globally using npm:
npm install -g @spec-this/cli
Check that the CLI is installed correctly:
spec-this --version
Spec This uses a secure device login flow to authenticate your CLI. No API keys needed!
Run the login command to authenticate:
spec-this login
✓ Device authorization started Your activation code: ABC123 Visit: https://app.specthis.ai/activate Waiting for authorization... ✓ Successfully authenticated!
Your authentication token is securely stored at ~/.spec-this/credentials.json. You only need to log in once per machine.
spec-this whoamiDisplay your current authenticated user
spec-this logoutClear stored credentials
Navigate to your GitHub repository directory and run:
cd /path/to/your/project spec-this scan
The CLI will automatically detect your repository from git remote origin.
git remote origin)The scanner analyzes code in:
✓ Scan completed and uploaded successfully! Scan Summary: Scan Run ID: 550e8400-e29b-41d4-a716-446655440000 Files processed: 142 Symbols processed: 1,847 Edges processed: 5,234 Metrics processed: 1,847 Groups processed: 45 Files scanned: 142 Symbols extracted: 1,847 Edges added: 5,234 Grouping strategy: directory-based
After scanning, you can view detailed results in your dashboard.
See high-level metrics for your entire codebase, including total files scanned, average complexity scores, and trend analysis over time.
Review specific functions, files, or patterns that exceed your thresholds. Each alert includes:
Track how your code quality changes over time. See if complexity is growing or improving with each scan.
Integrate Spec This into your continuous integration pipeline to automatically scan code on every push or pull request.
Add this workflow to your repository at .github/workflows/spec-this.yml:
name: Code Quality Scan
on: [push, pull_request]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Spec This CLI
run: npm install -g @spec-this/cli
- name: Authenticate CLI
run: spec-this login
env:
# You'll need to set up device login in your CI environment
# or use a different auth method for CI
SPEC_THIS_TOKEN: ${{ secrets.SPEC_THIS_TOKEN }}
- name: Run Scan
run: spec-this scanNote: For CI/CD environments, you may need to configure authentication differently. Contact support for guidance on automated scanning.
Configure which metrics trigger alerts in your Organization Settings.
Choose from preset sensitivity levels (High, Medium, Low) or customize individual thresholds.
Now that you've run your first scan, learn more about the metrics:
If you see authentication errors:
spec-this login to authenticate~/.spec-this/credentials.jsonspec-this logout then login againIf the CLI can't find your repository:
git remote -vTo scan a repository, you must install the Spec This GitHub App:
If many files fail to parse:
If you encounter issues or have questions, we're here to help: