tools/infra-scripts/clitools/toolbox/README.md
A command line utility to connect to PostHog toolbox pods in a Kubernetes environment.
The toolbox utility uses a hybrid approach with modular functions in a package but the main entry point in the top-level script:
Main script:
toolbox.py - Main script with argument parsing and the core workflowSupport modules:
toolbox/kubernetes.py - Functions for working with Kubernetes contextstoolbox/user.py - User identification and ARN parsingtoolbox/pod.py - Pod management (finding, claiming, connecting, deleting)This structure keeps the main flow in a single script for easy understanding while separating the implementation details into modular components.
# Basic usage (claims pod for 12 hours by default)
python toolbox.py
# Claim a pod for 24 hours
python toolbox.py --claim-duration 24
# Update the termination time of an existing claimed pod
python toolbox.py --update-claim
Before connecting to a pod, the utility now allows you to select a Kubernetes context, making it easier to work with multiple clusters.