A Python-based CLI utility with a plugin architecture for AWS, Kubernetes, Git, and more
Project description
toast.sh
_ _ _
| |_ ___ __ _ ___| |_ ___| |__
| __/ _ \ / _' / __| __| / __| '_ \
| || (_) | (_| \__ \ |_ _\__ \ | | |
\__\___/ \__,_|___/\__(-)___/_| |_|
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)
- AWS Profile Management (
- Kubernetes Features
- Context Switching (
toast ctx)
- Context Switching (
- Workspace Features
- Directory Navigation (
toast cdw)
- Directory Navigation (
- Other Utilities
- System Update (
toast update) - AWS SSM Commands (
toast ssm)
- System Update (
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
- Other dependencies based on specific plugin requirements (AWS CLI, kubectl, etc.)
Setup
# Clone the repository
git clone https://github.com/opspresso/toast.sh.git
cd toast.sh
# Make the script executable
chmod +x toast.py
# Optional: Create a symbolic link to make it available system-wide
sudo ln -sf $(pwd)/toast.py /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:
- Create a new Python file in the
pluginsdirectory - Define a class that extends
BasePlugin - Implement the required methods (execute and optionally get_arguments)
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file toast_cli-3.0.0.dev0.tar.gz.
File metadata
- Download URL: toast_cli-3.0.0.dev0.tar.gz
- Upload date:
- Size: 29.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fec7bdcb0a73cd34ec708a5e81f93e5e1674b277c10b1abf49aeee4f09dd75b
|
|
| MD5 |
329829907eade801f3a042b72e5a6049
|
|
| BLAKE2b-256 |
770950043e7865a40d12d6a3f7766089ab767ceac5ef4ea35fe9c329047586ee
|
File details
Details for the file toast_cli-3.0.0.dev0-py3-none-any.whl.
File metadata
- Download URL: toast_cli-3.0.0.dev0-py3-none-any.whl
- Upload date:
- Size: 25.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6a102db7e97a504a31a8514cc2ccfe0b170a46bd4c207d2c046c8f92376c9ea
|
|
| MD5 |
5ad2df56cd16bcf3ccc06881d3438abb
|
|
| BLAKE2b-256 |
1256740393926ac4fc296efbae59f69add85078216cd9feb81a2304c795eeb2c
|