Skip to main content

A CLI tool for managing Postman collections, environments, and workspaces

Project description

pmctl

A CLI tool for managing Postman collections, environments, and workspaces.

The official Postman CLI only supports running collections. pmctl fills the gap by wrapping the Postman API to let you browse and manage your Postman resources from the terminal.

Features

  • 🔑 Multi-profile support — manage multiple Postman accounts with default workspaces
  • 📦 Browse collections — list collections and inspect with tree view
  • 🔍 Request browser — list, search (fuzzy match), and inspect individual requests across collections
  • 🌍 Environments — list environments and view variables by name or ID
  • 🏢 Workspaces — list and search workspaces
  • 🐚 Shell completion — tab completion for bash, zsh, and fish
  • 🎨 Rich output — colored tables and trees powered by Rich

Installation

pip install pmctl

Or install from source:

git clone https://github.com/wbingli/pmctl.git
cd pmctl
pip install -e .

Quick Start

1. Add a profile

# Add your Postman API key (get one at https://go.postman.co/settings/me/api-keys)
pmctl profile add personal --api-key "PMAK-..." --label "Personal Account" --default

# Add another profile (e.g., work account)
pmctl profile add work --api-key "PMAK-..." --label "Work Account"

2. Set a default workspace

# Set default workspace for your profile (so list commands scope to it automatically)
pmctl profile set-workspace <workspace-id>

3. Browse your resources

# List collections (scoped to default workspace)
pmctl collections list

# List collections from all workspaces
pmctl collections list --all

# Show all requests in a collection (tree view)
pmctl collections show <collection-uid>

# List all requests in a collection (flat table)
pmctl requests list --collection "My Collection"

# Search requests with fuzzy matching
pmctl requests list --collection "My Collection" --search "getCampaign"

# Inspect a specific request by name
pmctl requests show "request name" --collection "My Collection"

# List environments
pmctl environments list

# Show environment variables (by name or ID)
pmctl environments show "My Environment"
pmctl environments show <env-id>

# List workspaces
pmctl workspaces list

# Search workspaces by name
pmctl workspaces list --search "keyword"

4. Switch between profiles

# Switch default profile
pmctl profile switch work

# Or use --profile flag on any command
pmctl collections list --profile personal

# Check who you're logged in as
pmctl profile whoami

Profile Management

pmctl profile list                        # List all profiles
pmctl profile add <name>                  # Add a new profile
pmctl profile remove <name>               # Remove a profile
pmctl profile switch <name>               # Set default profile
pmctl profile set-workspace <workspace>   # Set default workspace for profile
pmctl profile whoami                      # Show current user info

Requests

The requests subcommand lets you browse and inspect individual API requests within collections. The --collection flag accepts either a UID or a collection name.

# List all requests in a collection (by name or UID)
pmctl requests list --collection "Campaign Manager Service"
pmctl requests list -c 39419311-64642488-12d1-4bf1-8aff-689c5c77039f

# Fuzzy search requests (characters matched in order, e.g. "crtcmp" matches "Create Campaign")
pmctl requests list -c "Campaign Manager Service" --search "getCampaign"

# Show full details of a specific request (method, URL, headers, body, params)
pmctl requests show "get Campaign By Id" -c "Campaign Manager Service"

# JSON output for scripting
pmctl requests list -c "Campaign Manager Service" --json
pmctl requests show "get Campaign By Id" -c "Campaign Manager Service" --json

Configuration

Profiles are stored in ~/.config/pmctl/config.toml:

[profiles.personal]
api_key = "PMAK-..."
label = "personal@example.com"

[profiles.work]
api_key = "PMAK-..."
label = "work@company.com"
workspace = "your-workspace-id"

default_profile = "work"

Getting a Postman API Key

  1. Go to Postman API Keys
  2. Click Generate API Key
  3. Copy the key and add it with pmctl profile add

Note: If you have multiple Postman accounts (e.g., personal + company SSO), each account has its own API keys page. Log into the correct account first.

Shell Completion

# Bash
eval "$(pmctl completion bash)"

# Zsh
eval "$(pmctl completion zsh)"

# Fish
pmctl completion fish > ~/.config/fish/completions/pmctl.fish

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pmctl-0.1.4.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pmctl-0.1.4-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file pmctl-0.1.4.tar.gz.

File metadata

  • Download URL: pmctl-0.1.4.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for pmctl-0.1.4.tar.gz
Algorithm Hash digest
SHA256 e1a5449d22c608efa578043d548f9869fb725e97cf3fbd2d4756da46a8e7c4ee
MD5 6319351d2838613c62c53bda3e33d995
BLAKE2b-256 f134061dec6ffbd321ec28e62a6b3cee4a0af831fd0d5b0d4c0066c9277609ec

See more details on using hashes here.

File details

Details for the file pmctl-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: pmctl-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for pmctl-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 86e13493ce7d9bdf084eec3008ed6cad4061304b827f63ed0820a116245d71df
MD5 7c7a4d5c76b559e90a7351aeb536bbcc
BLAKE2b-256 ff9f770ce42eeb9ae459e21346e59f043c85f0010b08345af52c6a84da93ab2d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page