Commands
The CLI has no fixed list of commands. It asks the server for its
catalog of operations (GET /api/v2/ops) and makes one command per
operation:
clarive <namespace> <operation> [positional arguments] [--flags]
The operation job.list_states is the command clarive job list-states:
underscores become dashes (the underscore spelling works too). A new
operation on the server becomes a new command as soon as the CLI refreshes
its catalog.
Finding the right command¶
Describe the task in a few words:
clarive api search job log # ops whose name or description match clarive api search topic status --kind write # only ops that change data clarive api search --namespace rule version clarive api describe job.logs # what it does, its params, kind and permission
Or browse:
clarive --help # the namespaces clarive job --help # the operations of a namespace clarive job logs --help # one operation: its flags, positional arguments and permission
api describe and each operation's --help say whether it is a read
operation (changes nothing), a write operation, or a destructive
one (deletes or overwrites), and which permission it needs.
Parameters¶
Every parameter of the operation is a flag of the command. Some
operations also take their main parameters as positional arguments, in
the order --help shows:
clarive job get 1234 # job = 1234 clarive topic change-status 4321 "In Review" # mid = 4321, status = "In Review" clarive server execute web01 uptime # server = web01, cmd = uptime clarive job list --status RUNNING --limit 10
Flags take the parameter's type:
| Type | How to pass it |
|---|---|
| string | --title "foo bar"; --hcl @rule.hcl reads a file and @- reads stdin |
| integer, number | --limit 5 |
| boolean | --only-open, --only-open=false |
| array | --tags a --tags b, --tags a,b or --tags '["a","b"]' |
| object | --meta '{"x":1}', --meta @meta.json or --meta @meta.yaml |
| file | --file ./app.tgz (uploaded) |
Only the flags you give are sent; the server fills in the defaults.
Required parameters are checked before anything is sent, and every
parameter is checked again by the server, which answers invalid_params
with every problem it found.
A parameter whose name is also a global flag of the CLI (timeout,
output, url, profile...) is passed as --arg-<name>. For example
file.put has a timeout parameter for the remote copy:
clarive file put web01 /opt/app/app.tgz --file ./app.tgz --arg-timeout 600
The operation's --help shows these flags with their arg- names.
Raw parameters from a file¶
For operations with many or nested parameters, give them all at once as JSON or YAML. Flags given on the command line are merged on top:
clarive job create --params @job.yaml clarive topic create --params '{"category":"Change","title":"foo"}' --title "bar" cat params.json | clarive topic update --params @-
Calling an operation by name¶
api call runs any operation by its full name with key=value
parameters, which is handy in scripts that build the operation name:
clarive api call job.list limit=5 status=RUNNING clarive api call topic.get mid=4321 format=values
Files¶
Operations that receive a file take it as a file parameter, uploaded
from a local path:
clarive topic upload-file 4321 --field attachments --file ./report.pdf clarive artifact upload repo1 builds/app-1.2.tgz --file ./app-1.2.tgz
Operations that return a file (downloads, exports, job runner logs) save
it in the current directory under the name the server gives it. -O
chooses where:
clarive topic download-file 4321 report.pdf -O ./downloads/ clarive job runner-log JOB-00012 -O job.log clarive rule export-yaml 42 -O - # to stdout
The CLI never overwrites an existing file with a name chosen by the
server, and refuses server names that start with a dot or contain a path
separator: the name comes from data other users can write. Give an
explicit -O <path> to choose the name; that one may overwrite.
Destructive operations¶
On a terminal, destructive operations ask before running:
$ clarive topic delete 4321 topic.delete is destructive (Delete a topic (it goes to the trash)). Continue? [y/N]
--yes (-y) answers for you, which scripts need. When the CLI is not
attached to a terminal and --yes is missing, it refuses to run them, with
exit code 1 and aborted. That includes AI agents running clarive from a
shell tool: give them --yes only for what the user approved.
clarive api call of an operation the cached catalog does not know asks the
server for its catalog first, so the operation's real kind decides; if the
server cannot be asked, the call is confirmed like a destructive one.
The catalog¶
The catalog of each profile is cached in $XDG_CACHE_HOME/clarive/
(~/.cache/clarive/ by default). A server reached with --url or
CLARIVE_URL instead of a profile's own, or with no profile at all, has its
catalog cached apart, under its URL. It is refreshed:
- when you log in;
- automatically, when the cached copy is more than a day old;
- on demand with
clarive api refresh, for example after an upgrade of the server.
CLARIVE_NO_REFRESH=1 turns the automatic refresh off. Until a catalog
has been downloaded, the CLI uses the one built into its binary, so
--help works offline.
The catalog only lists operations; it does not decide what you may do.
Permissions are checked by the server on every call, so a command you can
see may still answer forbidden.
Namespaces¶
The operations are grouped in namespaces. The counts are those of this release; a server of another version may have a few more or fewer.
| Namespace | Ops | What it covers |
|---|---|---|
api |
3 | Discover the API itself: search ops and read their schemas |
artifact |
9 | Artifact repositories: browse, search, download, upload, tag and delete artifacts |
auth |
9 | Log in, tokens and who am I: personal access tokens for the CLI, MCP and REST clients |
baseline |
1 | Environments (baselines, bl): the targets jobs deploy to |
calendar |
7 | Calendars: the deployment windows that say when jobs may run in each environment |
category |
14 | Topic categories: their fields, statuses and workflow, and category administration |
ci |
22 | Resources (CIs): classes, search, read, create, update, delete, relations, versions and CI services |
config |
4 | Advanced settings: the config.* keys stored in the database, per environment and namespace |
daemon |
7 | Daemons: the background services the dispatchers run (job, event, scheduler daemons...) |
dashboard |
3 | Dashboards: the rule and personal dashboards a user can open, and their dashlets |
docker |
6 | Docker on the Clarive host: list, start, stop and delete images and containers |
event |
6 | Events: the registered event types and the log of fired events with the rules they ran |
file |
9 | Ship files to and from servers: put, get, list, stat, mkdir, delete, write, sync |
group |
10 | User groups: members, and the roles in projects every member inherits |
hcl |
7 | HCL: read, check, format and save rules as HCL text; plan and apply HCL configuration |
job |
30 | Jobs: deploy changesets, follow job logs and control running jobs |
kanban |
12 | Kanban boards: create and share boards, read their topic lists, move cards |
label |
5 | Topic labels: list them and administer the label catalog |
message |
6 | The user inbox: internal messages and the notification emails Clarive sent to a user |
notification |
7 | Notifications: which events send email to whom (users, roles, emails, fields...), scoped by project, category, status... |
project |
12 | Projects: the caller's projects, their members and roles, repositories and environments |
repl |
5 | The REPL: evaluate Perl or SQL on the Clarive server (administrators) and manage saved scripts |
repo |
20 | Git repositories: branches, tags, commits, files and diffs; create branches and tags, merge |
report |
5 | Reports: personal and public topic reports, internal reports and rule reports; list, read, run and save |
role |
8 | Roles: the permission actions (with bounds) granted to users and groups in projects |
rule |
28 | Rules: list, read, write, version, check and run automation rules (pipelines, events, forms...) |
sbom |
12 | SBOMs and vulnerabilities: the packages of a release, their findings and fixes, analyses and triage |
scheduler |
11 | Scheduler: rules that run on a schedule (frequency, workdays) and their last log |
semaphore |
6 | Semaphores: the slots that serialize jobs and their queues of waiting requests |
server |
4 | Run commands on servers through their agents (ssh, clax, worker...) and check connectivity |
status |
5 | Topic statuses: list them and administer the status catalog |
system |
20 | Server information, license, maintenance mode, cache, registry, help docs and broadcast system messages |
topic |
35 | Topics: search, read, create, update, change status, comments, files, relations, labels and efforts |
trash |
6 | Trash: deleted topics, CIs and rules, with restore and permanent delete |
user |
14 | Users: accounts, passwords, preferences and their roles in projects |
variable |
5 | Variables: per-environment values of variable resources and of projects, secrets masked |
worker |
11 | Manage cla-worker agents: list, find by tags, run commands, enable, rename, shut down, passkey |
Run clarive <namespace> --help for the operations of each one.