Overview
The Splat CLI provides an interactive command-line interface built with Click and cmd. It enables terminal session management, command execution, and process monitoring through a REPL-style shell.ZapShell Class
The main interactive shell class that handles command processing and terminal session lifecycle.Constructor
ctx- Click context for command executionzapper- Zapper instance for core functionalityterm_sesh- TermSesh instance for terminal session management
Commands
hello
Display a greeting message.echo
Echo the provided input back to the user.arg(str) - Text to echo
start
Start up the terminal session using tmux with process monitoring.- Initializes Zapper instance
- Creates TermSesh with session name ‘zapper_session’
- Opens new terminal window
- Starts ProcessMonitor for output tracking
- Sends status messages via ZMQ publisher
send
Send a command to the active terminal session.arg(str) - Command to execute in terminal
- Confirmation message if command was sent successfully
exit / quit
Exit the CLI application and clean up resources.- Stops process monitor
- Terminates terminal process
- Kills tmux session
- Returns True to exit shell
quitEOF(Ctrl+D)
Special Methods
precmd
Checks terminal status before executing each command.default
Handles unknown commands by forwarding them to the active terminal session.CLI Entry Points
cli()
Main Click group that starts the interactive shell.version()
Display the CLI version.main()
Application entry point with keyboard interrupt handling.Example Session
Source Reference
See/home/daytona/workspace/source/cli/cli.py for complete implementation.