Shortcuts
A few commands do more than call one operation. They cover what people do all day: watch a job, wait for it, and edit a rule.
Following a job log¶
clarive job logs 1234 # the log so far clarive job logs JOB-00012 --follow # keep printing new entries until the job ends clarive job logs 1234 --levels warn,error # only warnings and errors clarive job logs 1234 --follow --interval 5s
Jobs are named by their mid or their name (JOB-00012, INTE-15258).
--follow (-f) polls the log with the since_id cursor of job.logs,
so each entry is printed once, and stops when the job reaches a final
status. -o json prints the entries as JSON instead.
Deploying and waiting¶
job create takes the environment and the changesets as positional
arguments. With --wait it does not return until the job ends:
clarive job create QA 101,102 # create (schedule) the job and return clarive job create QA 101,102 --wait # ... and wait for it clarive job create QA 101,102 --wait --logs # ... printing its log meanwhile clarive job create PROD 103 --wait --wait-timeout 1h
job wait waits for a job that already exists:
clarive job wait JOB-00012 clarive job wait 1234 --logs --wait-timeout 30m
Both exit with code 0 when the job finished OK and code 9 when it ended
in any other final status (error, cancelled, rejected, expired...).
--wait-timeout gives up after that long (the job goes on running), and
--interval sets how often the status is polled (2 seconds by default).
Before creating a job, these help:
clarive job list-transitions 101 # where changeset 101 can be promoted or demoted clarive calendar check-window QA 2026-11-20 --changesets 101 # when it may deploy to QA that day clarive job estimate QA 101 # how long it usually takes, and how often it works
check-window with --changesets looks at the same calendars job create
enforces: the environment's, and those of the projects, infrastructure and
revisions the changesets touch. Without it, only the global calendars count.
Reading and editing rules as HCL¶
Rules can be read and written as HCL text (see HCL):
clarive rule get 42 --hcl > deploy-web.hcl # the rule as HCL clarive rule get "Deploy web" --hcl # by name
rule edit does the whole round trip:
clarive rule edit 42 clarive rule edit "Deploy web" --editor 'code -w'
- It downloads the rule as HCL and opens it in
$VISUAL,$EDITORorvi(or the--editoryou give; GUI editors need their "wait" flag). - When you close the editor, it checks the text with
hcl.check: syntax, meaning, compilation and the rule critic. If there are errors, it shows them and offers to edit again. - It saves the rule as a new version.
It saves against the version you started from. If someone else saved the
rule meanwhile, it asks whether to overwrite their change instead of doing
it silently; without a terminal it stops with a conflict (exit code 6).
--overwrite saves anyway and --no-check skips step 2. If you close the
editor without changes, it prints No changes and saves nothing. When it
does not save, your text stays in the temporary file it names, so no edit
is lost.
To save an HCL file you edited another way:
clarive hcl check --hcl @deploy-web.hcl --rule 42 clarive hcl save-rule --rule 42 --hcl @deploy-web.hcl
Versions¶
clarive version # the CLI's version and build clarive version --server # and the server's