Skip to main content
Shell command blocks let you run arbitrary shell commands after an HTTP request completes. This is useful for post-processing, triggering external scripts, or performing validation that goes beyond HTTP assertions.

Security

Shell command blocks execute arbitrary commands on your system. You must pass the --allow-shell flag to enable them. Without this flag, >>>shell blocks are skipped.

Basic Usage

Add a >>>shell block after your request and assertions:
Shell commands execute after the HTTP assertions have been evaluated.

Variable Interpolation

Variables are resolved in shell commands before execution. You can use environment variables, captured values, and built-in functions:

Error Handling

By default, if a shell command fails (returns a non-zero exit code), the test fails. Prefix a command with - to ignore its exit code:

Execution Details

  • Commands run via sh -c
  • Working directory is the .http file location
  • Commands execute sequentially in the order they appear
  • Each line is a separate command
  • Standard output and standard error are captured

Examples

Verify a File Was Created

Run a Cleanup Script

Chain with External Tools

Shell blocks are meant for tasks that cannot be expressed as HTTP assertions. For most validation needs, use the built-in assertion operators instead.
Last modified on February 9, 2026