Skip to content

CLI Installation

The pakyas CLI wraps your jobs and talks to the Pakyas API. It provides:

  • Start, success, and failure pings with the job’s exit code
  • The tail of the job’s error output attached to failure pings
  • Check, project, and API key management from the terminal
  • A local slug cache so pings by slug don’t call the API every time
Terminal window
curl -fsSL https://pakyas.com/install.sh | sh

The script downloads the release for your platform (macOS or Linux, x86_64 or ARM64), verifies its SHA-256 checksum, and installs pakyas to ~/.local/bin. If ~/.local/bin is not on your PATH, the script prints the line to add to your shell profile.

Installer options are environment variables, set on the sh side of the pipe:

VariableDescription
PAKYAS_INSTALL_DIRInstall directory (default ~/.local/bin)
PAKYAS_VERSIONInstall a specific version, for example 0.1.9 (default: latest)
PAKYAS_NO_VERIFYSkip checksum verification (not recommended)
Terminal window
# Install system-wide (for example in a Docker image, running as root)
curl -fsSL https://pakyas.com/install.sh | PAKYAS_INSTALL_DIR=/usr/local/bin sh
# Pin a version
curl -fsSL https://pakyas.com/install.sh | PAKYAS_VERSION=0.1.9 sh

Windows is not supported by the installer; use WSL.

Download pakyas-<version>-<target>.tar.gz for your platform from the releases page, extract it, and put the pakyas binary on your PATH. Each archive has a matching .sha256 file.

Terminal window
cargo install --git https://github.com/Pakyas-Monitoring/pakyas-cli
Terminal window
pakyas --version
Terminal window
pakyas update # install the latest version
pakyas update --check # only report whether an update is available

The CLI also checks for updates in the background (at most once a day) and prints a notice on stderr after the command finishes. The check is skipped for ping, monitor, and completion, when stderr is not a terminal, when CI is set, and with --no-update-check or PAKYAS_NO_UPDATE_CHECK=1. See update.

Terminal window
pakyas login

Opens your browser, lets you pick an organization, and stores an API key for it in the CLI’s config directory. The first project of the organization becomes the default project.

Terminal window
pakyas login --api-key pk_live_xxx

Stores the key for the organization it belongs to. For CI and other non-interactive environments you don’t need to log in at all: set PAKYAS_API_KEY, or use --public-id to ping without any key. See CLI and Cron Setup.

Check what the CLI will use:

Terminal window
pakyas whoami

See auth for logout, auth status, and managing keys for several organizations.

State lives in one directory per user:

PlatformDirectory
macOS~/Library/Application Support/com.pakyas.pakyas/
Linux~/.config/pakyas/ (or $XDG_CONFIG_HOME/pakyas/)
Windows%APPDATA%\pakyas\pakyas\config\

It contains config.toml (active organization, default project, preferences), credentials.json (API keys per organization), and cache/ (slug cache and update check). Set PAKYAS_CONFIG_DIR to use another directory.

Common environment variables:

VariableDescription
PAKYAS_API_KEYAPI key; overrides stored credentials
PAKYAS_ORGOrganization ID or name
PAKYAS_PROJECTProject ID, slug, or name
PAKYAS_FORMATDefault output format
PAKYAS_CONFIG_DIRConfig directory

Settings are resolved in this order: command-line flag, environment variable, config.toml, built-in default. The full list is on CLI Configuration.

FlagEnv VarDefaultDescription
--org <ORG>PAKYAS_ORGsaved orgOrganization ID or name (an ID avoids a lookup)
--project <PROJECT>PAKYAS_PROJECTdefault projectProject ID, slug, or name
--format <FMT>PAKYAS_FORMATtabletable, json, ndjson, or yaml
-v, --verbose-offExtra diagnostics on stderr
--no-update-checkPAKYAS_NO_UPDATE_CHECKoffSkip the background update check
--ignore-env-offIgnore PAKYAS_API_KEY for this command
--display-tz <TZ>PAKYAS_DISPLAY_TZlocalTimezone for timestamps: local or utc
--time <MODE>PAKYAS_TIMEbothTime display: relative, absolute, or both
--no-colorNO_COLORoffDisable colored output
--plain-offASCII labels instead of symbols
--debug-http-offPrint API requests, statuses, and response bodies to stderr (never headers or keys)

Global flags can go before or after the subcommand. Which commands honor --format is listed under Output Formats.

CommandDescription
login, logout, whoami, authAuthentication and stored credentials
orgList and switch organizations
projectList and create projects, set the default
checkList, create, show, update, pause, resume, delete, logs, sync
check inspectCurrent state and configuration of a check
check doctorDiagnose a check
check tailShow and follow timeline events
pingSend a single ping
monitorRun a command and report start, success, or failure
api-keyCreate, list, and revoke API keys
completionShell completion scripts
updateUpdate the CLI
Terminal window
# Pick a project for new checks
pakyas project list
pakyas project default production
# Create checks
pakyas check create backup-nightly --cron "0 2 * * *" --tz Asia/Manila
pakyas check create api-heartbeat --every 5m
# List all checks in the organization
pakyas check list
# Wrap a job
pakyas monitor backup-nightly -- /usr/local/bin/backup.sh
# Send a ping manually
pakyas ping api-heartbeat

monitor passes the job’s stdout and stderr through unchanged and writes nothing to stdout itself, so redirects work as expected:

Terminal window
pakyas monitor db-dump -- pg_dump -h localhost mydb > backup.sql
CodeMeaning
0Success
1Other errors, or check doctor findings at or above --fail-on
2Usage error
3Not found
4Temporary failure (network, rate limit, server error): safe to retry
5Not logged in, or the API key was rejected
6Permission denied
7Unexpected response from the API

See Exit Codes for details. CLI versions before 0.1.10 exit 1 for every error.

pakyas monitor exits with the wrapped command’s own exit code, or 3 if the run could not be recorded in Pakyas. See monitor exit codes.