CLI Cheatsheet
Local Development
Develop workflows locally against a Bifrost instance
Develop workflows locally using the Bifrost SDK and CLI. No Docker required - connect directly to your Bifrost instance.
Prerequisites
Section titled “Prerequisites”- Python 3.11+ installed
- pipx recommended for CLI installation (or pip)
- Access to a Bifrost instance (cloud or self-hosted)
Quick Start
Section titled “Quick Start”-
Install the Bifrost CLI:
The SDK is served directly from your Bifrost instance:
Terminal window pipx install https://your-instance.gobifrost.com/api/cli/downloadOr with pip:
Terminal window pip install https://your-instance.gobifrost.com/api/cli/downloadVerify the installation:
Terminal window bifrost help -
Authenticate:
Terminal window bifrost login --url https://your-instance.gobifrost.comThis opens your browser for authentication. Credentials are saved to
~/.bifrost/credentials.jsonand refresh automatically. -
Start developing - write workflows locally and test them against your instance
Creating Workflows
Section titled “Creating Workflows”Create Python files locally and test them with the CLI:
from bifrost import workflow, context
@workflowasync def hello_world(name: str): """A simple example workflow.""" return {"message": f"Hello, {name}!", "org": context.org_id}Test locally:
bifrost run hello_world.py -w hello_world -p '{"name": "Alice"}'Sync to the platform:
bifrost syncThis opens an interactive TUI where you can review entity changes (workflows, forms, agents, etc.) and file differences between local and remote. For each item, you can choose to push, pull, delete, or skip with smart defaults based on timestamps.
bifrost push and bifrost pull are available as convenience aliases that default to their respective directions.
Registering workflows
Section titled “Registering workflows”Pushing a .py file uploads it but does not make a @workflow, @tool, or @data_provider discoverable in the platform DB. Register the function explicitly so it can be referenced by forms, agents, and event subscriptions:
bifrost workflows register --path workflows/billing.py --function-name runPass --org <ref> to scope the workflow to a specific organization. To list orphaned entries (file moved or deleted), run bifrost workflows list-orphaned; to repoint one, use bifrost workflows replace.
Watch mode
Section titled “Watch mode”For continuous development, use watch mode:
bifrost watchThis watches the workspace and auto-pushes every saved file. Keep it running while you develop. The watch TUI shows structured log columns (time, action, path, user) with color coding.
Calling arbitrary API endpoints
Section titled “Calling arbitrary API endpoints”For anything the typed CLI commands don’t yet wrap, bifrost api sends an authenticated request to any endpoint:
bifrost api GET /api/workflowsbifrost api POST /api/applications/my-app/validatebifrost api POST /api/files/push @payload.json # @file = read JSON body from fileUsing SDK Features Locally
Section titled “Using SDK Features Locally”All SDK modules work in local development - they call the remote API using your saved credentials:
from bifrost import ai, knowledge, config
# AI completionsresponse = await ai.complete("Summarize this ticket")
# Knowledge storeawait knowledge.store("Policy content...", namespace="policies")results = await knowledge.search("refund policy", namespace="policies")
# Configurationapi_key = await config.get("external_api_key")IDE Setup
Section titled “IDE Setup”VS Code
Section titled “VS Code”Install the Python extension and configure your interpreter to the environment with the Bifrost SDK installed. The SDK provides full type hints.
Managing Credentials
Section titled “Managing Credentials”bifrost login --url https://your-instance.gobifrost.com # Authenticatebifrost logout # Clear credentialsTokens refresh automatically when expired. If refresh fails (e.g., password changed), run bifrost login again.
Self-Hosted Development
Section titled “Self-Hosted Development”For contributors developing the platform itself, use Docker Compose:
-
Clone the repository:
Terminal window git clone https://github.com/jackmusick/bifrost-api.gitcd bifrost-api -
Run setup and start with hot reload:
Terminal window ./setup.sh./debug.sh -
Access at
http://localhost:3000
| Service | Dev Behavior |
|---|---|
| api | Hot reload with uvicorn, debugpy on port 5678 |
| worker | Auto-restart on code changes |
| client | Vite dev server with HMR |
Next Steps
Section titled “Next Steps”Writing Workflows
AI-Assisted Development
SDK Reference