hobhob

Automation reference

Look up the YAML fields, CLI commands, execution rules, and retained results for hob automations.

Use this reference for the detailed automation contract and examples. Start with Automations to build and run the guestbook check-and-review workflow. Continue with Building automations to add inputs, validated agent results, and deliberate failure behavior. Use Secrets, schedules, and trust to prepare unattended work.

Definition and bundle

Where automations live

ScopeLocationShared with team?
Shared.hob/automations/<uuid>/ in the project's canonical checkoutYes
Private{configDir}/automations/{projectID}/<uuid>/No
Global{configDir}/automations/global/<uuid>/No
Field or ruleContract
version, id, nameVersion 1, UUID identity, required display name. Installed directory UUID matches id; init generates it
description, categoryOptional description and grouping label
ActionExactly one of command or steps
commandShell source normalized to a foreground run step with id: main; source YAML remains unchanged
shell, surface, ptyTop-level forms only with command; explicit plans put them on the owning step
AssetsKeep scripts, templates, styles, and schemas inside the bundle; scripts/, assets/, and schemas/ are useful conventions
ValidationRejects unknown fields, extra YAML documents, symlinks, invalid identity, and oversized bundles
Bundle limitsAt most 256 supporting files and 16 MiB of supporting content
StagingOrdinary staging-directory names are accepted; installed bundles use UUID directories
DraftInactive until applied; retained for editing, absent from the runnable registry
Run snapshotCaptures the complete hash-checked bundle and static nested bundles; live edits do not change an admitted run

These definitions have the same execution plan:

Command shorthand
version: 1
id: 5af1c74e-f97a-4db8-9eca-e76b9ed5afe3
name: Guestbook check
shell: sh
command: node --check app.js
Explicit step
version: 1
id: 5af1c74e-f97a-4db8-9eca-e76b9ed5afe3
name: Guestbook check
steps:
  - id: main
    name: Guestbook check
    shell: sh
    run: node --check app.js

CLI

Both people and agents use the same managed registry. Commands below begin with hob automation, except the final view command. Use --help for command flags.

CommandResult
list [--scope shared|private|global]Registry entries, including invalid definitions and diagnostics
init <name> [--scope …]Create a scaffold; default scope is shared
init --stdin [--scope …]Create from a complete ID-free definition; invalid input writes nothing
init --bundle <dir> [--scope …]Create from an ID-free manifest plus all supporting assets, atomically
show <id-or-name>Definition details and exact managed paths
apply <id-or-name> --stdinValidate and replace the complete definition; preserve identity
apply <id-or-name> --bundle <dir>Replace manifest and all assets together; include everything to retain
validate <bundle-or-automation.yaml> or validate --stdinAnchored diagnostics without saving or running
inspect <id-or-name> --step <id> --data-file <json>HTML template injection and inline JavaScript preflight; no run or durable artifact
run <id-or-name> [--input key=value …]Start with repeatable structured input values
run <id-or-name> --inputs-json <json-or->Supply a string-valued JSON object; - reads stdin
run <id-or-name> --wait [--timeout <seconds>]Wait for completion; default wait limit 300 seconds, exit 0 only on success
runs [<id-or-name>]Recent run states and results
logs <run-id>Captured output
delete <id-or-name> / restore <id-or-name>Move the complete automation to Trash / restore it
delete <id-or-name> --permanentDelete an already trashed automation, including its history and stored assets
hob open view automationsOpen the full Automations view
Authoring contextRule
Linked builder agentMay omit the automation ID for show, apply, and inspect; the pane identifies its automation
New inactive draftAuthor inside its provided bundle, then promote with apply --bundle "$HOB_AUTOMATION_DIR"
Saved automationStage a complete asset replacement before apply --bundle; use apply --stdin for a definition-only change
Invalid applyReturns diagnostics, exits 1, and leaves the working copy unchanged
Shared runMay pause for human trust approval; the CLI cannot approve it
Nested executionAutomation shell steps use an automation: step, not recursive hob automation run

