Skip to content
gurl collection

gurl collection

Group related requests into a collection with its own variables and encrypted secrets, run the whole collection, and share it through git or passphrase-encrypted exports.

Synopsis

gurl collection <subcommand> [flags] [arguments]

Collection variables sit above environment variables in scope precedence (environment < collection < data row < CLI < runtime), and may reference environment keys (API_URL={{BASE_URL}}/v1).

Subcommands

run

Run every request in a collection in sequence order.

gurl collection run <name> [flags]
FlagShortDefaultDescription
--env-enoneEnvironment to use
--bail-bfalseStop on the first failure
--assert-bailfalseStop on the first assertion failure only
--persistfalseWrite extracted and script-set variables back to their variable origin
--dry-runfalsePreview the run without sending requests
--verbosefalsePrint request and response headers and bodies for each request
--iterations-n1Number of times to run the collection
--delay-d0sDelay between requests (e.g., 100ms, 1s)
--var-vnoneVariable as key=value (repeatable)
--data-DnoneCSV or JSON data file for data-driven iteration
--reporter-RnoneReporter(s): junit, json, html, console
--reporter-output-OnoneOutput directory for reporter files
--cifalseCI mode: treat skipped requests as failures (exit 1)

Each execution is recorded. For every failed request, the id is printed on stderr: [FAIL] failing: HTTP 500 (id: 51be33a5) — inspect with: gurl diag 51be33a5. --persist and --dry-run cannot be used together.

Aliases: r

show

Show a collection’s variables (secrets masked) and requests.

gurl collection show <name> [--json]
FlagShortDefaultDescription
--json-jfalseJSON output (secrets masked): {"name","id","variables":{},"secrets":[],"requests":[{"name","method","url"}]}

Aliases: view, info

list

List all collections with request and variable counts.

gurl collection list [--json]
FlagShortDefaultDescription
--json-jfalseJSON output: [{"name","requests","variables","updated"}]

Aliases: ls, l

create

Create a collection, optionally with variables and secrets.

gurl collection create <name> [--var KEY=VALUE ...] [--secret KEY=VALUE ...]
FlagShortDefaultDescription
--var-vnoneVariable as KEY=VALUE (repeatable)
--secret-snoneSecret variable as KEY=VALUE (repeatable), encrypted at rest

Aliases: add, new

set-var

Set one variable in a collection.

gurl collection set-var <collection> KEY=VALUE [--secret]
FlagShortDefaultDescription
--secretfalseStore the variable as a secret

Aliases: set

unset-var

Remove one variable from a collection.

gurl collection unset-var <collection> KEY

None.

Aliases: unset

migrate

Move a database-backed collection into project file storage (.gurl/collections/<name>/).

gurl collection migrate <name> [--passphrase <pass>]
FlagShortDefaultDescription
--project-dirnoneProject root for .gurl file storage
--passphrasenoneWrite collection secrets with passphrase-derived encryption

With --passphrase, secrets are written to collection.json with passphrase-derived encryption and no local collection.key is left behind; teammates unlock with the passphrase.

unlock

Unlock a passphrase-protected file collection after cloning. The derived key is cached in the OS keychain.

gurl collection unlock <name> [--passphrase <pass>]
FlagShortDefaultDescription
--passphrasenoneCollection import passphrase

export

Export a collection with passphrase-encrypted secrets.

gurl collection export <name> --passphrase <pass> [--output <file>]
FlagShortDefaultDescription
--output-ostdoutOutput file
--passphrasenonePassphrase for encrypting collection secrets

import

Import a collection export, a collection directory, or .env variables.

gurl collection import <file-or-directory> [--passphrase <pass>] [--force]
gurl collection import <collection> --file .env
FlagShortDefaultDescription
--force-ffalseOverwrite existing collection/request records
--filenonePath to a .env file for collection variable import
--passphrasenonePassphrase for decrypting collection secrets (or set GURL_IMPORT_PASSPHRASE)

.env imports create the collection if needed and store values as plain (non-secret) variables. Without a passphrase and with --no-input, an encrypted import fails with passphrase required: pass --passphrase or set GURL_IMPORT_PASSPHRASE.

remove

Remove a collection label but keep its requests.

gurl collection remove <name>

None.

Aliases: rm

delete

Delete a collection and all of its requests. Interactive terminals ask for confirmation; with --no-input (or --json/--agent) it fails unless --force is passed.

gurl collection delete <name> [--force]
FlagShortDefaultDescription
--forcefalseDelete without interactive confirmation

Aliases: del

rename

Rename a collection.

gurl collection rename <old-name> <new-name>

None.

Aliases: mv, ren

Aliases

  • collections
  • col
  • c

Examples

Create a collection with a secret and run it

gurl collection create payments-api \
  --var BASE_URL=https://api.example.com \
  --secret API_KEY=sk-live-...

gurl save "list-payments" '{{BASE_URL}}/payments' \
  --collection payments-api \
  --auth bearer --auth-param token='{{API_KEY}}'

gurl collection run payments-api --env staging --bail

Preview a run, then persist what it extracts

gurl collection run checkout-flow --env staging --dry-run
gurl collection run checkout-flow --env staging --persist

Share a collection with its secrets

gurl collection export payments-api --passphrase "$TEAM_SECRET" --output payments-api.gurl
gurl collection import payments-api.gurl --passphrase "$TEAM_SECRET"

Related commands