| name | pmctl |
| description | Browse and inspect Postman collections, requests, and environments from the terminal using pmctl. Use when you need to discover API endpoints, look up request details (method, URL, headers, body, query params), resolve environment variables to real base URLs, or construct curl commands from Postman data. Works with any Postman workspace. Requires pmctl to be installed (`pip install pmctl`). |
pmctl — Postman CLI for API Discovery
pmctl wraps the Postman API to let you browse collections, inspect requests, and resolve environment variables from the terminal. Use it to discover endpoints, construct curl commands, and understand APIs without opening the Postman GUI.
Install: pip install pmctl
Source: github.com/wbingli/pmctl
Setup
pmctl profile add <name> --api-key "PMAK-..." --default
pmctl profile set-workspace <workspace-id>
pmctl profile whoami
Get an API key at https://go.postman.co/settings/me/api-keys
Commands
Profiles
pmctl profile list
pmctl profile add <name> -k "PMAK-..." -d
pmctl profile switch <name>
pmctl profile set-workspace <id>
pmctl profile remove <name>
pmctl profile whoami
Collections
pmctl collections list
pmctl collections list --all
pmctl collections show <UID>
Requests
pmctl requests list -c "Collection Name"
pmctl requests list -c <collection-uid>
pmctl requests list -c "My API" --search "getUser"
pmctl requests show "request name" -c "Collection Name"
-c / --collection accepts a collection name (case-insensitive) or UID.
requests show uses case-insensitive substring match — use short terms.
requests list --search uses fuzzy matching (characters in order).
Environments
pmctl environments list
pmctl environments show <name-or-id>
pmctl environments show <name> --full
Workspaces
pmctl workspaces list
pmctl workspaces list --search "keyword"
Global Options
--json — Machine-readable JSON output (works as global flag or per-subcommand)
--profile <name> / -p — Use a specific profile instead of default
Workflow: Resolve a Full API URL
Postman requests use {{variable}} placeholders. Resolve them via environments:
pmctl requests show "get User" -c "My API" --json
pmctl environments show "Production" --json | jq -r '.values[] | select(.key == "base-url") | .value'
Workflow: Construct a curl Command
REQ=$(pmctl requests show "create User" -c "My API" --json)
echo "$REQ" | jq '.[0].request | {method, url: .url.raw, headers: .header, body: .body.raw}'
BASE=$(pmctl environments show "QA" --json | jq -r '.values[] | select(.key == "base-url") | .value')
Workflow: Discover All Endpoints for a Topic
pmctl requests list -c "My API" --search "user"
pmctl collections show <uid>
Tips
--json output is pipeable to jq for scripting
environments show --json returns unmasked secrets — useful for scripting
- Collection names are matched case-insensitively; prefer names over UIDs for readability
- Multiple profiles let you manage separate Postman accounts (personal, work, etc.)