Run directories and outputs

NameMeaning
HOB_AUTOMATION_DIR / ${{ automation.dir }}Captured authored bundle during execution; read scripts, templates, and schemas here
HOB_RUN_DIR / ${{ run.dir }}Writable run output directory; write generated files here
HOB_OUTPUTPrivate output-record file for the current process step; watched while it runs
Single-line recordAppend NAME=value followed by a newline
Multiline recordAppend NAME<<END, newline, value lines, then a line containing only END; choose a delimiter absent from the value
Output limitsUp to 128 named values, each bounded to 256 KiB
Published valueLater steps read ${{ steps.<id>.outputs.NAME }}; stdout is not a control channel
CleanupCaptured artifacts remain in history after temporary run output is removed

Steps

YAML examples below are fragments unless they include version. Add them to a complete definition; provide any referenced scripts, schema files, and child automations.

Common fieldContract
id, nameRequired; IDs are unique across steps and finally, matching [A-Za-z_][A-Za-z0-9_-]*
descriptionOptional step description
ActionExactly one: run, exec, agent, present, automation, or refresh
ifOne condition expression; false records a skipped step
on-error, retry, timeoutSee Control flow and results
parallelConsecutive new-agent cohort name; see parallel constraints
env, cwdProcess steps only (run or exec); top-level forms supply automation context
Environment names[A-Za-z_][A-Za-z0-9_]*; HOB_*, FORCE_COLOR, and CLICOLOR_FORCE are reserved
artifactsExplicit files to capture at the step; forbidden within parallel cohorts

Process steps

FieldContract
runStatic shell source; use for pipes, redirects, or chaining
shellOptional platform default, or sh, bash, zsh, fish, pwsh, powershell, cmd; valid only with run
exec, argsStatic executable plus argument list; arguments support interpolation without shell expansion
detach: trueValid on run and exec; launches in the background and moves on, so later completion is not the step's result
Detached constraintsNo timeout, surface, or pty; captured bundle/run paths stay available until process exit
surface, ptyForeground process status; see Surfaces and retained results
Supporting helperPrefer authored Bash under scripts/, explicitly invoked with exec: bash; use the actual executable when wrapping existing project tooling

Agent steps

Field or resultContract
promptRequired, interpolated, never secret-bearing
permission-modeRequired for a new pane: ask, approve_all, deny_all, plan, or plan_approve_all
backend, model, effortOptional static picker values; omitted values use normal pane defaults
accountBackend account; an explicit empty string selects its default account
paneReuse an existing conversation, usually ${{ steps.review.pane-id }}; backend/model/effort/permission-mode overrides are invalid
Reused contextConversation stays intact; each step has its own prompt marker, transcript slice, status, and result
result.formatjson
result.schemaStatic self-contained schema under ${{ automation.dir }}/…; validates this step's immediate response
Accepted JSONBare JSON or one JSON Markdown fence; only validated canonical JSON becomes the result
Contract scopeConstrains result shape, not the correctness of the agent's work
Result accesssteps.<id>.result; compatibility spelling steps.<id>.outputs.output
Structured agent result
- id: review
  name: Review the guestbook
  agent:
    prompt: Review app.js without editing it and return your verdict as JSON.
    permission-mode: ask
    result:
      format: json
      schema: ${{ automation.dir }}/schemas/review.schema.json
  on-error: retry
  retry:
    max-attempts: 3

The complete Building example includes the schema. hob supplies its contents to the agent; the prompt need not repeat them.

Presentations

