A Python-based CLI utility with a plugin architecture for AWS, Kubernetes, Git, and more
Project description
toast-cli
_ _ _ _
| |_ ___ __ _ ___| |_ ___| (_)
| __/ _ \ / _` / __| __|__ / __| | |
| || (_) | (_| \__ \ ||___| (__| | |
\__\___/ \__,_|___/\__| \___|_|_|
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 Region Management (
toast region) - AWS Profile Management (
toast env) - IAM Identity Checking (
toast am)
- AWS Region Management (
- Kubernetes Features
- Context Switching (
toast ctx)
- Context Switching (
- Git Features
- Git Repository Management (
toast git)
- Git Repository Management (
- Environment Management
- .env.local file management with AWS SSM integration (
toast local)
- .env.local file management with AWS SSM integration (
- Workspace Features
- Directory Navigation (
toast cdw)
- Directory Navigation (
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 env # Manage AWS profiles
toast git # Manage Git repositories
toast local # Manage .env.local files
toast region # Set AWS region
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' # Manage AWS profiles
alias r='toast region' # Set AWS region
alias x='toast ctx' # Switch Kubernetes context
alias g='toast git' # Git operations
alias l='toast local' # Manage .env.local files
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.13.tar.gz.
File metadata
- Download URL: toast_cli-3.0.13.tar.gz
- Upload date:
- Size: 28.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70e0ad07158bd8af8a52367b31022ffd1bb3c2e94d7c81a0fed7f2125076ef21
|
|
| MD5 |
cc8618b862dd1febdde4b545f0187217
|
|
| BLAKE2b-256 |
e66098d6c49cf9946e4e14c2fba92046179e49f6df83e813dd2ee1b1650862a3
|
File details
Details for the file toast_cli-3.0.13-py3-none-any.whl.
File metadata
- Download URL: toast_cli-3.0.13-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17d8e6611c2ab15686fc3871e7f14a3c65e7bd5160bb4bf18a1e92f0e2a14550
|
|
| MD5 |
ed3908a425e15f70cf774911190eaecb
|
|
| BLAKE2b-256 |
7d51ba2a858dbda917a4afc559f4825b3fcff623fbd2c780e20fe8a365fd58d7
|