Configuration
Configure the pfy CLI for authentication and customized behavior.
Configuration Hierarchy
The CLI uses a three-level priority system for configuration:
- Command-line flags (highest priority)
- Environment variables
- Config file at
~/.pfy/config.yaml(lowest priority)
Authentication
Using the Login Command
The recommended way to configure authentication:
pfy login \
--server https://manager.example.com \
--token your-personal-access-tokenThis creates ~/.pfy/config.yaml with your credentials:
manager_url: https://manager.example.com
token: your-personal-access-tokenEnvironment Variables
Set credentials via environment:
export PFY_MANAGER_URL="https://manager.example.com"
export PFY_MANAGER_TOKEN="your-token"Add to your shell profile for persistence:
# ~/.bashrc or ~/.zshrc
export PFY_MANAGER_URL="https://manager.example.com"
export PFY_MANAGER_TOKEN="your-token"Command-line Flags
Override configuration per command:
pfy --manager https://staging.example.com \
--token staging-token \
project listConfiguration File
Location
- Default:
~/.pfy/config.yaml - Created automatically by
pfy login
Format
manager_url: https://manager.example.com
token: your-personal-access-tokenManual Creation
Create the configuration directory and file:
mkdir -p ~/.pfy
cat > ~/.pfy/config.yaml <<EOF
manager_url: https://manager.example.com
token: your-personal-access-token
EOFSet secure permissions:
chmod 600 ~/.pfy/config.yamlGlobal Flags
Available on all commands:
Connection Flags
--manager string
Manager URL in format http(s)://host:port
Env: PFY_MANAGER_URL
Config: manager_url
--token string
Personal Access Token for authentication
Env: PFY_MANAGER_TOKEN
Config: token
--insecure-skip-tls-verify
Skip TLS certificate verification (not recommended for production)Output Flags
--verbose, -v
Enable verbose output with detailed information
--quiet, -q
Minimize output (useful for scripting)
--ci
Indicate CI/CD environment executionMultiple Environments
Manage multiple Manager instances using different config files:
Development
# Use dev config
pfy --manager https://dev.example.com \
--token dev-token \
project listStaging
# Use staging config
pfy --manager https://staging.example.com \
--token staging-token \
project listProduction
# Use production config from default config file
pfy project listEnvironment-specific Aliases
Create shell aliases for different environments:
# ~/.bashrc or ~/.zshrc
alias pfy-dev='pfy --manager https://dev.example.com --token dev-token'
alias pfy-staging='pfy --manager https://staging.example.com --token staging-token'
alias pfy-prod='pfy --manager https://prod.example.com --token prod-token'Usage:
pfy-dev project list
pfy-staging application create --tenant-id <id> --slug app --name "App"
pfy-prod project listTLS Configuration
Skip TLS Verification
For development with self-signed certificates:
pfy --insecure-skip-tls-verify project listSecurity Warning
Never use --insecure-skip-tls-verify in production environments. This disables certificate validation and makes you vulnerable to man-in-the-middle attacks.
Custom CA Certificates
If using custom CA certificates, add them to your system trust store:
Linux
sudo cp your-ca.crt /usr/local/share/ca-certificates/
sudo update-ca-certificatesmacOS
sudo security add-trusted-cert -d -r trustRoot \
-k /Library/Keychains/System.keychain your-ca.crtCI/CD Integration
GitHub Actions
name: Deploy with pfy
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install pfy CLI
run: |
curl -LO https://github.com/ProductifyFW/cli/releases/latest/download/pfy-linux-amd64
chmod +x pfy-linux-amd64
sudo mv pfy-linux-amd64 /usr/local/bin/pfy
- name: Deploy
env:
PFY_MANAGER_URL: ${{ secrets.PFY_MANAGER_URL }}
PFY_MANAGER_TOKEN: ${{ secrets.PFY_TOKEN }}
run: |
pfy --ci project listGitLab CI
deploy:
image: golang:1.25
variables:
PFY_MANAGER_URL: $MANAGER_URL
PFY_MANAGER_TOKEN: $MANAGER_TOKEN
script:
- curl -LO https://github.com/ProductifyFW/cli/releases/latest/download/pfy-linux-amd64
- chmod +x pfy-linux-amd64
- mv pfy-linux-amd64 /usr/local/bin/pfy
- pfy --ci project listConfiguration Best Practices
- Never commit tokens - Use
.gitignorefor config files - Use environment variables for CI/CD
- Rotate tokens regularly - Create new PATs periodically
- Use separate tokens for different environments
- Set restrictive permissions -
chmod 600 ~/.pfy/config.yaml - Use verbose mode for debugging -
--verboseflag - Use quiet mode for scripts -
--quietflag for parseable output
Troubleshooting
Authentication Errors
# Verify configuration
cat ~/.pfy/config.yaml
# Test connection with verbose output
pfy --verbose project list
# Re-authenticate
pfy login --server https://manager.example.com --token new-tokenConnection Issues
# Check Manager URL accessibility
curl https://manager.example.com/query
# Test with verbose mode
pfy --verbose --manager https://manager.example.com project listToken Issues
If your token isn't working:
- Verify the token hasn't expired in the Manager UI
- Check token permissions and scopes
- Create a new token and re-authenticate
- Ensure token is correctly copied (no extra spaces)