FieldContract
SourceExactly one of file, content, or template; captured when execution reaches the step
fileExisting regular file; as may be auto (default), source, or web
File inferenceExtension selects Markdown, HTML, image, video, audio, PDF, or source rendering
contentInline text; explicitly set as: markdown, source, or web
templateAuthored HTML; always web, with exactly one __HOB_DATA__ marker in JavaScript value position
dataTemplate-only mapping; valid JSON values become native JSON types, other values stay strings
CaptureSafely serialized data and an immutable run asset; HTML uses a sandboxed web view
PathsRun directory is the generated-file convention; an explicitly managed accessible regular file elsewhere can also be captured
assets/report.html
<script>
  const report = __HOB_DATA__;
</script>
Template presentation
- id: show-report
  name: Show report
  present:
    template: ${{ automation.dir }}/assets/report.html
    data:
      review: ${{ steps.review.result }}

Use hob automation inspect with concrete JSON before handing over a template automation.

Nested automations

Field or ruleContract
automationStatic shared:<uuid>, private:<uuid>, or global:<uuid>; names and paths are invalid
inputsChild input names mapped to interpolated parent values; no secrets or secret-marked inputs
secretsChild secret name → parent secret name; both definitions must declare their respective names
timeoutOptional positive duration; cancellation stops the child
OutputsChild's top-level outputs become steps.<nested-id>.outputs.<name>
Nested step
- id: child-review
  name: Run the shared review
  automation: shared:44444444-4444-4444-8444-444444444444
  inputs:
    scope: ${{ inputs.scope }}
  secrets:
    SERVICE_TOKEN: REVIEW_TOKEN
  timeout: 10m

Replace the illustrative UUID with the child's installed ID.

Refresh

refresh: on-reconnect arms connected browser clients to reload once a replacement backend is serving. Use it for a rebuild-and-relaunch workflow, not to refresh a report.

Control flow and results

Step failures, retries, and timeouts

Field or outcomeRule
on-error: failDefault; failure stops the plan
on-error: continueRecords failure and lets later steps run
on-error: retryRequires retry.max-attempts, 2–20 total attempts
retry.delayOptional positive duration; retry is invalid with other error policies
timeoutPositive duration on foreground run, exec, agent, or nested steps; timeout records timed-out
Ordinary failureRetry starts the step again
Invalid agent JSONRetry supplies validation feedback in the same conversation
Invalid schema fileSetup failure, not retried
steps.<id>.statussuccess, failure, canceled, timed-out, interrupted, or skipped
Skipped conditionEmpty exit code, not 0; cannot satisfy a success-by-exit-code check
Not runRemaining planned steps retain a Not run outcome after failure or cancellation

Gating a step on an earlier one

Continue after a failed check
- id: check
  name: Check syntax
  exec: node
  args: [--check, app.js]
  on-error: continue
- id: report
  name: Report a failed check
  if: ${{ steps.check.status != 'success' }}
  run: echo 'The syntax check needs attention'

Run agent analysis in parallel

ConstraintRule
MembershipUp to 8 consecutive new-pane agent steps with the same parallel identifier
OrderingCohort name is contiguous and single-use; next step waits for every member
ReferencesEarlier steps allowed; sibling references forbidden
ExclusionsNo pane reuse, retry, artifacts, process/nested/present/refresh actions, surfaces, PTYs, or detach
FailureWait for all members; required failure fails the run, while on-error: continue permits downstream synthesis
Stop or timeoutCancels live members, waits for settlement, then bounded finally cleanup
Automatic executionEvery member needs a finite timeout and approve_all or deny_all; also applies through a scheduled parent into nested work
InteractionManual cohorts may ask questions; automatic cohorts reject ask-user and plan-exit prompts
Shared filesDistinct pane/run directories do not isolate repository edits

Cleanup with finally

RuleContract
Start boundaryRuns after execution environment preparation, including runtime failure or user Stop
Earlier failureQueued cancellation, input failure, or environment-resolution failure does not run cleanup in an unrelated checkout
ActionsOnly run or exec, each with a required timeout
ExclusionsNo detach, surface, or PTY
IdentityIDs share the main steps' namespace
FailureFailing cleanup makes an otherwise successful run fail

