Skip to main content

A command-line tool for interacting with GitHub repositories, Google Drive documents, AWS services, Jira, and Notion

Project description

TPM CLI

A command-line tool for Technical Project Managers to interact with GitHub repositories, Google Drive documents, and AWS services.

Installation

pip install tpm-cli

Features

  • GitHub Repository Management: Search for repositories, get repository information.
  • Google Drive Integration: List, get, and search Google Drive documents.
  • AWS CLI Integration: Run AWS CLI commands with assumed role credentials, manage configuration, and view CloudWatch logs.

Usage

GitHub Repositories

# Search for repositories
tpm repo "search query" --org "organization"

# Get repository information
tpm repo "exact-repo-name" --org "organization"

# Output to file
tpm repo "search query" --output "output.md"

Google Drive

# List Google Drive files
tpm google list --query "search query"
tpm google list --folder "folder-id"

# Get a Google Drive document
tpm google get "document-id" --format md
tpm google get "https://docs.google.com/document/d/..." --output "output.md"

# Search within a Google Drive document
tpm google search "document-id" "search query"

AWS

# Run AWS CLI commands with assumed role credentials
tpm aws run -a 123456789012 s3 ls
tpm aws run -a 123456789012 -r CustomRoleName ec2 describe-instances
tpm aws run s3 ls  # Uses default target account if set during setup

# Configure default settings
tpm aws config
tpm aws config --set-role CustomRoleName
tpm aws config --set-source-profile my-profile

# Show recently used accounts
tpm aws recent

# Quick setup for SaaS and target accounts
tpm aws setup -s 123456789012 -t 987654321098
tpm aws setup -s 123456789012  # Set up with just SaaS account

# Get logs from CloudWatch Logs
tpm aws logs /aws/lambda/my-function
tpm aws logs /aws/lambda/my-function --start-time 2023-01-01T00:00:00 --end-time 2023-01-02T00:00:00
tpm aws logs /aws/lambda/my-function --filter-pattern "ERROR"

AWS Command Details

The aws command provides several subcommands for interacting with AWS services:

run

Run AWS CLI commands with assumed role credentials.

tpm aws run [options] [AWS CLI command and arguments]

Options:

  • -a, --account: Target AWS account ID (optional if default target is set)
  • -r, --role: Role name to assume
  • -s, --source-profile: Source profile for role chaining
  • --saas-account: SaaS account ID for role chaining
  • --saas-role: SaaS role name for role chaining
  • --debug: Enable debug logging

Examples:

tpm aws run -a 123456789012 s3 ls
tpm aws run -a 123456789012 -r CustomRoleName ec2 describe-instances
tpm aws run s3 ls  # Uses default target account if set during setup
tpm aws run -s my-profile --saas-account 123456789012 s3 ls  # Uses role chaining

config

Configure default settings for AWS.

tpm aws config [options]

Options:

  • -a, --account: Target AWS account ID
  • -r, --role: Role name to assume
  • --set-role: Set default role
  • --set-saas-role: Set default SaaS role for role chaining
  • --set-source-profile: Set default source profile for role chaining
  • --source-profile: Source profile for role chaining
  • --saas-account: SaaS account ID for role chaining
  • --debug: Enable debug logging

recent

Show recently used AWS accounts.

tpm aws recent [options]

Options:

  • -a, --account: Target AWS account ID
  • -r, --role: Role name to assume
  • -s, --source-profile: Source profile for role chaining
  • --saas-account: SaaS account ID for role chaining
  • --debug: Enable debug logging

setup

Quick setup for SaaS and target accounts.

tpm aws setup [options]

Options:

  • -s, --saas-account: SaaS AWS account ID (required)
  • -t, --target-account: Target AWS account ID (optional)
  • -r, --role: Role name to assume
  • --saas-role: SaaS role name for role chaining
  • --source-profile: Source profile for role chaining
  • --debug: Enable debug logging

logs

Get logs from CloudWatch Logs.

tpm aws logs [log-group] [options]

Options:

  • -a, --account: Target AWS account ID (optional if default target is set)
  • -r, --role: Role name to assume
  • -s, --source-profile: Source profile for role chaining
  • --saas-account: SaaS account ID for role chaining
  • --saas-role: SaaS role name for role chaining
  • --start-time: Start time in ISO format (YYYY-MM-DDTHH:MM:SS)
  • --end-time: End time in ISO format (YYYY-MM-DDTHH:MM:SS)
  • --filter-pattern: Filter pattern
  • --output: Output file path
  • --debug: Enable debug logging

Examples:

tpm aws logs /aws/lambda/my-function
tpm aws logs /aws/lambda/my-function --start-time 2023-01-01T00:00:00 --end-time 2023-01-02T00:00:00
tpm aws logs /aws/lambda/my-function --filter-pattern "ERROR" --output logs.txt

Configuration

The TPM CLI stores configuration in the following locations:

  • GitHub token: ~/.config/github/token
  • Google Drive credentials: ~/.tpm-cli/credentials.json
  • AWS configuration: ~/.tpm-cli/aws-config.json

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

trilogy_tpm-0.3.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

trilogy_tpm-0.3.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file trilogy_tpm-0.3.0.tar.gz.

File metadata

  • Download URL: trilogy_tpm-0.3.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.7

File hashes

Hashes for trilogy_tpm-0.3.0.tar.gz
Algorithm Hash digest
SHA256 90c1cf3029d8c87809865f5fe1045860a102b6a9375cead4f09a74218e1b6594
MD5 ccb54a62873ba8b963fba77e03f69990
BLAKE2b-256 1c9c3f5ed3db37a075a4a9d558358ef3fe7c57095406eeadfdcd819b72722803

See more details on using hashes here.

File details

Details for the file trilogy_tpm-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: trilogy_tpm-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.7

File hashes

Hashes for trilogy_tpm-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 08f19b30ba0e4fee0673b929940e83b632cf481f788b72046c9e4e510a9ec0e5
MD5 caba16fff68a01d6daf1eb4084d42057
BLAKE2b-256 bd1fcfa3356811e29ee01e7ebe53e14d330d19f1abcced201a2c764b9d5f0619

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