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.3.tar.gz (32.8 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.3-py3-none-any.whl (38.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: trilogy_tpm-0.3.3.tar.gz
  • Upload date:
  • Size: 32.8 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.3.tar.gz
Algorithm Hash digest
SHA256 4bd59913f3dc6a048e89dd35adfc07189371f27a243b542eb9479c918d1b0b09
MD5 32bde5db69f85459456fb3528e272058
BLAKE2b-256 58bbd3ce1fe4deeacc01a3f5067b8e7dae781629c04421762007fc4b01581480

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trilogy_tpm-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 38.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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 64801369fde224de875c4eb84a159a43cbaa3fe8f0d48262fcc70bb6b5db125a
MD5 ee919b922213f10923bb8ef602483019
BLAKE2b-256 32ea9a16e8247b39d112fe7d4d21cfe96325f8785c021daed2d166d686b86c3d

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