Agentic Fabriq CLI Reference
The afctl command-line interface provides tools for managing authentication, tool connections, and applications in Agentic Fabriq.
Installation
pip install agentic-fabriq-sdkAfter installation, the afctl command will be available in your terminal.
Global Options
These options can be used with any command:
| Option | Description |
|---|---|
--config PATH | Path to configuration file |
--gateway-url URL | Gateway URL (default: https://dashboard.agenticfabriq.com) |
--tenant-id ID | Tenant ID |
--verbose | Enable verbose output |
Global Commands
afctl version
Show version information.
afctl versionafctl status
Show system status and configuration.
afctl statusOutput: A table showing gateway connection status, authentication status, and configuration file location.
afctl init
Initialize CLI configuration.
afctl init [OPTIONS]| Option | Type | Default | Description |
|---|---|---|---|
--gateway-url | string | https://dashboard.agenticfabriq.com | Gateway URL |
--tenant-id | string | None | Tenant ID |
--yes | flag | false | Skip confirmation and overwrite existing config |
Example:
afctl init --gateway-url https://dashboard.agenticfabriq.comAuthentication Commands (afctl auth)
afctl auth login
Login to Agentic Fabriq using OAuth2/PKCE flow. Opens your default browser for authentication with Keycloak. Tokens are securely stored locally.
afctl auth login [OPTIONS]| Option | Type | Default | Description |
|---|---|---|---|
--tenant-id | string | None | Tenant ID (optional, extracted from JWT) |
--keycloak-url | string | https://auth.agenticfabriq.com | Keycloak URL |
--org | string | None | Organization URL for team login (e.g., freebies.com). Routes to your org's dedicated authentication realm. |
--remote | flag | false | Use device code flow for headless/remote machines. Displays a URL and code — authorize from any browser without needing one on the machine. |
--yes | flag | false | Skip confirmation when already authenticated |
Examples:
# Individual user login
afctl auth login
# Team organization login
afctl auth login --org freebies.com
# Login with saved organization
afctl config set organization_url freebies.com
afctl auth login
# Device code flow (headless/remote machines — no browser needed)
afctl auth login --remote
# Combine: remote + org
afctl auth login --remote --org freebies.comafctl auth logout
Logout from Agentic Fabriq. Revokes tokens and clears local authentication state.
afctl auth logout [OPTIONS]afctl auth status
Show authentication status and token information.
afctl auth statusOutput: A table showing authentication status (authenticated/expired), name, email, user ID, tenant ID, organization ID, token expiration time, refresh token availability, and gateway URL.
afctl auth refresh
Refresh authentication token. Uses the refresh token to obtain a new access token without requiring interactive login.
afctl auth refresh [OPTIONS]afctl auth token
Display the current access token.
afctl auth token [OPTIONS]| Option | Type | Default | Description |
|---|---|---|---|
--full | flag | false | Show full token (warning: sensitive information) |
Examples:
# Show truncated token
afctl auth token
# Show full token
afctl auth token --fullafctl auth whoami
Display information about the currently authenticated user.
afctl auth whoamiOutput: A table showing name, email, user ID, and tenant.
MCP Broker (afctl broker)
Run a local MCP broker that connects coding agents (Claude Code, Cursor, Codex) to Agentic Fabriq. This command is typically not run manually — it is spawned automatically by the coding agent based on your MCP config.
afctl broker [OPTIONS]| Option | Type | Default | Description |
|---|---|---|---|
--agent | string | auto-detected | Override agent name (e.g., claude-code, cursor, codex). Normally auto-detected from parent process. |
--skip-detection | flag | false | Skip parent process detection (testing only). |
How it works:
- Communicates via stdio (JSON-RPC 2.0) with the coding agent
- Proxies MCP requests (list_tools, call_tool) to the Agentic Fabriq gateway via WebSocket
- Sends heartbeats every 60 seconds to keep the session alive
- Session auto-expires ~3 minutes after the broker process exits
- Transparently re-establishes session if the auth token expires
MCP config example (place in ~/.claude/mcp.json or ~/.cursor/mcp.json):
{
"mcpServers": {
"agentic-fabriq": {
"command": "afctl",
"args": ["broker"]
}
}
}Note: For Cursor Remote SSH, use the full path to afctl since remote sessions don't source your shell profile (e.g., /home/ubuntu/.af-venv/bin/afctl).
VM Management (afctl vm)
Manage local virtual machines for computer-use coding agents.
afctl vm serve
Start the local VM management server. Provides a REST API for creating, starting, stopping, and deleting QEMU-based VMs. Automatically connects to the Agentic Fabriq dashboard via WebSocket relay if authenticated.
afctl vm serve [OPTIONS]| Option | Type | Default | Description |
|---|---|---|---|
--port, -p | integer | 7865 | Port for the VM management server |
Examples:
# Start with default port
afctl vm serve
# Start on custom port
afctl vm serve --port 8080Prerequisites: QEMU must be installed (brew install qemu on macOS). Run afctl auth login before starting the server to enable dashboard integration. The relay connection persists even after your auth token expires.
Configuration Commands (afctl config)
afctl config show
Show current configuration.
afctl config show [OPTIONS]afctl config set
Set a configuration value.
afctl config set KEY VALUESettable keys:
gateway_url- Gateway URLkeycloak_url- Keycloak URLoutput_format- Default output format (table,json,yaml)page_size- Default page size for list commands
Note: tenant_id cannot be set manually—it comes from authentication.
Examples:
afctl config set gateway_url https://dashboard.agenticfabriq.com
afctl config set output_format json
afctl config set page_size 50afctl config get
Get a configuration value.
afctl config get KEYReadable keys:
gateway_url,keycloak_url,keycloak_realm,keycloak_client_idtenant_id,output_format,page_size,config_fileverbose,authenticated
Example:
afctl config get gateway_urlafctl config reset
Reset configuration to defaults.
afctl config reset [OPTIONS]Tool Commands (afctl tools)
afctl tools list
List your tool connections (configured and connected tools).
afctl tools list [OPTIONS]| Option | Type | Default | Description |
|---|---|---|---|
--format | string | table | Output format (table, json, yaml) |
--page | int | 1 | Page number (starts from 1) |
--page-size | int | 20 | Items per page (1-100) |
--search | string | None | Search query (searches tool IDs and connection names) |
--tool | string | None | Filter by tool type (e.g., gmail, slack, google) |
Examples:
# List all connections
afctl tools list
# Paginate results
afctl tools list --page 2 --page-size 10
# Search by tool type
afctl tools list --search gmail
afctl tools list --search google
# Filter by tool type
afctl tools list --tool slack
# Combined search and filtering
afctl tools list --tool google --search gmailafctl tools get
Get tool connection details.
afctl tools get CONNECTION_ID [OPTIONS]Example:
afctl tools get my-gmailafctl tools add
Add a new tool connection with credentials.
afctl tools add TOOL [OPTIONS]| Option | Type | Required | Description |
|---|---|---|---|
--connection-id | string | Yes | Unique connection ID |
--method | string | Yes | api_credentials, oauth3 (platform OAuth), or oauth |
--display-name | string | No | Human-readable name |
--token | string | No | API token (for simple token auth) |
--client-id | string | No | OAuth client ID (for app-based auth) |
--client-secret | string | No | OAuth client secret |
--redirect-uri | string | No | OAuth redirect URI (auto-generated if not provided) |
Methods:
oauth3- Uses platform OAuth (recommended for Google, Slack, Notion, GitHub)api_credentials- Uses your own credentials (token or client ID/secret)
Examples:
# Platform OAuth (no credentials needed)
afctl tools add google_drive --connection-id google-work --method oauth3
afctl tools add slack --connection-id slack-work --method oauth3
afctl tools add notion --connection-id notion-work --method oauth3
afctl tools add github --connection-id github-work --method oauth3
# API token (Notion integration token, Slack bot token)
afctl tools add notion --connection-id notion-work --method api_credentials \
--token "secret_abc123"
# Your own OAuth app
afctl tools add google_drive --connection-id google-work --method api_credentials \
--client-id "123.apps.googleusercontent.com" \
--client-secret "GOCSPX-abc123"Supported Google tools: google_drive, google_docs, google_sheets, google_slides, gmail, google_calendar, google_meet, google_forms, google_classroom, google_people, google_chat, google_tasks
afctl tools connect
Complete OAuth connection (opens browser for authorization).
afctl tools connect CONNECTION_ID [OPTIONS]Example:
afctl tools connect my-gmailafctl tools disconnect
Disconnect a tool (remove credentials but keep connection entry).
afctl tools disconnect CONNECTION_ID [OPTIONS]Example:
afctl tools disconnect my-gmail
afctl tools disconnect my-gmail --forceafctl tools remove
Remove a tool connection completely (delete entry and credentials).
afctl tools remove CONNECTION_ID [OPTIONS]Example:
afctl tools remove my-gmail
afctl tools remove my-gmail --forceApplication Commands (afctl applications)
afctl applications register
Step 1: Register a new application (returns activation token).
afctl applications register [OPTIONS]| Option | Type | Required | Description |
|---|---|---|---|
--app-id | string | Yes | Application identifier (no spaces) |
--scopes | string | Yes | Scopes (format: provider:scope1,provider:scope2) |
--display-name | string | No | Display name for the application |
Example:
afctl applications register \
--app-id my-slack-bot \
--scopes slack:channels:read,slack:chat:write,google:gmail.send \
--display-name "My Slack Bot"Output: Returns an activation token (valid for 1 hour, single use).
afctl applications activate
Step 2: Activate an application (saves credentials locally).
afctl applications activate [OPTIONS]| Option | Type | Required | Description |
|---|---|---|---|
--app-id | string | Yes | Application identifier |
--token | string | Yes | Activation token from registration |
--idp-client-id | string | No | IdP Client ID (from Okta app) |
--idp-client-secret | string | No | IdP Client Secret |
--skip-idp | flag | No | Skip IdP configuration prompts |
Examples:
# Basic activation
afctl applications activate --app-id my-slack-bot --token <activation-token>
# With IdP credentials (for SSO organizations)
afctl applications activate --app-id my-bot --token <token> \
--idp-client-id 0oa... --idp-client-secret <secret>Output: Saves credentials to ~/.af/applications/{app_id}.json
afctl applications list
List all registered applications.
afctl applications list [OPTIONS]Example:
afctl applications list
afctl applications list --format jsonafctl applications show
Show details of a registered application.
afctl applications show APP_ID [OPTIONS]Examples:
afctl applications show my-slack-bot
afctl applications show my-slack-bot --reveal-secretafctl applications delete
Delete a registered application. Deletes the server registration, removes local credentials, and invalidates all active tokens.
afctl applications delete APP_ID [OPTIONS]Examples:
afctl applications delete my-slack-bot
afctl applications delete my-slack-bot --yesafctl applications test
Test application authentication. Attempts to exchange credentials for a token to verify the application is properly registered.
afctl applications test APP_IDExample:
afctl applications test my-slack-botConfiguration File
The CLI stores configuration at ~/.af/config.json:
{
"gateway_url": "https://dashboard.agenticfabriq.com",
"keycloak_url": "https://auth.agenticfabriq.com",
"tenant_id": "uuid-...",
"output_format": "table",
"page_size": 20
}Application credentials are stored in ~/.af/applications/{app_id}.json.
Environment Variables
The following environment variables can override configuration:
| Variable | Description |
|---|---|
AF_GATEWAY_URL | Gateway URL |
AF_KEYCLOAK_URL | Keycloak URL |
AF_TENANT_ID | Tenant ID |
Common Workflows
Individual User Setup
# Initialize and login
afctl init
afctl auth login
# Check status
afctl status
afctl auth whoamiTeam Organization Setup
# Login to organization
afctl auth login --org mycompany.com
# Or save organization in config
afctl config set organization_url mycompany.com
afctl auth loginAdding a Tool Connection
# Add connection with platform OAuth
afctl tools add gmail --connection-id my-gmail --method oauth3
# Complete OAuth
afctl tools connect my-gmail
# Verify
afctl tools get my-gmailRegistering an Application
# Step 1: Register
afctl applications register \
--app-id my-agent \
--scopes slack:chat:write,google:gmail.send
# Step 2: Activate (use the token from step 1)
afctl applications activate --app-id my-agent --token <token>
# Test authentication
afctl applications test my-agentNeed help?
Our team is here to help you get started.