gurl run

Execute a previously saved request by name.

Usage

gurl run [name] [flags]

Description

The run command executes a request that was previously saved with gurl save. You can override variables, switch environments, set timeouts, and validate responses with assertions.

Flags

FlagShortDefaultDescription
--env-enoneEnvironment to use
--var-vnoneVariable as key=value (can be specified multiple times)
--format-fautoOutput format: auto, json, or table
--cache-cfalseUse cached response
--output-ononeWrite response to file
--forcefalseOverwrite output file if it exists
--timeout30sRequest timeout (e.g., 5s, 1m, 30s)
--chain-chfalseEnable request chaining
--assert-anoneAssertion to validate response
--data-dnoneData file for iteration

Aliases

  • r
  • execute

Examples

Basic run

gurl run "users"

Executes the “users” request.

Run with environment

gurl run "users" --env production

Executes the request using the “production” environment variables.

Run with variables

gurl run "users" --var "page=2" --var "limit=50"

Overrides the page and limit variables for this execution.

Run with JSON output

gurl run "api-users" --format json

Outputs the response in JSON format regardless of auto-detection.

Run with timeout and assertion

gurl run "create-user" --timeout 10s --assert "status=201"

Sets a 10-second timeout and asserts the response status is 201.

See also