Skip to main content

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

Project description

toast.sh

 _                  _         _
| |_ ___   __ _ ___| |_   ___| |__
| __/ _ \ / _' / __| __| / __| '_ \
| || (_) | (_| \__ \ |_ _\__ \ | | |
 \__\___/ \__,_|___/\__(-)___/_| |_|

build release

Toast is a Python-based CLI utility with a plugin architecture that simplifies the use of CLI tools for AWS, Kubernetes, Git, and more.

Key Features

  • Plugin-based architecture for easy extensibility
  • Dynamic command discovery and loading
  • AWS Features
    • AWS Profile Management (toast env)
    • AWS Region Management (toast region)
    • IAM Identity Checking (toast am)
  • Kubernetes Features
    • Context Switching (toast ctx)
  • Workspace Features
    • Directory Navigation (toast cdw)
  • Other Utilities
    • System Update (toast update)
    • AWS SSM Commands (toast ssm)

Plugin Architecture

Toast uses a plugin-based architecture powered by Python's importlib and pkgutil modules:

  • Each command is implemented as a separate plugin
  • Plugins are automatically discovered and loaded at runtime
  • New functionality can be added without modifying existing code

See ARCHITECTURE.md for detailed information about the design.

Installation

Requirements

  • Python 3.6+
  • Click package
  • Python-dotenv package
  • External tools used by various plugins:
    • fzf: Interactive selection in terminal
    • jq: JSON processing for formatted output
    • aws-cli: AWS command line interface
    • kubectl: Kubernetes command line tool

Installation Methods

# Install from PyPI
pip install toast-cli

# Update to latest version
pip install --upgrade toast-cli

# Install specific version
pip install toast-cli==3.0.0

# Install development version from GitHub
pip install git+https://github.com/opspresso/toast.sh.git

# Install in development mode from local clone
git clone https://github.com/opspresso/toast.sh.git
cd toast.sh
pip install -e .

Creating Symbolic Link (Optional)

If toast command is not available in your PATH after installation:

# Create a symbolic link to make it available system-wide
sudo ln -sf $(which toast) /usr/local/bin/toast

Usage

# View available commands
toast --help

# Run a specific command
toast am           # Show AWS identity
toast cdw          # Navigate workspace directories
toast ctx          # Manage Kubernetes contexts
toast env          # Set environment
toast region       # Set AWS region
toast ssm          # Run AWS SSM commands
toast update       # Update CLI tool

Extending with Plugins

To add a new plugin:

  1. Create a new Python file in the plugins directory
  2. Define a class that extends BasePlugin
  3. Implement the required methods (execute and optionally get_arguments)
  4. Set the name and help class variables

Example plugin:

from plugins.base_plugin import BasePlugin
import click

class MyPlugin(BasePlugin):
    name = "mycommand"
    help = "Description of my command"

    @classmethod
    def execute(cls, **kwargs):
        click.echo("My custom command execution")

Aliases

alias t='toast'

# Directory Navigation
c() {
  cd "$(toast cdw)"
}

# Common Command Aliases
alias i='toast am'      # Check AWS IAM info
alias e='toast env'     # Set AWS profile
alias r='toast region'  # Set AWS region
alias x='toast ctx'     # Switch Kubernetes context

License

This project is licensed under the GNU General Public License v3.0.

Contributing

Bug reports, feature requests, and pull requests are welcome through the GitHub repository.

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.0.0.1.tar.gz (29.6 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.0.0.1-py3-none-any.whl (25.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for toast_cli-3.0.0.1.tar.gz
Algorithm Hash digest
SHA256 0bc8fe377238d3efd1a49747e620d284e21febda72f0193527db1be71badcb1b
MD5 6e2da5e70eecbc5e4dcf943162469449
BLAKE2b-256 65238eafab36f6e9d4a46f11d4c672fffe8d3719501f7e94a62ea0d5cfdb309e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for toast_cli-3.0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a266fcd30c398554602badb307957b3a9dbb8e14623bfeb4909fdb405392ab8f
MD5 e458f81bd3265cb3e6e3c7ed5497e6df
BLAKE2b-256 2ebf9fa3f36bbb1a6866992be3fb8b7771aec94708fedd40209c5c80068446e2

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