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.

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 > Project config > User config > Environment variables > 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

Developer Workflows

  • Project Initialization - Initialize projects with pfy init and sync from manager
  • Version Management - Automated semantic versioning with pfy version
  • Application Promotion - Promote applications between tenants (environments)
  • Application Copying - Copy applications to different tenants
  • CI/CD Integration - Generate parameterized pipeline templates with auto-versioning
  • Nomad Deployment - Automated Nomad job deployment with version management
  • 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)              │
└─────────────────────────────────────────────────┘