kestractl
Use kestractl to interact with the Kestra host API for flows, executions, namespaces, and namespace files.
For server components, plugins, and system maintenance commands, see the Kestra Server CLI.
Installation
curl -fsSL https://raw.githubusercontent.com/kestra-io/kestractl/main/install-scripts/install.sh | bashQuick Setup
Open Source (basic auth)
kestractl config add default http://localhost:8080 main --username YOUR_USERNAME --password YOUR_PASSWORD --defaultEnterprise (API token)
kestractl config add default https://kestra.example.com production --token YOUR_TOKEN --defaultYour configuration is saved at ~/.kestractl/config.yaml and the default context is used automatically.
contexts: default: host: https://kestra.example.com tenant: production auth_method: token token: YOUR_TOKENdefault_context: defaultFor basic auth contexts, auth_method is basicAuth and the file stores username and password instead of a token.
Usage
Examples
# Deploy flows, then run one and wait for completionkestractl flows deploy ./flows --namespace prod --override --fail-fastkestractl executions run prod nightly-refresh --wait --output json# Sync namespace files for a releasekestractl nsfiles upload prod ./assets --path resources --override --fail-fast# List flows as JSONkestractl flows list my.namespace --output jsonCommand groups
config: manage authentication contexts.flows: list, get, deploy, and validate flows.executions: run and inspect executions.namespaces: list and filter namespaces.nsfiles: list, get, upload, and delete namespace files.
Use kestractl --help or kestractl <command> --help for the full command reference.
Configuration
Global flags
--host- Kestra host URL--tenant- Tenant name--token/-t- API token (Enterprise)--username- Basic auth username (Open Source)--password- Basic auth password (Open Source)--output/-o- Output format (tableorjson)--config- Custom config file path (default:~/.kestractl/config.yaml)--verbose/-v- Verbose output (warning: prints credentials in HTTP requests)
Config file and contexts
Manage contexts with kestractl config add, kestractl config show, kestractl config use, and kestractl config remove.
Environment variables
Environment variables override config file settings. Use either KESTRACTL_TOKEN or KESTRACTL_USERNAME and KESTRACTL_PASSWORD.
export KESTRACTL_HOST=http://localhost:8080export KESTRACTL_TENANT=mainexport KESTRACTL_TOKEN=YOUR_TOKENexport KESTRACTL_USERNAME=adminexport KESTRACTL_PASSWORD=adminexport KESTRACTL_OUTPUT=jsonConfiguration precedence
- Command-line flags (
--host,--token, etc.) - Environment variables (
KESTRACTL_HOST,KESTRACTL_TOKEN, etc.) - Config file (
~/.kestractl/config.yamlor custom via--config) - Default values
Override per command
kestractl flows get my.namespace my-flow \ --host https://kestra.example.com \ --tenant production \ --token YOUR_TOKENWas this page helpful?