CLI Overview
The Cortask CLI (cortask) gives you full control over the platform from your terminal. It can start the gateway server, open interactive chat sessions, manage configuration, and administer every resource that the web UI exposes -- providers, models, sessions, skills, cron jobs, channels, and more.
When to use the CLI vs the web UI
| Use the CLI when you want to... | Use the web UI when you want to... |
|---|---|
| Script or automate Cortask operations | Browse sessions and workspaces visually |
Run a quick one-shot prompt (cortask run) | Have a rich chat interface with streaming |
| Manage config, credentials, or cron from a shell | Monitor usage dashboards and channel status |
| Work over SSH or in headless environments | Access Cortask from a browser on any device |
Both interfaces talk to the same gateway backend and share the same data directory, so changes made in one are immediately visible in the other.
Installation
The CLI ships as part of the cortask npm package:
npm install -g cortask
After installation the cortask binary is available globally.
First-time setup
Run the setup command to create the data directory and default configuration:
cortask setup
This writes a config.yaml with sensible defaults (Anthropic provider, port 3777, 25 max turns) and creates the skills directory. If a configuration already exists, pass --force to overwrite it.
Next, store your LLM API key:
cortask credentials set provider.anthropic.apiKey YOUR_KEY
Register a workspace and start chatting:
cortask workspaces add my-project /path/to/project
cortask chat -w /path/to/project
Basic usage pattern
Every command follows the same structure:
cortask <command> [subcommand] [arguments] [options]
Run cortask --help to list all top-level commands, or append --help to any command for detailed usage:
cortask config --help
cortask models enable --help
Starting the gateway
Most administrative commands (channels, dashboard) require the gateway to be running:
cortask serve # default: 127.0.0.1:3777
cortask serve -p 4000 # custom port
The gateway exposes the REST API, WebSocket endpoint, and serves the web UI as static files.