fail-message "..." |
Render a learner-facing failure message in the UI. Pair with exit 1. |
set-status "..." |
Pass-side counterpart. Render at the end of a passing check, before exit 0. |
agent variable set KEY VALUE |
Store a key-value pair. Visible to all subsequent scripts on every host and to the body via [[ Instruqt-Var ]]. |
agent variable get KEY |
Read a previously set value. Common in cleanup to retrieve resource IDs for deletion. |
set-workdir /path |
Set the default working directory for terminal tabs on this host. Per-tab workdir: in assignment.md overrides this. |
$INSTRUQT_AUTH_TOKEN |
Env var. Ephemeral JWT for the Instruqt REST API. Use to query track state or trigger platform actions from inside the sandbox. |
Surface check results to the learner. Pair both for consistent fail/pass UX.
Bridge values between scripts and the body, and set per-host terminal default directory.
No built-in retry helper. Two common patterns.
retry function and other helpers. source at the top of setup; call by name. Saves reimplementing common patterns.
Authenticate calls to Instruqt's REST API from inside the sandbox without a separate API key.
Ephemeral — bound to the current play session. Use in advanced certification or telemetry-enabled tracks where scripts query track state programmatically.
Stock ubuntu:22.04, python:3.11-slim, and similar upstream images don't ship the helpers.
set -x) lives in the play page's debug log — read there.fail-message calls (one per assertion) over a single combined check. Each fail message points the learner at the specific next thing to do.set -o history in check scripts: non-interactive bash disables history. Checks that grep ~/.bash_history for proof-of-attempt must enable it: set -o history; export HISTFILE=/root/.bash_history; history -r.fail-message + set-status).