CLI reference
The CLI speaks to the same operation registry as the panel and the API. Anything you can do in the interface, you can do here, with the same authorisation and the same audit entry.
Getting around
klyrn # the usage block
klyrn version
klyrn status # server, services and health at a glance
klyrn health # every check and its last result
klyrn health --events # repairs attempted, and why
klyrn profile # the hardware profile and every tuned value with its reason
klyrn sites # list sites
klyrn jobs # recent jobs
klyrn job 118 # one job's steps and log
klyrn ops # every core operation, by name
klyrn runs as root on the server. It talks to klyrn-core over
the local socket, so it works whether or not the panel is reachable, which is exactly
when you want it.
klyrn ops is the honest index: it lists the operation registry itself, so it
cannot drift from what the server can actually do.
install · panel · license · update
klyrn install [--plan] [--rollback] [--force]
klyrn panel # URL, hostname, certificate state
klyrn panel hostname panel.example.com
klyrn panel hostname none
klyrn license status
klyrn license activate <key>
klyrn license refresh
klyrn license deactivate
klyrn update [--check] [--channel stable|beta|dev] [--version V] [--yes]
klyrn update status
klyrn update auto on|off
klyrn update window 03:00-05:00
klyrn update channel stable
klyrn notify # alert configuration
klyrn notify test
klyrn notify send "Subject" "Body text"
site
klyrn site create <domain> [--type php|static|wordpress|node|proxy] [--php 8.3]
[--account name] [--no-ssl] [--no-www] [--wait]
[--title T --admin-user U --admin-email E] (wordpress)
[--runtime 22] [--git URL] [--branch b]
[--start "npm start"] [--build "npm run build"] (node)
[--port 9000] (proxy)
klyrn site show <domain>
klyrn site set <domain> [--php V] [--docroot D] [--www alias|none]
[--memory-limit 512M] [--upload-max 64M] [--post-max 64M]
[--max-execution N] [--max-input-time N] [--max-input-vars N]
[--display-errors] [--reset-php]
klyrn site secrets <domain>
klyrn site logs <domain> [--kind access|error|php] [--lines 100]
klyrn site ssl <domain>
klyrn site suspend <domain> [--reason "..."]
klyrn site unsuspend <domain>
klyrn site delete <domain> [--remove-files]
klyrn site domain list <domain>
klyrn site domain add <domain> <name> [--redirect-to URL] [--code 301|302]
klyrn site domain remove <id>
klyrn site staging show <domain>
klyrn site staging create <domain> [--domain staging.example.com]
klyrn site staging refresh <domain>
klyrn site staging push <domain> --confirm <domain> [--files-only] [--data-only]
klyrn site diagnose <domain> [--repair <action>]
klyrn site wp <domain> [status | update [all|core|plugins|themes] [--no-backup]]
Flags may appear before or after the positional arguments on most commands.
install, health and verify-manifest want their flags
first.
wp
klyrn wp clone <source-domain> <new-domain> [--account name]
klyrn wp replace <domain> <search> <replace> [--apply] [--include-guids]
klyrn wp health <domain>
klyrn wp harden <domain> <disable-file-editor|disable-debug
|fix-wp-config-permissions|repair-file-permissions>
klyrn wp policy <domain> [--core manual|minor|all]
[--plugins manual|selected|all]
[--themes manual|selected|all]
[--select-plugins a,b] [--select-themes a,b]
[--backup | --no-backup]
klyrn wp policy run <domain>
See WordPress and WordPress staging for what each of these does.
db · backup · account
klyrn db list
klyrn db create <account> <name>
klyrn db delete <id>
klyrn db password <user-id>
klyrn db user-add <database-id> <username>
klyrn db user-delete <user-id>
klyrn db export <name>
klyrn db exports
klyrn db import <name> <file.sql|file.sql.gz>
klyrn backup list [domain]
klyrn backup create <domain>
klyrn backup restore <id> [--yes]
klyrn backup delete <id>
klyrn backup schedule <domain> daily|none [--keep 7]
klyrn backup remote
klyrn backup remote list [domain]
klyrn backup remote fetch <prefix>
klyrn backup remote delete <prefix>
klyrn backup key list
klyrn backup key export [<fingerprint>]
klyrn backup key rotate [--note "..."]
klyrn backup key import <klyrn-bk1-…> [--make-current] [--note "..."]
klyrn account quota [<account>] [--limit 10G|none] [--measure]
dns · php · app · node
klyrn dns connect [--kind cloudflare] [--label L] [--account A] [--token T]
klyrn dns providers
klyrn dns disconnect <id>
klyrn dns records <domain>
klyrn dns set <domain> <type> <name> <value> [--ttl N] [--priority N] [--id ID]
klyrn dns delete <domain> <record-id>
klyrn dns point <domain>
klyrn dns check <domain>
klyrn php extensions [--version 8.3] [--all]
klyrn php enable <extension> [--version 8.3]
klyrn php disable <extension> [--version 8.3]
klyrn php versions
klyrn app deploy <domain> --git <https-url> [--branch b]
klyrn app rollback <domain>
klyrn app env <domain> [KEY=VALUE ...] [--unset KEY]
klyrn app set <domain> [--start cmd] [--build cmd|-] [--health /path] [--memory MB]
klyrn app start|stop|restart <domain>
klyrn app logs <domain> [--lines 100]
klyrn app show <domain>
klyrn node # installed and available runtimes
klyrn dns connect reads the token from KLYRN_DNS_TOKEN if you
leave --token off, so it need not appear in your shell history.
user
klyrn user list
klyrn user create <email> [--name "Name"] [--role admin|reseller|customer]
[--reseller <id|email>] [--password ...] [--accounts a,b]
klyrn user reset <id|email>
klyrn user disable <id|email>
klyrn user enable <id|email>
klyrn user delete <id|email>
klyrn user totp-reset <id|email>
klyrn user reseller <id|email> <reseller-email|none>
klyrn user token <id|email> [--name N] [--days D] [--scopes read,sites]
klyrn user assign <account> <id|email|none>
klyrn user account-transfer <account> <new-owner-email>
klyrn user account-suspend <account> [--reason "..."]
klyrn user account-unsuspend <account>
klyrn user account-delete <account> --confirm <account>
[--backup-first] [--delete-remote-backups]
klyrn user token prints an API token once. Leaving --scopes off
gives the token its owner's full authority; see
the scope list for the nine scopes and what each
covers. --days 0 means it never expires.
import · recover
klyrn import cpanel </path/to/backup.tar.gz>
klyrn import directadmin </path/to/backup.tar.gz>
klyrn import archive </path/to/backup.tar.gz> # detect the kind
klyrn import ssh --host H [--port 22] [--user root] [--password P | --key file]
[--fingerprint SHA256:...]
[--account cpaneluser]
[--mode cpanel|files] [--domain example.com] [--path public_html]
[--db name:user:pass[@host]]
klyrn import list
klyrn import show <id>
klyrn import apply <id> [--account name] [--domains a,b] [--databases x,y]
[--no-cron] [--no-ssl]
klyrn import delete <id>
klyrn recover discover
klyrn recover run [--only a,b] [--overwrite] [--yes]
klyrn recover manifest
Scripting notes
A command that starts a job waits for it and streams its log by default; pass
--wait=false on the commands that offer it to get the job id back
immediately. Failures print to standard error prefixed klyrn: and exit
non-zero.
Two environment variables are read: KLYRN_DEBUG switches the daemons to debug
logging, and KLYRN_DNS_TOKEN supplies the DNS credential to
klyrn dns connect.
For automation from another machine, use the HTTP API with a scoped token rather than SSH
plus klyrn: it is the same registry, and the token can be narrowed to the
operations the script actually needs. See Developers.