Expressions

FormContract
Interpolation${{ reference }} substitutes a string; each token contains one bare reference
LocationsEnv, arguments, step cwd, prompts/pane targets, presentations, surfaces, artifacts, nested inputs, outputs; secret restrictions still apply
ConditionEntire if value is one ${{ … }} expression
Operators==, !=, !, &&, ||, parentheses; precedence: !, then equality, &&, ||
LiteralsSingle-quoted strings with next-character escapes, double-quoted Go-style strings, true/false, unsigned decimal text
EqualityExact string equality, including numeric literals
TruthinessAfter trimming whitespace, non-empty and neither 0 nor false
ReferenceValue
inputs.<name>Declared input value
secrets.<NAME>Declared secret in permitted locations
steps.<id>.exit-codeEarlier step's exit code; empty for skipped
steps.<id>.statusEarlier step's conclusion
steps.<id>.pane-idEarlier agent step's pane
steps.<id>.promptFully expanded agent prompt
steps.<id>.resultAgent's final answer, canonical JSON when a result contract applies
steps.<id>.outputs.<name>Published process or child-run output
hob.web-idetrue when the browser IDE is served, otherwise false
automation.dir, run.dirCaptured bundle and writable run directories
run.idAvailable for execution-environment branch/start-point expressions

What expressions deliberately leave out

UnsupportedUse instead
Functions, arithmetic, JSON property traversalProcess the value as data in a shell/executable step
Operators in interpolation tokensConditions in if; plain references elsewhere
Dynamic run, executable path, health probe, child reference, backend/model/effortStatic program selection; pass data through env or args
Arbitrary top-level cwd interpolationOnly ${{ automation.dir }} or ${{ run.dir }} roots there; use step cwd for dynamic process paths

Inputs and outputs

Inputs

Types: text (default), textarea, choice, bool, number, integer, date, time, datetime, file, directory. Names match [A-Za-z_][A-Za-z0-9_-]*.

FieldValid forMeaning
descriptionallLabel shown in the run form
defaultallPrefilled value; must itself pass the input's validation
placeholdertext, textarea, number, integer, date, time, datetimeHint text shown while empty
optionschoiceThe selectable values — at least one, non-empty, unique
multiplechoice, file, directoryAllow several selections; the value becomes a YAML list
min / maxnumber, integer, date, time, datetimeInclusive bounds; min must be ≤ max
stepnumber, integer, time, datetimeIncrement from min (or 0 / midnight); seconds for temporal types
rowstextareaEditor height in rows
acceptfileFile-type filter for the picker
appearancechoiceauto, select, radio, segmented, checkboxes, or chips
secrettext, textarea, number, integer, date, time, datetimePassword-style field, scrubbed from logs and history, barred from the same display sinks as declared secrets
group / group-title / group-descriptionallGroup related inputs in the run form
show-whenallShow the input only when other inputs have expected values
Conditional input
inputs:
  scope:
    type: choice
    options: [app, styles, all]
  review_note:
    type: textarea
    required: false
    show-when:
      scope: [styles, all]
Input ruleContract
RequiredDefaults to true; required: false permits empty
show-whenAll mapped conditions must match; a scalar is equality, a list is any-of
Hidden valueMust remain empty; supplying one fails the run
DependenciesSelf-reference and cycles rejected
Automatic triggersStructured inputs prohibited even with defaults; no interactive PTY input

Automation outputs

Top-level outputs: { verdict: "${{ steps.review.result }}" } publishes named values to a parent via its nested step's outputs. Values cannot contain secrets.

Execution environments

Definition sourcing and execution targeting are separate. Shared bundles come from the canonical checkout; choosing a worktree to execute in does not select its copy of the definition.

