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

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
    • IAM Identity Checking (toast am)
    • AWS Profile Management (toast env)
    • AWS Region Management (toast region)
  • Workspace Features
    • Directory Navigation (toast cdw)
  • Environment Management
    • .env.local file management with AWS SSM integration (toast dot)
  • Kubernetes Features
    • Context Switching (toast ctx)
  • Git Features
    • Git Repository Management (toast git)

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
  • 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-cli.git

# Install in development mode from local clone
git clone https://github.com/opspresso/toast-cli.git
cd toast-cli
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 dot          # Manage .env.local files
toast env          # Manage AWS profiles
toast git          # Manage Git repositories
toast region       # Manage AWS region

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'

# Navigate workspace directories
c() {
  cd "$(toast cdw)"
}

# Common Command Aliases
alias i='toast am'      # Show AWS identity
alias x='toast ctx'     # Manage Kubernetes contexts
alias l='toast dot'     # Manage .env.local files
alias e='toast env'     # Manage AWS profiles
alias g='toast git'     # Manage Git repositories
alias r='toast region'  # Manage AWS region

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.1.2.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.1.2-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: toast_cli-3.1.2.tar.gz
  • Upload date:
  • Size: 28.4 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.1.2.tar.gz
Algorithm Hash digest
SHA256 3f8602295d88f29f05320be91ce7a7bd1ef5beec82ce0bf7a686a7691d0847f8
MD5 8c3229d567b390a232ce62cd0115f75d
BLAKE2b-256 2b336524a7cf6d2aa8ced9a3f88049231f82e90d0585f636301e7f6123091f9e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: toast_cli-3.1.2-py3-none-any.whl
  • Upload date:
  • Size: 27.1 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.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 61fb36a7a26a349489b74ae2ee16aeb3c8a28f945484e8ef3871315bad0abf38
MD5 e7350daf89587dcf3c47299e419aa7d5
BLAKE2b-256 1423d7bc48d58fd72be7459d2d4aafaff26313c4ca0e7c1d3bf19307744e0ea8

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