GitHub
Reference

CLI

pfai is the command-line client for ProxifAI — 60 top-level commands covering tasks, code, cloud, AI gateway, and platform admin, with kubectl-style verbs and structured output.

pfai is the command-line client for ProxifAI. It talks to the same API your browser uses, so anything you can click in the web UI you can script — managing tasks and projects, browsing repos and pull requests, dispatching agents, running pipelines, configuring providers, and more. The CLI is built on Cobra and follows kubectl-style verbs (list/ls, view/get, delete/rm) with structured output (table, JSON, YAML) for easy piping.

Install

pfai is published as a single static binary on the proxifai-oss releases page for macOS and Linux on both amd64 and arm64.

# Pick the right asset for your OS/arch from the latest release.
# Example for macOS arm64:
curl -L -o pfai \
  https://github.com/proxifai/proxifai-oss/releases/latest/download/pfai-darwin-arm64
chmod +x pfai
sudo mv pfai /usr/local/bin/
pfai version

Available assets: pfai-linux-amd64, pfai-linux-arm64, pfai-darwin-amd64, pfai-darwin-arm64.

git clone https://github.com/proxifai/proxifai-oss.git
cd proxifai-oss
go install ./cmd/pfai
# Or, for a tagged release without a clone:
go install github.com/proxifai/proxifai-oss/cmd/pfai@latest

Requires Go 1.25+.

The pfai binary is bundled inside the main proxifai Docker image at /usr/local/bin/pfai, so anything running in the platform’s containers (agents, pipeline jobs) can call it directly. There’s no separate CLI image.

Verify the install:

pfai version
pfai auth ping --server https://your-proxifai-host

Authenticate

pfai auth login runs a PKCE OAuth flow: it spins up a tiny local callback server, opens your browser to the workspace’s authorization endpoint (Keycloak by default), exchanges the code for a long-lived pfai token, and writes it to ~/.proxifai/credentials.json.

pfai auth login                            # opens a browser
pfai auth login --no-browser               # prints the URL instead
pfai auth login --as work                  # save under a named context
pfai auth status                           # who am I, and is my token valid
pfai auth token                            # decode the active token's JWT claims
pfai auth ping                             # health-check the server
pfai auth logout                           # clear stored credentials

For non-interactive environments (CI, scripts) you have three options:

ApproachWhen to use
PFAI_TOKEN + PFAI_SERVER env varsStandard CI usage
pfai context add ci --server … --token …Multiple servers/identities to switch between
pfai auth login --as ci then export the token from ~/.proxifai/contexts.yamlOne-time setup, then ship the token as a secret

PFAI_EXECUTION_ID is set automatically inside agent containers by the workflow runtime, so commands like pfai exec status work without extra wiring.

Contexts

A context bundles a server URL + token + identity under a name. Switch between them without re-logging in:

pfai context ls                # all configured contexts
pfai context current           # active context name
pfai context use prod          # make 'prod' the active context
pfai context add staging --server https://staging.example.com --token
pfai context rm old-prod       # delete a context
pfai --context staging task ls # one-shot override (also -C)

The active context lives in ~/.proxifai/contexts.yaml; the canonical credentials file remains ~/.proxifai/credentials.json.

Global flags

Every command accepts these:

FlagShortDescription
--output <fmt>-oOutput format: table (default), json, yaml, name
--jsonShorthand for -o json
--query <expr>-qJMESPath expression to filter JSON output
--yes-ySkip confirmation prompts (destructive ops auto-accept)
--server <url>Override PFAI_SERVER for this call
--token <token>Override PFAI_TOKEN for this call
--context <name>-CUse a non-active context for this call
--debugLog HTTP requests/responses + a curl repro to stderr
--dry-runPrint the request and exit without calling the server

Output format precedence: -o flag → --json → context’s saved format → table.

Output formats

pfai task ls                           # human-readable table (default)
pfai task ls -o json                   # full JSON, one record per row
pfai task ls -o yaml                   # YAML for piping into kustomize/etc.
pfai task ls -o name                   # IDs only, one per line — pipe to xargs
pfai task ls --json -q '[?priority==`high`].id'   # JMESPath filter

The name format is built for shell composition:

# Cancel every running pipeline:
pfai pipeline ls --status running -o name | xargs -n1 pfai pipeline cancel

Verb aliases

Every CRUD subcommand has both forms — pick whichever your fingers prefer:

CanonicalAlias
listls
viewget
deleterm

So pfai task list, pfai task ls, and pfai task get <id> all work.

Command reference

60 top-level commands organized into 6 Cobra groups, plus a handful of utilities. Run pfai <command> --help for full subcommand docs.

Core

CommandWhat it does
pfai taskIssues / tasks: list, view, create, update, delete, dispatch to an agent, comment
pfai projectProjects: full CRUD plus members, status, milestones
pfai sprintSprints: list, view, create, set active, add/remove tasks
pfai initiativeInitiatives (roadmap-level groupings)
pfai requestCustomer requests (intake feed)
pfai custom-fieldDefine custom fields per team and per entity
pfai workflowWorkflows: full CRUD, run/publish/promote/versions, export/import/restore, executions/logs/cancel/retry/resume, artifacts
pfai execInside-agent commands: report status, log, stream, mark file changed, post output

