Skip to main content

Skylos Workflow Guide

Dead code and security scanner for Python. Follow the steps in order.


Part 1: Getting Started

Step 1: Install

pip install skylos

Verify it worked:

skylos --version

Step 2: Run Your First Scan

Go to your Python project:

cd /path/to/your/project
skylos .

You'll see a list of unused functions and imports.

Step 3: Understand the Output

Each finding has a confidence score (0–100%). Higher = more certain it's dead.

────────────────── Unused Functions ──────────────────
# Name Location Conf
1 old_handler app.py:16 90% ← Safe to delete
2 maybe_used utils.py:42 60% ← Review first
ColumnMeaning
NameThe unused function, import, class, or variable
Locationfile:line where it's defined
ConfConfidence score (0–100%) — how certain Skylos is that this code is truly unused. Higher = safer to remove

Rule of thumb:

  • 90–100%: Safe to delete
  • 60–89%: Look at it first
  • Below 60%: Probably a false positive

Step 4: Remove Dead Code

Option A: Manual

Open the file, delete the code yourself.

Option B: Interactive Mode

skylos . -i

Use arrow keys to select, spacebar to toggle, enter to confirm.

Preview first without changing anything:

skylos . -i --dry-run

Step 5: Add Security + Quality Scans

skylos . --danger --secrets --quality
FlagWhat it finds
--dangerSQL injection, command injection, unsafe eval, weak crypto
--secretsHardcoded API keys, passwords, private keys
--qualityComplex functions, deep nesting, too many arguments

You're done with the basics. Everything below is optional.


Part 2: Skylos Cloud (Dashboard + History)

Cloud gives you:

  • Dashboard to view all scans
  • Scan history and trend charts
  • Team collaboration and suppressions (Pro)
  • PR blocking that developers can't bypass (Pro)
  • Slack & Discord notifications (Pro)
New Users

Every new account gets 50 starter credits and a 7-day Pro trial — no credit card required.

Step 1: Upload Your First Scan

Just run:

skylos . --upload

That's it. On first run:

  1. Your browser opens automatically
  2. Sign in with GitHub
  3. Pick (or create) a project — one click
  4. Results upload to the dashboard
$ skylos . --upload

Scanning Python files...
✓ Found 15 issues

No Skylos token found. Let's connect to Skylos Cloud.

Opening browser to connect to Skylos Cloud...
Waiting for authentication...

✓ Connected to Skylos Cloud!
Project: my-project
Organization: My Team

Uploading scan results...
✓ Upload complete! View at https://skylos.dev/dashboard

Future uploads work automatically — no prompts, no tokens to copy.

Step 2: Add More Scan Types

skylos . --danger --upload       # Security scan + upload
skylos . --quality --upload # Quality scan + upload
skylos . --danger --quality --upload # Everything

View results at: skylos.dev/dashboard

See Authentication for CI/CD setup and advanced options.


Part 3: Understand the Flags

FlagWhat it does
--dangerSecurity vulnerabilities (SQLi, command injection, unsafe eval)
--secretsHardcoded API keys, passwords, private keys
--qualityCode complexity, deep nesting, long functions
--uploadSend results to Skylos Cloud
--strictExit code 1 if gate fails (use with --upload in CI)
--gateExit code 1 if gate fails (local only, no upload)
--forceBypass quality gate (emergency override)

Part 4: CI/CD Setup

No secrets required! Create .github/workflows/skylos.yml:

name: Skylos Quality Gate

on:
pull_request:
branches: [main, master]

permissions:
contents: read
id-token: write # Enables tokenless auth

jobs:
skylos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: pip install skylos
- name: Run Skylos
run: skylos . --danger --upload

That's it — no tokens, no secrets to configure.


Option B: One-Command Setup

skylos sync setup

This wizard will:

  1. Authenticate with Skylos Cloud (browser opens automatically)
  2. Ask what you want to install:
    • Git hooks — blocks git push if scan fails
    • Pre-commit config — blocks git commit if scan fails
    • GitHub Actions — blocks PR merges if scan fails

Just answer the prompts.


Option C: Manual GitHub Actions (with token)

For explicit token management, create .github/workflows/skylos.yml:

name: Skylos Quality Gate

on:
pull_request:
branches: [main, master]

jobs:
skylos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: pip install skylos
- name: Run Skylos
env:
SKYLOS_TOKEN: ${{ secrets.SKYLOS_TOKEN }}
run: skylos . --danger --upload --strict

Then add your token to GitHub:

  1. Go to your repo → Settings → Secrets and variables → Actions
  2. Click New repository secret
  3. Name: SKYLOS_TOKEN
  4. Value: your token from Skylos dashboard

