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, AWS services, and Jira.

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.
  • Jira Integration: Get ticket details, search for tickets, test connectivity, and list accessible projects.

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"

Jira

# Get a Jira ticket
tpm jira get PROJ-123
tpm jira get PROJ-123 --output ticket.md

# Search for Jira tickets
tpm jira search "project = PROJ AND status = Open ORDER BY created DESC" --limit 10

# Test Jira connectivity
tpm jira test

# List accessible Jira projects
tpm jira projects

# Configure Jira credentials
tpm config jira --email "your.email@example.com" --token "your-api-token"

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
  • Jira credentials: ~/.tpm-cli/credentials.json (centralized) or ~/.config/jira/email and ~/.config/jira/token (legacy)

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.1.tar.gz (31.6 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.1-py3-none-any.whl (37.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: trilogy_tpm-0.3.1.tar.gz
  • Upload date:
  • Size: 31.6 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.1.tar.gz
Algorithm Hash digest
SHA256 7d28cd8e539a5fa1c56424adf5c9aba270413053ae52508f6d428a47f775b6ae
MD5 6911d0643be3e51d0b8a2e2648a184f1
BLAKE2b-256 38a2ffea3f09e114e3c4a576e983b8bf9a7a9ab386868c5419f34d00d044adf4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trilogy_tpm-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 37.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 148cfd82d17ee532a2c0d3680970cb3efe491e41f13c63eca679933ce5498e77
MD5 e71d3e376880a1c93c91ff6ccbb69b22
BLAKE2b-256 9bbaf68a7905540be47125290a3d234692f2f167a39f7e6219d8a8498aea0a9e

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