Instructions for AI agents working on this project.
pmctl is a Python CLI tool for managing Postman collections, environments, and workspaces. It wraps the Postman API and is built with Typer + Rich.
src/pmctl/
__init__.py # Package version (__version__)
cli.py # All CLI commands (Typer app)
api.py # Postman API client (httpx)
config.py # Profile/config management (~/.config/pmctl/config.toml)
pyproject.toml # Project metadata, version, dependencies (hatchling build)
uv.lock # Locked dependencies
- Version is defined in two places β keep them in sync:
pyproject.tomlβversion = "x.y.z"src/pmctl/__init__.pyβ__version__ = "x.y.z"
- Entry point:
pmctl.cli:app(Typer app)
uv sync # Install dependencies from lockfile
uv pip install -e . # Editable install for local developmentuv run ruff check src/
uv run ruff format src/Ruff config: Python 3.11 target, 100 char line length (see pyproject.toml).
Update version in both files:
pyproject.tomlβversionsrc/pmctl/__init__.pyβ__version__
uv buildProduces dist/pmctl-<version>.tar.gz and dist/pmctl-<version>-py3-none-any.whl.
PyPI credentials are stored in ~/.pypirc with token auth. Use twine to upload:
# Test PyPI first
twine upload --repository testpypi dist/pmctl-<version>*
# Then production PyPI
twine upload dist/pmctl-<version>*- Test PyPI: https://test.pypi.org/project/pmctl/
- Prod PyPI: https://pypi.org/project/pmctl/
After bumping version and publishing, commit with a message like:
Bump to v<version> and <summary of changes>
Always push to main after publishing.
- Commands are organized as Typer sub-apps:
profile,workspaces,collections,environments,completion - All output uses Rich (
Console,Table,Tree) - Every command that calls the API accepts
--profile/-pto select which Postman account to use - List commands respect the profile's default workspace; use
--all/-ato override - The
showcommands support lookup by name or ID where practical (environments resolve name via workspace list)
- Base URL:
https://api.getpostman.com - Auth:
X-API-Keyheader with the profile's API key - Client is in
api.pyusinghttpxwith context manager pattern - Rate limits apply β avoid unnecessary API calls