Skip to content

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:

  1. User Configuration (~/.pfy/config.yaml) - Authentication and global settings
  2. Project Configuration (project.yaml) - Project metadata and CI/CD settings
  3. 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 minimal would skip the proxy + IdP)
  • pfy dev seed (planned) - Would idempotently create project, tenant, application, and machine user, writing .env.productify.dev and dev.productify.json for the integration libraries and shims
  • pfy dev proxy (planned) - Would be a loopback-only reverse proxy injecting the production header contract (and window.__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 it
  • pfy platform render|deploy - Renders the platform's own stack (Manager, proxy, identity provider, database) for Nomad or Compose from a single install.yaml
  • pfy deploy diff - Shows a three-way drift view: spec vs. committed artifact vs. running cluster
  • pfy deployment get|set|snapshot|apply - Scripts the deployment spec, or snapshots it into the repo for commit-anchored review
  • pfy proxy diff|sync - Compares and force-pushes the Manager-rendered proxy config

Developer Workflows

  • Project Initialization - Initialize projects with pfy init and 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

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)              │
└─────────────────────────────────────────────────┘