Python SDK
The official Python SDK for VibeControls provides async/await access to the full GraphQL API.
Install
pip install vibecontrols-sdk
Development install:
git clone https://github.com/algoshred/vibecontrols-sdk-python.git
cd vibecontrols-sdk-python
python -m venv venv && source venv/bin/activate
pip install -e ".[dev]"
Environment selection
The SDK endpoint defaults to production. Select a different environment by passing the appropriate endpoint in VibeControlsConfig:
| Environment | Workspace endpoint | Global endpoint |
|---|---|---|
prod (default) | https://graphqlworkspaces.burdenoff.com/workspaces/graphql | https://graphql.burdenoff.com/global/graphql |
alpha | https://alphagraphqlworkspaces.burdenoff.com/workspaces/graphql | https://alphagraphql.burdenoff.com/global/graphql |
local | http://localhost:4003/workspaces/graphql | http://localhost:4000/global/graphql |
Set BURDENOFF_ENV=local|alpha|prod in your shell if your app consumes it to choose endpoints, or pass them explicitly to VibeControlsConfig.
Quick start
import asyncio
from vibecontrols_sdk import VibeControlsSDK, VibeControlsConfig
async def main():
sdk = VibeControlsSDK(VibeControlsConfig(
workspace_endpoint="https://graphqlworkspaces.burdenoff.com/workspaces/graphql",
global_endpoint="https://graphql.burdenoff.com/global/graphql",
))
# Sign in with email/password
auth = await sdk.auth.sign_in("user@example.com", "password")
print(f"Signed in as {auth['user']['fullName']}")
# List vibes
vibes = await sdk.vibes.list()
for v in vibes:
print(f"Vibe: {v['name']} ({v['type']})")
# List sessions
sessions = await sdk.sessions.list()
for s in sessions:
print(f"Session: {s['name']} — {s['status']}")
await sdk.close()
asyncio.run(main())
Configuration
from vibecontrols_sdk import VibeControlsConfig
config = VibeControlsConfig(
workspace_endpoint="https://graphqlworkspaces.burdenoff.com/workspaces/graphql",
global_endpoint="https://graphql.burdenoff.com/global/graphql",
# OAuth2 (optional, for device code / PKCE / client credentials flows)
oidc_issuer="https://auth.burdenoff.com",
client_id="vibecontrols-cli",
client_secret=None, # Only for client credentials flow
redirect_uri=None, # Only for PKCE flow
# Pre-existing tokens (optional)
api_key=None,
access_token=None,
refresh_token=None,
workspace_token=None,
timeout=30.0, # Request timeout in seconds
auto_refresh=True, # Auto-refresh tokens before expiry
on_token_refresh=None, # Callback for external token persistence
)
Authentication flows
Email / password
auth = await sdk.auth.sign_in("user@example.com", "password")
Device code (CLI / headless)
device = await sdk.auth.start_device_code_flow()
print(f"Visit {device['verification_uri_complete']} and enter code {device['user_code']}")
# SDK polls automatically until the user authorizes
PKCE (browser-based)
challenge = sdk.auth.build_authorization_url()
# Redirect user to challenge["url"]
# After callback:
result = await sdk.auth.exchange_auth_code(code, challenge["codeVerifier"])
Client credentials (machine-to-machine)
config = VibeControlsConfig(
workspace_endpoint="https://graphqlworkspaces.burdenoff.com/workspaces/graphql",
global_endpoint="https://graphql.burdenoff.com/global/graphql",
client_id="my-service",
client_secret="secret",
)
sdk = VibeControlsSDK(config)
# Tokens are obtained automatically on first request
Modules
All methods are async. Access each module as a property on the VibeControlsSDK instance.
| Module | Property | Description |
|---|---|---|
| Auth | sdk.auth | Sign in/up, sign out, token refresh, device code, PKCE, client credentials |
| Agents | sdk.agents | Agent CRUD, heartbeat, probes, plugin management |
| Vibes | sdk.vibes | Vibe (project/workspace) CRUD and management |
| Sessions | sdk.sessions | Terminal session management |
| Notes | sdk.notes | Note CRUD operations |
| Configuration | sdk.configuration | Key-value configuration management |
| Webhooks | sdk.webhooks | Webhook CRUD and management |
| Docs | sdk.docs | Documentation site management |
| VibeDeck | sdk.vibedeck | VibeDeck management (decks and buttons) |
| Targets | sdk.targets | Target machine management |
| Audit | sdk.audit | Audit log queries |
| UI Session | sdk.ui_session | UI session state management |
| Tunnels | sdk.tunnels | Agent tunnel management |
| AI Tool Events | sdk.ai_tool_events | AI tool event tracking |
Error handling
from vibecontrols_sdk.errors import (
VibeControlsError,
AuthenticationError,
AuthorizationError,
NetworkError,
ValidationError,
RateLimitError,
DeviceCodeExpiredError,
DeviceCodeDeniedError,
)
try:
await sdk.auth.sign_in("user@example.com", "wrong")
except AuthenticationError:
print("Invalid credentials")
except NetworkError:
print("Could not reach the API")
except VibeControlsError as e:
print(f"SDK error: {e}")
Development
# Create virtual environment
python -m venv venv && source venv/bin/activate
# Install with dev dependencies
pip install -e ".[dev]"
# Format
black src/ tests/ examples/
isort src/ tests/ examples/
# Lint
flake8 src/ tests/ examples/
mypy src/
# Test
pytest
pytest --cov=vibecontrols_sdk --cov-report=html
# Build
python -m build
Source
- Repository:
github.com/algoshred/vibecontrols-sdk-python - Package:
vibecontrols-sdkon PyPI