toast-cli
_ _ _ _
| |_ ___ __ _ ___| |_ ___| (_)
| __/ _ \ / _` / __| __|__ / __| | |
| || (_) | (_| \__ \ ||___| (__| | |
\__\___/ \__,_|___/\__| \___|_|_|

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/push 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
pip install toast-cli
pip install git+https://github.com/opspresso/toast-cli.git
git clone https://github.com/opspresso/toast-cli.git
cd toast-cli
pip install -e .
Usage
toast --help
toast am
toast cdw
toast ctx
toast dot
toast env
toast git
toast region
toast version
Examples
toast am
toast env
toast region
toast ctx
toast dot up
toast dot down
toast dot ls
toast git repo-name clone
toast git repo-name branch -b branch-name
toast git repo-name pull -r
toast git repo-name push
toast git repo-name push --mirror
Configuration
GitHub Host Configuration
Configure custom GitHub hosts for different organizations by creating .toast-config
files:
echo "GITHUB_HOST=github.enterprise.com" > ~/workspace/github.com/myorg/.toast-config
echo "GITHUB_HOST=myorg-github.com" > ~/workspace/github.com/myorg/.toast-config
Example SSH config (~/.ssh/config
):
Host myorg-github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_myorg
This allows different organizations to use different GitHub accounts and SSH keys automatically.
Creating Plugins
- Create a file in
toast/plugins/
- Extend
BasePlugin
- Implement required methods
- 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'
alias x='toast ctx'
alias d='toast dot'
alias e='toast env'
alias g='toast git'
alias r='toast region'
Resources