Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.selftune.dev/llms.txt

Use this file to discover all available pages before exploring further.

Two auth systems

selftune Cloud uses two authentication mechanisms for different access patterns:

Dashboard auth (browser)

The web dashboard uses GitHub OAuth:
  1. User clicks “Sign in with GitHub”
  2. On first login, a user record and default organization are created
  3. Session is maintained via secure cookies

CLI auth (API keys)

The CLI uses Bearer token authentication with API keys:
  • Keys are prefixed with st_live_*
  • Keys are SHA-256 hashed in the database — only the prefix is stored in clear
  • All API requests include Authorization: Bearer <API_KEY> header

Device code flow

For CLI agents that don’t have browser access (headless servers, CI environments), selftune implements the OAuth 2.0 Device Authorization Grant:
  1. CLI creates a device code:
    POST /api/v1/device-code
    
  2. CLI displays a user code and verification URL
  3. User opens browser and visits the verification URL
  4. User enters the code and approves
  5. CLI polls for approval:
    GET /api/v1/device-code/poll
    
  6. On approval, a new API key is generated and returned to the CLI
The raw API key is returned exactly once during the device code flow, then NULLed from the database. Store it securely.

Creating API keys

Via dashboard

  1. Go to Settings > API Keys
  2. Click Create API Key
  3. Copy the key immediately — it won’t be shown again

Via CLI

selftune init --alpha
Or for re-linking:
selftune alpha relink

Roles and permissions

Organizations use a 4-level RBAC hierarchy:
PermissionViewerMemberAdminOwner
View skills, evals, sessionsYesYesYesYes
Push data, manage API keysYesYesYes
Configure alerts, invite membersYesYes
Delete org, change roles, billingYes

Multi-tenancy

All data is scoped by organization. Users can belong to multiple organizations via memberships.