CLI
The pfy CLI is the command-line interface for the Productify Framework, designed for managing projects, tenants, applications, and development workflows from your terminal.
Overview
The pfy CLI provides a type-safe, GraphQL-powered interface to interact with the ProductifyFW Manager, enabling automation, scripting, and streamlined development workflows.
Key Features
Type-Safe GraphQL Client
Built on hasura/go-graphql-client for compile-time validation and type safety.
Login
pfy login --server <url> --token <PAT> saves a manually-issued Personal Access Token and manager URL to ~/.pfy/config.yaml; CI keeps using PFY_MANAGER_TOKEN. A browser single sign-on flow that signs you in through the platform's identity provider and provisions a PAT automatically (no token copy-paste, works over SSH) is planned but not yet implemented — see Known Issues. See login.
Hierarchical Configuration
Multiple levels of configuration:
- User Configuration (
~/.pfy/config.yaml) - Authentication and global settings - Project Configuration (
project.yaml) - Project metadata and CI/CD settings - Command Flags - Per-command overrides
Priority order: Command flags > Environment variables > User config > Defaults
Resource Management
Complete CRUD operations for:
- Projects - Top-level organization units
- Tenants - Multi-tenant isolation within projects
- Applications - Deployable application instances
- Language Packs - Internationalization support
Local Development Stack (planned)
A pfy dev command is planned to own the local platform lifecycle, but it does not exist yet — see Known Issues. For local environments today, use Docker Compose deployment directly.
pfy dev up(planned) - Would boot Manager, database, identity provider, and proxy from embedded, version-pinned compose templates (--profile minimalwould skip the proxy + IdP)pfy dev seed(planned) - Would idempotently create project, tenant, application, and machine user, writing.env.productify.devanddev.productify.jsonfor the integration libraries and shimspfy dev proxy(planned) - Would be a loopback-only reverse proxy injecting the production header contract (andwindow.__PRODUCTIFY__) without an OIDC round-trip
Deployment Artifact Generation
Since the Wave 3 release train, deploy artifacts render from specs, never hand-written — see Generated Artifacts. pfy nomad deploy renders the full job (the old image = rewriter survives only behind --legacy-rewrite for one minor).
pfy nomad render|deploy- Renders the application's Nomad job (ports, health checks, migration prestart, secrets templates, scaling policy) from the deployment spec stored in the Manager, then validates/plans/runs itpfy platform render|deploy- Renders the platform's own stack (Manager, proxy, identity provider, database) for Nomad or Compose from a singleinstall.yamlpfy deploy diff- Shows a three-way drift view: spec vs. committed artifact vs. running clusterpfy deployment get|set|snapshot|apply- Scripts the deployment spec, or snapshots it into the repo for commit-anchored reviewpfy proxy diff|sync- Compares and force-pushes the Manager-rendered proxy config
Developer Workflows
- Project Initialization - Initialize projects with
pfy initand sync from manager - Version Management - Automated semantic versioning with
pfy version - Environment Promotion - Copy application configuration between environments (dev → staging → production)
- CI/CD Integration - Generate parameterized pipeline templates with auto-versioning
- Language Packs - Manage internationalization through language pack commands
Shell Completion
Auto-completion support for Bash, Zsh, and Fish shells.
Technology Stack
- Language: Go 1.25+
- CLI Framework: urfave/cli/v3
- GraphQL Client: hasura/go-graphql-client
- Configuration: YAML (gopkg.in/yaml.v3)
Architecture
┌─────────────────────────────────────────────────┐
│ pfy CLI │
│ ┌──────────────────────────────────────────┐ │
│ │ Command Handlers (urfave/cli) │ │
│ └──────────────────────────────────────────┘ │
│ ┌──────────────────────────────────────────┐ │
│ │ Configuration Management (YAML) │ │
│ │ • Flags • Env Vars • Config File │ │
│ └──────────────────────────────────────────┘ │
│ ┌──────────────────────────────────────────┐ │
│ │ GraphQL Client (hasura/go-graphql) │ │
│ │ • Type-safe queries and mutations │ │
│ │ • Bearer token authentication │ │
│ └──────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘
│
│ GraphQL over HTTPS
▼
┌─────────────────────────────────────────────────┐
│ Manager Backend │
│ (GraphQL API + PostgreSQL) │
└─────────────────────────────────────────────────┘Quick Links
- Installation - Install and set up the CLI
- Quick Start Guide - Get started in minutes
- Configuration - User-level authentication and settings
- Project Configuration - Project-level configuration with
project.yaml - Version Management - Semantic versioning and automation
- Auto-Versioning in CI/CD - Automated version bumping in pipelines
- Nomad Deployment - Deploying to Nomad with automated versioning
- Command Reference - Complete command documentation
- API Implementation - GraphQL integration details