Quick Start
Get started with the pfy CLI in minutes.
Prerequisites
- Installed pfy CLI
- ProductifyFW Manager URL and Personal Access Token (PAT)
1. Authenticate
Login to your ProductifyFW Manager:
pfy login \
--server https://manager.example.com \
--token your-personal-access-tokenThis saves your credentials to ~/.pfy/config.yaml for future commands.
Creating a Personal Access Token
Generate a PAT from the Manager UI:
- Navigate to Settings → Personal Access Tokens
- Click Create Token
- Copy the token (it won't be shown again)
2. Initialize Your Project
Initialize a new project with auto-detected configuration:
# Create a new project directory
mkdir my-project && cd my-project
# Initialize with auto-detection (Go or Node.js)
pfy init --name my-projectThis creates project.yaml with:
- Project name and ID
- Initial version (0.1.0)
- Auto-detected CI configuration (GitHub/GitLab, Go/Node.js)
- Base environment settings
Example project.yaml:
project_name: my-project
project_id: proj_abc123
version: 0.1.0
ci:
type: github
language: go
registry: ghcr.io
image_name: my-project
environments:
- name: development
domain: dev.example.com3. Sync from Manager (Optional)
If your project already exists in Manager, sync its configuration:
pfy sync --project-id <project-id>This pulls project metadata and updates project.yaml automatically.
4. Manage Version
Use semantic versioning for your project:
# Check current version
pfy version show
# Output: 0.1.0
# Bump patch version (0.1.0 → 0.1.1)
pfy version bump
# Bump minor version (0.1.1 → 0.2.0)
pfy version bump --part minor
# Set specific version
pfy version set --version 1.0.05. Generate CI/CD Templates
Create CI/CD pipelines that use your project configuration:
# Generate GitHub Actions workflow
pfy ci update
# Or for GitLab CI
# (detected automatically from project.yaml)
pfy ci updateThis creates .github/workflows/ci.yml or .gitlab-ci.yml with:
- Docker build using
from project.yaml - Auto-versioning on main branch pushes
- Multi-platform builds (linux/amd64, linux/arm64)
6. List Projects
View all projects in your Manager:
pfy project listExample output:
Projects:
- My SaaS Platform (my-saas): A multi-tenant SaaS application
- E-commerce Store (ecommerce): Online retail platform7. Create a Tenant
Add a tenant to your project:
# First, get the project ID
pfy project get --slug my-project
# Create the tenant using the project ID
pfy tenant create \
--project-id <project-id> \
--slug my-tenant \
--name "My Tenant" \
--description "First tenant"8. Create an Application
Deploy an application for your tenant:
# Get the tenant ID
pfy tenant list --project my-project
# Create the application
pfy application create \
--tenant-id <tenant-id> \
--slug my-app \
--name "My Application" \
--version "1.0.0" \
--description "Production application"9. List Applications
View all applications in a tenant:
pfy application list --tenant my-tenantCommon Workflows
New Project from Scratch
# 1. Initialize project with auto-detection
cd my-new-project
pfy init --name my-saas
# 2. Review generated configuration
cat project.yaml
# 3. Bump version for first release
pfy version bump --part minor # 0.1.0 → 0.2.0
# 4. Generate CI/CD pipeline
pfy ci update
# 5. Commit and push
git add project.yaml .github/workflows/ci.yml
git commit -m "Initialize project with pfy"
git pushExisting Project Setup
# 1. Get project ID from Manager
pfy project list
# 2. Sync configuration
pfy sync --project-id <project-id>
# 3. Update CI templates with synced config
pfy ci update
# 4. Verify version
pfy version showDevelopment to Production Workflow
# 1. Initialize project
pfy init --name my-saas
# 2. Create Manager resources
PROJECT_ID=$(pfy project create --slug my-saas --name "My SaaS Platform" | grep "ID:" | awk '{print $2}')
# 3. Sync Manager metadata to local config
pfy sync --project-id $PROJECT_ID
# 4. Create development tenant
pfy tenant create \
--project-id $PROJECT_ID \
--slug dev \
--name "Development Environment"
# 5. Create production tenant
pfy tenant create \
--project-id $PROJECT_ID \
--slug prod \
--name "Production Environment"
# 6. Create application in dev using project version
DEV_TENANT_ID=$(pfy tenant list --project my-saas | grep "dev" | awk '{print $1}')
VERSION=$(pfy version show)
pfy application create \
--tenant-id $DEV_TENANT_ID \
--slug web-app \
--name "Web Application" \
--version $VERSION
# 7. Bump version for release
pfy version bump --part minor
# 8. Promote to production with new version
APP_ID=$(pfy application list --tenant dev | grep "web-app" | awk '{print $1}')
PROD_TENANT_ID=$(pfy tenant list --project my-saas | grep "prod" | awk '{print $1}')
pfy application promote \
--application-id $APP_ID \
--target-tenant-id $PROD_TENANT_ID
# Uses version from project.yaml automaticallyCI/CD with Auto-Versioning
# 1. Initialize and configure
pfy init --name my-app
pfy ci update
# 2. Push to main branch
git add .
git commit -m "Initial commit"
git push origin main
# 3. CI automatically:
# - Bumps patch version (0.1.0 → 0.1.1)
# - Builds Docker image (my-app:0.1.1)
# - Commits version change with [skip ci]
# - Pushes version tag (v0.1.1)
# 4. For feature releases, bump manually:
pfy version bump --part minor # 0.1.1 → 0.2.0
git add project.yaml
git commit -m "Bump to v0.2.0 for new features"
git push
# CI uses the manual version (0.2.0) for the buildUsing Environment Variables
Instead of flags, use environment variables:
export PFY_MANAGER_URL="https://manager.example.com"
export PFY_MANAGER_TOKEN="your-token"
# Commands now use these automatically
pfy project listVerbose Output
Get detailed information about what's happening:
pfy --verbose project listExample verbose output:
Connecting to ProductifyFW manager...
Fetching projects list...
Found 2 project(s)
Projects:
- My SaaS Platform (my-saas): A multi-tenant SaaS application
ID: 01234567-89ab-cdef-0123-456789abcdef
- E-commerce Store (ecommerce): Online retail platform
ID: 12345678-9abc-def0-1234-56789abcdef0Quiet Mode
Minimize output for scripting:
pfy --quiet project create --slug prod --name "Production"Next Steps
- Project Configuration Guide - Deep dive into project.yaml
- Version Management - Semantic versioning best practices
- Auto-Versioning in CI/CD - Automated version bumps
- Command Reference - All available commands
- CI/CD Templates - GitHub Actions and GitLab CI setup
Getting Help
Get help for any command:
# General help
pfy --help
# Command-specific help
pfy project --help
pfy project create --help