FieldContract
OmittedManual/nested runs inherit the admitted environment; scheduled/restart runs use the project default
environment: defaultPin the project checkout
environment: floatingUse the project checkout while permitting branch changes; later steps see its current files
environment.branchLocal target branch; global automations cannot target a branch
environment.if-missingfail (default), or create
environment.start-pointExplicit committed ref required for creating a missing branch
Branch expressionsOnly non-secret inputs.* and run.id in branch/start-point fields
Manual overriderun --environment <id> or --branch <name> [--if-missing create --start-point <ref>]; literal values, no expressions
Execution ruleContract
WorktreeReuse a matching hob environment or create a managed worktree for an unoccupied branch; reject unattached external worktrees
CreationNo dirty-file copy, visible workspace, or switching of another checkout
CwdWithin resolved environment, captured bundle, or run directory; arbitrary outside working directories invalid
Pinned identityCommits allowed on the pinned branch; changing that branch or pinned detached commit fails the run
Floating identityInitial branch/HEAD retained as provenance; branch changes permitted
Detached lifetimeBundle/run paths retained until exit; if the Host exits first, it leaves them available
HistoryRecords definition source/hash, execution branch/initial HEAD, creation and override markers; Open in workspace reveals the target
Branch lifecycleNo automatic cleanup, deletion, merge, rebase, push, commit, or checkout

Secrets

For setup and a worked example, see Secrets, schedules, and trust.

Field or boundaryRule
DeclarationTop-level secrets: [NAME] lists every required secret
ResolutionHost environment variable → project store → global store; missing required values fail setup
Stored project/global valuesEncrypted at rest; replacement UI does not reveal the saved value
Automation-level valueAn env: entry in the definition, not encrypted secret storage
Allowed secret expressionsAutomation/step env, exec arguments, step cwd, and if conditions; prefer step-level environment variables
Rejected secret expressionsAgent prompts/panes/result schemas, presentations, surfaces, artifact paths, outputs, and nested inputs
Secret inputsInputs marked secret: true are barred from the same display sinks
Nested deliveryExplicit child-name → parent-name secrets mapping; both definitions declare their names
ScrubbingKnown values are scrubbed from automation output and history; arbitrary files and transformed values are outside that guarantee

Triggers

Scheduling

For the worked setup, see Run a check each night.

FieldContract
on.user-triggerDefault true; false removes manual Run for people, agents, and CLI
on.scheduleAt most 64 entries; same cadence with conflicting policies rejected
every elapsedNominal start-to-start spacing, 1s–2880h; examples 30m, 1h30m, 24h
every calendarInteger d, w, mo, count 1–120; m means minutes
atRequired HH:MM for calendar schedules
weekdayRequired for weeks; sun through sat, rejected for other intervals
dayRequired for months; 1–31 or last; missing numbered dates skipped
timezoneDefault Host local; pin an IANA zone for consistent shared wall-clock time
dstcompatible (default), earlier, later, skip; invalid with a fixed-offset zone
missed-runskip (default) or at most one catch-up with run-once; elapsed schedules skip missed ticks
overlapDerived from concurrency; explicit value must match it
concurrencyallow, forbid (default), queue, replace; queue coalesces scheduled ticks into at most one pending run
Scheduling ruleContract
AvailabilityRunning Host with project open, including headless; another window does not duplicate scheduling
InteractionNo structured inputs, even defaulted, or interactive PTY; automatic agent cohorts have additional constraints
Calendar phaseFirst matching selector anchors the recurrence; cadence persists across project close
Compatible DSTSpring gap moves forward; fall repeat runs once at the earlier occurrence
Skip DSTDrops both nonexistent and ambiguous local times
Shared trustHuman trust and automatic-run permission required before scheduled execution
Elapsed and calendar schedules
on:
  schedule:
    - every: 30m
    - every: 1d
      at: "09:00"
      timezone: America/Chicago
    - every: 2w
      weekday: tue
      at: "09:00"
    - every: 1mo
      day: last
      at: "09:00"
      missed-run: run-once

Start an automation with the project

