Skip to main content

A Python-based CLI utility with a plugin architecture for AWS, Kubernetes, Git, and more

Project description

toast-cli

 _                  _           _ _
| |_ ___   __ _ ___| |_     ___| (_)
| __/ _ \ / _` / __| __|__ / __| | |
| || (_) | (_| \__ \ ||___| (__| | |
 \__\___/ \__,_|___/\__|   \___|_|_|

build release PyPI website

Python-based CLI utility with plugin architecture for AWS, Kubernetes, and Git operations.

Features

  • Plugin Architecture: Modular design with dynamic command discovery
  • AWS Integration: Identity checking, profile management, region selection, SSM integration
  • Kubernetes: Context switching, EKS integration
  • Git: Repository management, branch creation, pull operations
  • Workspace: Directory navigation, environment file management
  • Interface: FZF-powered menus, formatted output with Rich

Architecture

  • Commands implemented as plugins extending BasePlugin
  • Automatic plugin discovery and loading
  • Click integration for CLI behavior
  • See ARCHITECTURE.md for details

Installation

Requirements

  • Python 3.6+
  • External tools: fzf, aws-cli, kubectl
  • Python packages: click, rich

Install

# From PyPI
pip install toast-cli

# From GitHub
pip install git+https://github.com/opspresso/toast-cli.git

# Development mode
git clone https://github.com/opspresso/toast-cli.git
cd toast-cli
pip install -e .

Usage

toast --help         # View available commands
toast am             # Show AWS identity
toast cdw            # Navigate workspace directories
toast ctx            # Manage Kubernetes contexts
toast dot            # Manage .env.local files
toast env            # Manage AWS profiles
toast git            # Manage Git repositories
toast region         # Manage AWS region
toast version        # Display version

Examples

# AWS
toast am                   # Show identity
toast env                  # Switch profiles
toast region               # Switch regions

# Kubernetes
toast ctx                  # Switch contexts

# Environment Files
toast dot up               # Upload to SSM
toast dot down             # Download from SSM
toast dot ls               # List in SSM

# Git
toast git repo-name clone  # Clone repository
toast git repo-name branch -b branch-name  # Create branch
toast git repo-name pull -r  # Pull with rebase

Creating Plugins

  1. Create a file in toast/plugins/
  2. Extend BasePlugin
  3. Implement required methods
  4. Set name and help variables
from toast.plugins.base_plugin import BasePlugin
import click

class MyPlugin(BasePlugin):
    name = "mycommand"
    help = "Command description"

    @classmethod
    def get_arguments(cls, func):
        func = click.option("--option", "-o", help="Option description")(func)
        return func

    @classmethod
    def execute(cls, **kwargs):
        option = kwargs.get("option")
        click.echo(f"Executing with option: {option}")

Aliases

alias t='toast'
c() { cd "$(toast cdw)" }
alias m='toast am'      # AWS identity
alias x='toast ctx'     # Kubernetes contexts
alias d='toast dot'     # Environment files
alias e='toast env'     # AWS profiles
alias g='toast git'     # Git repositories
alias r='toast region'  # AWS region

Resources

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

toast_cli-3.3.1.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

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

toast_cli-3.3.1-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file toast_cli-3.3.1.tar.gz.

File metadata

  • Download URL: toast_cli-3.3.1.tar.gz
  • Upload date:
  • Size: 28.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for toast_cli-3.3.1.tar.gz
Algorithm Hash digest
SHA256 cea1f396068803fec5ee5eef8640016c70574d18ca6b5f0f0380864baad722c8
MD5 15cbf7839e2b64de7bfeba0b3eb336e9
BLAKE2b-256 a5829e31d0c7621063dc0c30600452cd3651ccbd5326f43e0e9d235c3eb4cf7f

See more details on using hashes here.

File details

Details for the file toast_cli-3.3.1-py3-none-any.whl.

File metadata

  • Download URL: toast_cli-3.3.1-py3-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for toast_cli-3.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a496e227ea98249d0d3313da6569fe61d928c35cfa7c47c16415779e1148cbb8
MD5 fc32d50045f0e7357e6d030317cb6bfa
BLAKE2b-256 442d55234f58c2a4ec2cc9f579c264f0bef24d7b696b259efda43adb38b83dbe

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