craftr import postman apply

Create a new API from a Postman collection. Every secret candidate needs a decision: from the flags, or prompted in a terminal. Scripts are written commented out under a throw, so they fail until rewritten. Fails if the API already exists.

Usage

craftr import postman apply <collection.json> [--api <slug>] [--environment <environment.json>…] [--secret <in:name>…] [--drop <in:name>…] [--secret-all] [--drop-all]

Flags

FlagDescription
--api-aSlug of the API to create (default: derived from the collection name).
--environment-erepeatableExported Postman environment to import as an environment of the new API.
--secretrepeatableStore this candidate in the git-ignored .secrets.env files and reference it, e.g. variable:access_token.
--droprepeatableDrop the value of this candidate (a variable stays declared, a header is left out), e.g. auth:apikey.
--secret-allStore every candidate as a secret.
--drop-allDrop every candidate.

Examples

craftr import postman apply ./timers.postman_collection.json --environment ./staging.postman_environment.json
craftr import postman apply ./timers.postman_collection.json --secret variable:access_token --drop auth:apikey
craftr import postman apply ./timers.postman_collection.json --api timers --secret-all