See the service recipe for setup and the schedule/restart comparison.

Field or actionRule
restartno (default) or unless-stopped
Eligible planExactly one foreground shell run step, including command shorthand
ConcurrencyMust be forbid (default)
InteractionNo structured inputs or pty: { input: true }
ActivationDeclaring the policy makes it eligible; a manual Run activates it
Running serviceAn existing manual run can be adopted without starting a second copy
StopDeactivates lifecycle restart until another manual Run
Project loadAn active policy starts a fresh process through a staggered queue
Exit blockingRestart-managed services do not block project/window close by default; block-on-exit: true opts in

Health checks

Only valid with restart: unless-stopped. See Check that the service is responding.

FieldRule
ProbeExactly one of http (absolute HTTP(S) URL), tcp (host:port), or run (shell command)
shellOptional shell for a run probe
Probe targetStatic; no expressions. Pass values through automation env
intervalElapsed duration, minimum 2s, default 30s
timeoutPositive, no greater than interval, default 3s
start-periodStartup grace before first probe; none by default
failuresConsecutive failures before unhealthy, 1–100, default 3
successesConsecutive successes before healthy, 1–100, default 1
on-unhealthyreport (default) surfaces state; restart also restarts the process

Trust

Trusting shared automations

See Review shared work before it runs for the current confirmation UI.

DecisionRule
Initial trustHuman confirmation before the first shared run, including agent, CLI, and nested requests
Recorded identityLocal hash of the canonical execution definition; an equivalent command-to-step rewrite preserves it
Automatic runsRequire trust plus recorded automatic-run permission; the current trust box grants both when the definition declares a schedule or restart policy
Editor saveCan carry an existing trust record and automatic-run choice to the saved version
External changeA repository update or external edit that changes the trusted execution definition requires renewed review
Approval ownerThe person using hob; an agent cannot approve it

Surfaces and retained results

Field or formContract
surface: urlFirst matching HTTP(S) URL from output, opened in a hob web pane
regex, groupExtract a match; default group is first capture, or whole match without captures
labelOptional display label
valueInterpolated named output, such as ${{ outputs.progress }}
search-timeoutFirst-match search window; default 5 minutes
updateonce (default) or latest for changing values
PlacementTop level with command, otherwise the owning foreground run or exec step
Output searchBounded recent buffer; completed lines only, including carriage-return progress
UpdatesDefault stops after first match; latest continues until process exit, publishing changes only
Named outputsEvent-driven through HOB_OUTPUT
pty: trueLatest terminal line as read-only status
pty: { input: true }Also accepts keyboard input; not valid for automatic triggers
Live progress
surface:
  regex: '^Progress:\s+(.+)$'
  group: 1
  update: latest

Artifacts

Field or ruleContract
Declarationartifacts: [{ path: "${{ run.dir }}/review.json", name: review }]
PlacementTop-level or producing step; paths support interpolation, never secrets
CollectionEach path must exist and be a regular file; missing files/directories fail the producing step or run
SnapshotExact collected bytes retained after run-local cleanup
Limit256 artifacts across the automation and all steps

Run history

RecordContract
LifecycleQueued, Waiting, Running, Stopping; separate from final conclusion
CompletionRecords success/failure and reasons such as Stopped, Replaced, hob closed, Timed out, Interrupted
StepsStatus, duration, output, transcript slices, and artifacts; Skipped and Not run remain distinguishable
Project HistoryRuns appear unless muted for that automation
RetentionCompleted visible history: 90 days and newest 500 top-level runs per automation; active and explicitly trashed runs excluded from automatic retention

Moved sections

Previous sectionCurrent location
Two ways inAutomations panel and view
Creating an automationCLI and complete bundle guide
Create shortcuts for existing scriptsProcess steps and Terminals
One execution modelDefinition and bundle
Multi-step automationsSteps and Building automations
RelatedAutomations, Building automations, Secrets, schedules, and trust

On this page