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.2.tar.gz (31.9 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.2-py3-none-any.whl (38.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: trilogy_tpm-0.3.2.tar.gz
  • Upload date:
  • Size: 31.9 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.2.tar.gz
Algorithm Hash digest
SHA256 75b47c6b7cd1fdba94742a29d968e2d2d6743256030c4fa9acd7d0627c548f27
MD5 6363a5c16737edca0f1c002ff669ce0c
BLAKE2b-256 ffe8d44eaff3b357bacd70dfdca7f5dab36161c73c1ddf0851ab8ee66cbbc7c1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trilogy_tpm-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 38.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3ebaf78cbbf0229b3134b164504ce28fe6882cbe3156e40bcf74adb7f09674e9
MD5 ab2caf7fa4dc033510ba123f42b527a0
BLAKE2b-256 8e7c2989fdee3ff8941da150982af3afa5be96b28c9379fd4d9ef4f4d4ddf56f

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