CLI Installation
The pakyas CLI is the recommended way to integrate with Pakyas. It provides:
- Automatic exit code capture
- Start/success/fail ping handling
- Error output capture
- Local check caching for fast slug resolution
Installation
Section titled “Installation”macOS & Linux
Section titled “macOS & Linux”curl -fsSL https://pakyas.com/install.sh | bashManual Installation
Section titled “Manual Installation”Download the binary for your platform from the releases page and add it to your PATH.
Verify Installation
Section titled “Verify Installation”pakyas --versionUpdating
Section titled “Updating”To update the CLI to the latest version:
pakyas updateTo check if an update is available without installing:
pakyas update --checkAuthentication
Section titled “Authentication”Browser Authentication (Recommended)
Section titled “Browser Authentication (Recommended)”pakyas loginThis opens your browser for secure OAuth authentication.
API Key Authentication
Section titled “API Key Authentication”pakyas login --api-key pk_live_xxxFor CI/CD or headless environments, use an API key.
Configuration
Section titled “Configuration”The CLI stores configuration in ~/.config/pakyas/:
config.toml- Active organization and projectcredentials.toml- Authentication tokenscache.toml- Local check cache
Environment Variables
Section titled “Environment Variables”| Variable | Description |
|---|---|
PAKYAS_ORG | Override active organization |
PAKYAS_PROJECT | Override active project |
PAKYAS_API_KEY | API key for authentication |
Global Flags
Section titled “Global Flags”These flags can be used with any pakyas command:
| Flag | Default | Env Var | Description |
|---|---|---|---|
--display-tz <TZ> | local | PAKYAS_DISPLAY_TZ | Timezone for timestamps: local or utc |
--time <MODE> | both | PAKYAS_TIME | Time display: relative, absolute, or both |
--no-color | off | NO_COLOR | Disable colored output |
--plain | off | - | Plain output without symbols/emojis |
--debug-http | off | - | Print HTTP requests/responses to stderr |
--format <FMT> | table | PAKYAS_FORMAT | Output format: table, json, ndjson, yaml |
Commands
Section titled “Commands”Organization Management
Section titled “Organization Management”# List organizationspakyas org list
# Switch active organizationpakyas org switch "My Org"Project Management
Section titled “Project Management”# List projectspakyas project list
# Switch active projectpakyas project switch "Production"
# Create new projectpakyas project create --name "Production" --description "Production checks"Check Management
Section titled “Check Management”# List checkspakyas check list
# Create a check with cron schedulepakyas check create backup-nightly --cron "0 2 * * *"
# Create with timezone overridepakyas check create daily-report --cron "0 9 * * *" --tz America/New_York
# Create with intervalpakyas check create api-heartbeat --every 5m
# Create with custom name and gracepakyas check create db-backup --name "Database Backup" --every 1h --grace 10m
# Interactive modepakyas check create my-check -i
# Dry-run to preview what would be createdpakyas check create my-check --cron "0 2 * * *" --dry-run
# JSON output for scriptingpakyas check create deploy-check --every 1h --json
# Just the ping URLpakyas check create deploy-check --every 1h --quiet
# Show check detailspakyas check show backup-nightly
# Update a checkpakyas check update backup-nightly --every 12hpakyas check update backup-nightly --cron "0 3 * * *" --tz Asia/Manila
# Pause/resume a checkpakyas check pause backup-nightlypakyas check resume backup-nightly
# Delete a check (prompts for confirmation)pakyas check delete my-check
# Delete without confirmation (use in scripts)pakyas check delete my-check -ypakyas check delete my-check --yes
# View ping history (default: 50 entries)pakyas check logs backup-nightly
# Limit to specific number of entriespakyas check logs backup-nightly --limit 100pakyas check logs backup-nightly --limit 10Duration Formats
Section titled “Duration Formats”The CLI accepts flexible duration formats:
30s,30 seconds5m,5 minutes1h,1 hour2d,2 days
Smart Grace Period
Section titled “Smart Grace Period”If you don’t specify --grace, the CLI automatically calculates a sensible default:
- 10% of the check interval/period
- Minimum 5 minutes, maximum 1 hour
- Shown as “(auto)” in output
Sending Pings
Section titled “Sending Pings”# Send success pingpakyas ping backup-nightly
# Send start pingpakyas ping backup-nightly --start
# Send fail pingpakyas ping backup-nightly --fail
# Send with exit codepakyas ping backup-nightly --exit-code 1Wrapping Commands
Section titled “Wrapping Commands”The monitor command wraps a command with automatic pings:
# Basic usagepakyas monitor backup-nightly -- /path/to/backup.sh
# With argumentspakyas monitor db-sync -- pg_dump -h localhost mydb > backup.sqlThis automatically:
- Sends
/startping - Runs the command
- Captures exit code and stderr
- Sends success or failure ping with details
Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
| 0 | Command succeeded |
| 1-2 | Command failed (original exit code) |
| 3 | Monitoring infrastructure failure |
Exit code 3 indicates Pakyas itself failed (network error, auth issue, etc.). The wrapped command still ran.
Next Steps
Section titled “Next Steps”- auth command - Manage authentication and stored credentials
- api-key command - Create and manage API keys
- check doctor - Diagnose check configuration issues
- check inspect - View detailed check state
- check tail - Stream check events in real-time
- completion command - Shell completion setup
- monitor command - Detailed monitor usage
- ping command - Manual ping sending
- update command - Self-update the CLI
- External Monitors - Migration from other services