Code

CommandWhat it does
pfai repoRepositories: list, view, create, clone, browse
pfai branchBranches: list, view, create, delete
pfai commitCommit history
pfai prPull requests: list, view, create, merge, diff, comment, review
pfai tagGit tags
pfai releaseReleases and assets
pfai pipelineCI/CD: list, view, jobs, logs, rerun, cancel, dispatch, list workflow files
pfai fileRead/write repository files via API
pfai compareCompare two refs
pfai codeintelCode-intelligence: search, context, impact, communities, processes, index
pfai branch-protectionBranch protection rules
pfai push-rulePush rules (commit message, file size, etc.)
pfai approval-rulePR approval rules
pfai protected-tagProtected tags
pfai deploy-keyDeploy keys

Cloud

CommandWhat it does
pfai cloudManage virtual clusters, workloads, deployments, port-forwards, exec, db dumps. Multiple contexts.
pfai deployOpen a forge PR with auto-generated k8s/ Kustomize manifests and .proxifai/config.yaml for the current repo. Shortcut for the Cloud quickstart flow.

Platform

CommandWhat it does
pfai secretWorkspace secrets (env-injected into pipelines/agents)
pfai triggerEvent-rule triggers — fire workflows on platform events
pfai integrationSlack, GitHub, etc.; plus webhook subscriptions per integration
pfai outbound-webhookOutbound webhook subscriptions (org-level)
pfai event-typeEvent-type catalog (built-in + custom)
pfai model-providerLLM provider rows (model_provider table) — see AI Gateway
pfai provider-keyPersonal LLM API keys (BYOK)
pfai model-defaultDefault model per use case (general / chat / embedding)
pfai gatewayGateway usage + budgets + rate limits

Collaboration

CommandWhat it does
pfai inboxNotifications: list, view, mark read, snooze
pfai ticketCustomer support tickets (Backoffice)
pfai docCollaborative documents
pfai labelLabels (issues, PRs, etc.)
pfai commentComments — across tasks, PRs, docs
pfai viewSaved views (filters)
pfai agentAgent definitions: list/view/create/update/delete and view executions
pfai starredYour starred items
pfai kbKnowledge base: search, suggest, chat (interactive AI chat with streaming), doc (list/view/ingest/rm), conv (conversation history)
pfai searchCross-entity search
pfai timeTime entries

Admin

CommandWhat it does
pfai teamTeams: members, settings
pfai orgOrganizations: members, settings
pfai tokenAPI tokens — list, create, rotate, revoke
pfai configCLI configuration
pfai contextNamed server/identity contexts (covered above)
pfai authAuthentication (covered above)
pfai audit-logAudit log
pfai adminSuperuser ops: cross-org listing, view, update; user management
pfai activityRecent activity feed

Utility

CommandWhat it does
pfai api <METHOD> <path> [body]Direct API passthrough — useful for endpoints not yet wrapped
pfai logs <kind>/<id>Stream logs from any async resource (executions, pipeline jobs, …)
pfai wait <kind>/<id>Block until an async resource reaches a terminal state
pfai diagPrint a redacted support bundle for bug reports
pfai versionPrint the CLI version
pfai completionGenerate shell completion (bash, zsh, fish, powershell)

Examples

# Triage: list high-priority open tasks assigned to me, JSON to jq
pfai task ls --status open --priority high --assignee @me --json | jq '.'

# Open the first PR I haven't reviewed in my browser
pfai pr ls --review-requested @me -o name | head -1 | xargs pfai pr view --web

# Dispatch a task to an agent
pfai task dispatch task_42 --agent claude-code --branch main

# Watch a pipeline run to completion, then exit non-zero if it failed
pfai pipeline rerun run_123
pfai wait pipeline-run/run_123

# Tail logs for the latest workflow execution
pfai workflow executions --latest -o name | xargs pfai logs

# Drive a workflow from a script
pfai workflow run wf_42 --param key=value
pfai workflow logs $(pfai workflow executions wf_42 --latest -o name)

# Bulk update labels: add 'needs-review' to all PRs older than 3 days
pfai pr ls --updated-before "3 days ago" -o name | \
  xargs -I{} pfai pr update {} --add-label needs-review

# Direct API for an endpoint without a wrapper:
pfai api GET /api/v1/forge/repos
pfai api POST /api/v1/forge/repos '{"name":"new-repo","private":true}'

Shell completion

# bash
pfai completion bash > ~/.local/share/bash-completion/completions/pfai

# zsh (with oh-my-zsh-style fpath)
pfai completion zsh > "${fpath[1]}/_pfai"

# fish
pfai completion fish > ~/.config/fish/completions/pfai.fish

Completion includes context names for pfai context use / --context and resource IDs for verbs that take them.

Environment variables

VariableUsed byDescription
PFAI_SERVERevery commandServer URL (overridden by --server and active context)
PFAI_TOKENevery commandAuth token (overridden by --token and active context)
PFAI_EXECUTION_IDpfai exec*Active execution; auto-set in agent containers

See also