What --strict Does

FlagBehavior
--uploadUpload results to dashboard. If gate fails, shows warning but continues.
--upload --strictUpload results. If gate fails, exits with code 1 (blocks CI).
--gateLocal only. Exits with code 1 if gate fails. No upload.

Part 5: Install GitHub App (Pro — Enforced Checks)

The GitHub App creates status checks that cannot be bypassed by deleting workflow files.

Step A: Install the App

  1. Go to Skylos Dashboard → Settings → GitHub Integration
  2. Click Install GitHub App
  3. Select your repository
  4. Click Install

Step B: Protect Your Branch

In your GitHub repo:

  1. Go to Settings → Branches
  2. Click Add branch protection rule
  3. Branch name pattern: main
  4. Check Require status checks to pass before merging
  5. Search for and select Skylos Quality Gate
  6. Click Create

Now PRs cannot merge until Skylos passes. No exceptions.


Part 6: Sync Team Config (Pro)

Pull shared suppressions and policies:

skylos sync pull

Creates:

  • .skylos/config.yaml — quality thresholds
  • .skylos/suppressions.json — team-wide false positive rules

Free vs Pro

tip

Every new account gets 50 starter credits and a 7-day Pro trial.

FeatureFreeProEnterprise
Local scans
Upload to dashboard✅ (1 credit)✅ (1 credit)✅ (unlimited)
Projects110Unlimited
Scan history10 scans500 scans10,000 scans
History retention7 days90 days365 days
GitHub Actions
Server-controlled checks
Full trend charts
Team collaboration
Slack & Discord
Inline PR comments
SARIF export
Custom rulesUp to 50Unlimited
SSO/SAML

GitHub Actions vs GitHub App:

  • Actions — Uses --strict to exit with code 1. Developers can delete the workflow file to bypass.
  • App — Creates a GitHub status check via the skylos-gate app. Cannot be bypassed.
  • Override: Manually approve a failed gate in the dashboard (emergency bypass with audit trail).
  • PR diff checks: Marks findings as "new" (in changed lines) or "legacy" (existed before).

Part 7: Handling False Positives

Option 1: Inline Comment

def dynamic_handler():  # pragma: no skylos
pass

Option 2: Whitelist (Local)

skylos whitelist 'handle_*'
skylos whitelist 'visit_*' --reason "AST visitor pattern"

This saves to pyproject.toml.

Option 3: Suppressions (Cloud - Pro)

In the dashboard, click "Suppress" on any finding. This syncs to your team via:

skylos sync pull

Part 8: AI-Powered Analysis

Setup

You can run skylos key to run an interactive setup or the manual way below.

export OPENAI_API_KEY="sk-..."
# or
export ANTHROPIC_API_KEY="sk-ant-..."

Run AI Analysis

skylos agent scan .             # Hybrid static + AI
skylos agent scan . --fix # AI auto-fix
skylos agent scan --changed # Only changed files (for PRs)

Use Local LLMs (No API Key)

# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh
ollama pull qwen2.5-coder:7b

# Run with local model
skylos agent scan . \
--provider openai \
--base-url http://localhost:11434/v1 \
--model qwen2.5-coder:7b

Cheatsheet

I want to...Command
Find dead codeskylos .
Find security issuesskylos . --danger
Find hardcoded secretsskylos . --secrets
Check code qualityskylos . --quality
Run all scansskylos . --danger --secrets --quality
Remove code interactivelyskylos . -i
Preview without changingskylos . -i --dry-run
Upload to cloudskylos . --upload
Upload + block on failskylos . --upload --strict
Local gate (no upload)skylos . --gate
One-command CI setupskylos sync setup
Connect to cloudskylos sync connect
Check connectionskylos sync status
Pull team configskylos sync pull
Disconnectskylos sync disconnect
AI analysisskylos agent scan .
AI auto-fixskylos agent scan . --fix
Launch web UIskylos run
Add to whitelistskylos whitelist 'pattern'
View whitelistskylos whitelist --show
Lower confidence thresholdskylos . -c 30
Export JSONskylos . --json
Save to fileskylos . -o report.txt

Troubleshooting

"Q: No token found"

skylos sync connect

"Q: Invalid API token"

Your token expired or was rotated. Get a new one from Dashboard → Settings, then:

skylos sync connect

"Q: Quality gate failed but continuing"

You're on Free plan. Gate shows the failure but doesn't block. Upgrade to Pro or use --strict in CI.

"Q: Nothing showed up"

Your code might be clean. Or lower the threshold:

skylos . -c 30

"Q: Too many false positives"

Raise the threshold or whitelist patterns:

skylos . -c 80
skylos whitelist 'handle_*'

Getting Help