Interactive script directives with @NEXTERM: annotations
Use @NEXTERM: directives to add interactive prompts, progress bars, confirmation dialogs, and structured result summaries to your Nexterm shell scripts.
Use this file to discover all available pages before exploring further.
Nexterm provides a set of special directives that turn plain shell scripts into interactive, user-guided workflows. Prefixed with @NEXTERM:, these annotations let you collect user input, display real-time status messages, track progress, and present structured results — all without modifying the server-side execution environment.
Directives are embedded directly in your script file as lines beginning with @NEXTERM:. When Nexterm runs the script, it intercepts these lines and renders the corresponding UI element before continuing execution.You can use directives to:
Break a complex script into labeled steps
Collect text input or offer a choice from a fixed list
Require explicit confirmation before a destructive operation
Display info, warning, success, and error messages in real time
Show a progress percentage during a long-running operation
Present a key-value summary when the script finishes
Directives are interpreted by Nexterm at execution time. They are not executed as shell commands on the server, so they have no effect if you run the same script outside of Nexterm.
Marks a logical step in your script and displays it in the UI. Use steps to break a complex script into named phases so users can follow along.Syntax:
@NEXTERM:STEP "Step description"
Example:
@NEXTERM:STEP "Installing dependencies"npm install@NEXTERM:STEP "Building the application"npm run build@NEXTERM:STEP "Running tests"npm test
@NEXTERM:INPUT — collect free-text input
Prompts the user to enter a value. An optional second parameter sets the default if the user submits the form without typing anything.Syntax:
@NEXTERM:INPUT "Prompt message" "default value"
Parameters:
First: the prompt message displayed to the user
Second (optional): the default value used when no input is provided
Example:
@NEXTERM:INPUT "Enter the database host" "localhost"@NEXTERM:INPUT "Enter the database port" "5432"@NEXTERM:INPUT "Enter the API key" ""
Always provide a sensible default for common values like hostnames and ports. This reduces the number of fields users must fill in for typical runs.
@NEXTERM:SELECT — choose from a fixed list
Presents the user with a set of predefined options and captures their selection. Use this instead of free-text input whenever valid values are known in advance.Syntax:
Pauses execution and displays a confirmation prompt. The script does not continue until the user confirms. Use this before any operation that is destructive or irreversible.Syntax:
@NEXTERM:CONFIRM "Confirmation message"
Example:
@NEXTERM:STEP "Preparing to delete database"@NEXTERM:CONFIRM "Are you sure you want to delete the entire database? This cannot be undone."rm -rf /var/lib/postgresql/data
@NEXTERM:INFO — display an informational message
Shows an informational notice without blocking execution. Use it to explain what the script is about to do, especially before a long-running command.Syntax:
@NEXTERM:INFO "Information message"
Example:
@NEXTERM:INFO "Docker is not installed. Installing Docker now..."curl -fsSL https://get.docker.com -o get-docker.shsh get-docker.sh@NEXTERM:INFO "Configuration will be applied after the service restarts."systemctl restart myservice
@NEXTERM:SUCCESS — confirm a milestone completed
Displays a success message to confirm that a task or phase finished successfully.Syntax:
@NEXTERM:SUCCESS "Success message"
Example:
@NEXTERM:STEP "Deploying application"docker pull myapp:latestdocker run -d myapp:latest@NEXTERM:SUCCESS "Application deployed successfully!"@NEXTERM:STEP "Running health checks"curl http://localhost:8080/health@NEXTERM:SUCCESS "All health checks passed!"
@NEXTERM:WARN — surface a non-fatal warning
Alerts the user to a potential issue without stopping execution. Use it for situations that require awareness but not a hard stop.Syntax:
@NEXTERM:WARN "Warning message"
Example:
@NEXTERM:STEP "Updating production configuration"@NEXTERM:WARN "You are modifying production configuration. Ensure you have a backup."cp config.prod.yml config.prod.yml.backupsed -i 's/old_value/new_value/g' config.prod.yml@NEXTERM:WARN "This operation requires manual verification in the admin panel."
@NEXTERM:ERROR — report a failure
Displays an error message. This is informational — it does not stop execution on its own. Pair it with exit 1 to abort the script when a critical prerequisite is not met.Syntax:
@NEXTERM:ERROR "Error message"
Example:
@NEXTERM:STEP "Verifying prerequisites"if ! command -v docker &> /dev/null; then @NEXTERM:ERROR "Docker is not installed. Please install Docker before proceeding." exit 1fi@NEXTERM:SUCCESS "All prerequisites verified"@NEXTERM:STEP "Connecting to database"if ! psql -h localhost -U user -d mydb -c "SELECT 1" &> /dev/null; then @NEXTERM:ERROR "Failed to connect to database. Check your connection parameters." exit 1fi
@NEXTERM:PROGRESS — update a progress bar
Updates a visual progress indicator with a percentage value between 0 and 100. Call it repeatedly inside a loop to show activity during a long-running operation.Syntax:
@NEXTERM:PROGRESS 50
Parameters:
A single integer from 0 to 100 representing the completion percentage
Renders a labeled key-value table at the end of a script. Use it to present final statistics, configuration values, or completion details in a readable format.Syntax:
Use @NEXTERM:STEP for every distinct phase — it gives users a clear map of where the script is in its execution.
Provide defaults in @NEXTERM:INPUT — reduce friction for the most common case while still allowing customization.
Prefer @NEXTERM:SELECT over free-text input — restricting choices to known-good values prevents typos and invalid configurations.
Guard destructive operations with @NEXTERM:CONFIRM — deletions, production deployments, and data migrations should always require an explicit acknowledgment.
Use @NEXTERM:ERROR with exit 1 — display an actionable message and then abort when a prerequisite check fails.
Update @NEXTERM:PROGRESS frequently — call it at each meaningful checkpoint so users know the script has not stalled.
End with @NEXTERM:SUMMARY — a final summary of key outcomes helps users verify that the script completed as expected.