The sourcerykit CLI is the command-line interface for configuring, managing, and debugging your SourceryKit integration.
sourcerykit [COMMAND]Run sourcerykit --help to see all available commands.
| Command | Description |
|---|---|
init | Setup wizard (account, database, project). |
doctor | Validate configuration and connectivity. |
feedback | Submit feedback or bug reports. |
logout | Clear stored session. |
version | Print package version. |
endpoints add | Add a trusted endpoint. |
endpoints list | List all trusted endpoints. |
endpoints remove | Remove a trusted endpoint. |
config list | Display active configuration. |
config set | Update configuration variables. |
trace list | Show all traces. |
trace show | Show trace details and intercepts. |
SourceryKit stores configuration at two levels:
| Config | Location | Scope | Stores |
|---|---|---|---|
global | typer.get_app_dir(sourcerykit) (OS application directory) | User-level | api_key, org_id, token, email |
local | ./.env (project directory) | Project-level | SOURCERYKIT_POSTGRES_URL, SOURCERYKIT_PROJECT_NAME, bootstrap IDs |
Global config is shared across all projects. Local config is project-specific and should be added to .gitignore.
Setup wizard for account creation/login, database linking, and project initialization.
sourcerykit init [--register] [--email EMAIL] [--password PASSWORD] [--postgres-url URL] [--project-name NAME]Options:
| Option | Description |
|---|---|
--register | Create a new account (requires --email and --password) |
--email | Account email |
--password | Account password |
--postgres-url | Full postgresql:// URL |
--project-name | Project name |
--email and --password must be used together. Use --register to create a new account, or omit it to log in with an existing account. Registration requires email verification before you can log in
What it does:
Input: Interactive prompts for email, password, database URL, and project name.
Welcome to the SourceryKit Wizard! How would you like to proceed?
❯ Log in with an existing account
Create a new account
Exit
🔐 Log in to your account
Email address: [email protected]
Password: ********
🛠️ Link your Postgres database
PostgreSQL URL: postgresql://user:pass@host:5432/db
📦 Name your project
Project name: my-projectNon-interactive registration:
sourcerykit init --register --email [email protected] --password secret
# → "📧 Verification email sent"
# → Verify your account, then run:
# → sourcerykit init --email [email protected] --password secret"Non-interactive login + setup:
sourcerykit init \
--email [email protected] \
--password secret \
--postgres-url "postgresql://user:pass@host:5432/db" \
--project-name my-projectOutput: Saves credentials to global config and local .env file.
🎉 SOURCERYKIT SETUP COMPLETE
Global config:
PROVABLY_API_KEY = ***********************************1234
SOURCERYKIT_ORG_ID = abc123
Local config (.env):
SOURCERYKIT_PROJECT_NAME = my-project
SOURCERYKIT_POSTGRES_URL = postgresql://user:***@host:5432/db
SOURCERYKIT_COLLECTION_ID = col_abc123
SOURCERYKIT_INTEGRATION_KEY = ***********************************1234Validate configuration and connectivity.
sourcerykit doctor [--fix]Options:
| Option | Description |
|---|---|
--fix | Auto-fix missing bootstrap IDs by running handshake |
Run sourcerykit doctor --fix to automatically re-create missing bootstrap IDs without going through the full init wizard again.
Checks performed:
Example output (all checks pass):
🩺 SourceryKit Doctor
✅ API key + org: API key valid, org found (1 org(s))
✅ PostgreSQL: PostgreSQL connection successful
✅ Project name: 'my-project'
✅ Bootstrap IDs: All bootstrap IDs present
✅ Collection + IDs: Collection 'my-project' verified (middleware, db, schema, table, collection)
✅ Integration: Integration key format valid
All 6 checks passed!Example output (some checks fail):
🩺 SourceryKit Doctor
❌ API key + org: API key is invalid or expired — run 'sourcerykit init'
❌ PostgreSQL: PostgreSQL connection failed — check your SOURCERYKIT_POSTGRES_URL
✅ Project name: 'my-project'
❌ Bootstrap IDs: Missing: middleware_id, database_id — run 'sourcerykit doctor --fix'
❌ Collection + IDs: Bootstrap IDs missing — run 'sourcerykit doctor --fix'
❌ Integration: SOURCERYKIT_INTEGRATION_KEY is missing — run 'sourcerykit doctor --fix'
2/6 checks passed — run 'sourcerykit init' to fix
Submit feedback or bug reports.
sourcerykit feedback [--description TEXT] [--attach-file PATH]Options:
| Option | Description |
|---|---|
--description | Feedback description |
--attach-file | Path to file to attach |
Input: Interactive prompts for description and optional file attachment.
Non-interactive example:
sourcerykit feedback --description "Found a bug in the init flow" --attach-file logs.txtOutput: Sends feedback to the SourceryKit team.
Clear stored session token.
sourcerykit logoutOutput: Confirmation message. Run sourcerykit init to log in again.
Print the installed package version.
sourcerykit versionExample output:
v1.0Manage trusted endpoints (allowed URLs for HTTP interception).
Add a trusted endpoint to the allow-list.
sourcerykit endpoints add <URL> [--label LABEL]Arguments:
| Argument | Required | Description |
|---|---|---|
URL | **Yes** | Endpoint URL to trust |
Options:
| Option | Description |
|---|---|
--label/-l | Optional display label |
Example:
sourcerykit endpoints add https://api.example.com/data --label "Example API"Output:
✅ Endpoint added: https://api.example.com/data (Example API)Display all trusted endpoints in a table.
sourcerykit endpoints listExample output:
Trusted Endpoints
┌──────────────────────────────┬─────────────┬──────────┬─────────────┐
│ URL │ Label │ Policy │ Created by │
├──────────────────────────────┼─────────────┼──────────┼─────────────┤
│ https://api.example.com/data │ Example API │ v1 │ [email protected] │
└──────────────────────────────┴─────────────┴──────────┴─────────────┘Remove a trusted endpoint from the allow-list.
sourcerykit endpoints remove <URL>Arguments:
| Argument | Required | Description |
|---|---|---|
| URL | **Yes** | Endpoint URL to remove |
Options:
| Option | Description |
|---|---|
--yes / -y | Skip confirmation prompt |
Input: Confirmation prompt (unless --yes is passed).
Example:
sourcerykit endpoints remove https://api.example.com/data -yOutput:
✅ Endpoint removed: https://api.example.com/dataManage SourceryKit configuration.
Display the active configuration (global + local).
sourcerykit config list [--show-key]Options:
| Option | Description |
|---|---|
--show-key | Show secrets in clear text (default: masked) |
--show-key prints your API key and database password in clear text. Avoid using it in shared terminals or CI logs.
Example output:
📋 Global Config
PROVABLY_API_KEY = ***********************************1234
📋 Local Config (.env)
SOURCERYKIT_POSTGRES_URL = 'postgresql://user:***@host:5432/db'
SOURCERYKIT_PROJECT_NAME = 'my-project'Interactively update configuration variables.
sourcerykit config set [--api-key KEY] [--postgres-url URL] [--project-name NAME]Options:
| Option | Description |
|---|---|
--api-key | Set PROVABLY_API_KEY |
--postgres-url | Set SOURCERYKIT_POSTGRES_URL |
--project-name | Set SOURCERYKIT_PROJECT_NAME |
Input: Interactive checkbox to select variables to update:
Non-interactive example:
sourcerykit config set --project-name new-name
sourcerykit config set --postgres-url "postgresql://user:pass@newhost:5432/db"Output: Saves changes and re-bootstraps if database or project name changed.
View and inspect traces (recorded agent actions and HTTP intercepts).
Show all traces with intercept outcome counts.
sourcerykit trace list [--limit N] [--page P]Options:
| Option | Description |
|---|---|
--limit / -n | Rows per page (default: 20) |
--page / -p | Page number, 1-based (default: 1) |
Example output:
Traces
┌──────────────────────────────────────┬──────────────┬─────────────────────┬───────┬────────┬───────┐
│ ID │ Task │ Created │ Pass │ Caught │ Error │
├──────────────────────────────────────┼──────────────┼─────────────────────┼───────┼────────┼───────┤
│ 123e4567-e89b-12d3-a456-426614174000 │ get_data │ 2026-06-30 10:00:00 │ 2 │ 0 │ 0 │
└──────────────────────────────────────┴──────────────┴─────────────────────┴───────┴────────┴───────┘
Show details of a single trace and its intercepts.
sourcerykit trace show <ID> [--save-proof]Arguments:
| Argument | Required | Description |
|---|---|---|
ID | **Yes** | Trace ID (UUID) |
Options:
| Option | Description |
|---|---|
--save-proof | Download and save proofs to .provably files |
Example:
sourcerykit trace show 123e4567-e89b-12d3-a456-426614174000Example output:
Trace 123e4567-e89b-12d3-a456-426614174000
Task: get_data
Created: 2026-06-30 10:00:00
Intercepts
┌───┬────────────┬──────────────────────────┬─────────────────┬─────────┬────────┐
│ # │ Action │ Source │ Mode │ Claimed │ Outcome│
├───┼────────────┼──────────────────────────┼─────────────────┼─────────┼────────┤
│ 1 │ get_data │ https://api.example.com │ field_extraction│ value1 │ PASS │
└───┴────────────┴──────────────────────────┴─────────────────┴─────────┴────────┘
1. get_data → PASS
SQL: SELECT * FROM intercepts WHERE ...
Proof:
Status: verified
Verified: true
Exec time: 45ms
Result: {
"field": "value1"
}
Run with --save-proof to download the full proof.
Error (trace not found):
Trace abc123 not found.| Problem | Cause | Fix |
|---|---|---|
| Session expired | Token expired or invalidated | Run sourcerykit init to re-login |
| Cannot reach Provably API | Network or firewall issue | Check connectivity; verify SOURCERYKIT_PROVABLY_API_URL if using a custom endpoint |
| Missing bootstrap IDs | Incomplete init or corrupted .env | Run sourcerykit doctor --fix |
| PostgreSQL connection failed | Wrong URL or DB not reachable | Check SOURCERYKIT_POSTGRES_URL in .env; ensure the database is publicly accessible |
| API key invalid | Wrong key or expired | Run sourcerykit init to re-authenticate and fetch a new key |
| Config not loading | Missing global or local config | Run sourcerykit doctor to identify which values are missing |