Mixtape CLI
Session storage and REPL utilities for mixtape agents.
Session Persistence
Store conversations in SQLite so they survive restarts:
use ;
use SqliteStore;
async
Sessions are scoped to the current working directory. Each directory gets its own conversation history.
Custom Location
let store = new?;
Parent directories are created automatically.
Interactive REPL
Run a full-featured CLI for your agent:
use ;
use run_cli;
async
The REPL provides:
- Command history with up/down arrows
- Reverse search with Ctrl+R
- Multi-line input with Ctrl+J
- Special commands (
/help,/clear,!shell) - Rich tool output formatting
- Context usage display
Tool Permissions
For agents that need user confirmation before running tools, use the permission system:
use ;
use run_cli;
async
Tools without a matching grant will emit PermissionRequired events. The REPL handles these
by prompting the user interactively.
Approval Prompters
The CLI provides pluggable approval UX via the ApprovalPrompter trait:
use ;
use AuthorizationResponse;
// Use the default prompter
let prompter = SimplePrompter;
let choice: AuthorizationResponse = prompter.prompt;
The SimplePrompter offers four options:
y- approve once (don't remember)e- trust this exact call (session)t- trust entire tool (session)n- deny
Implement ApprovalPrompter for custom approval UX (e.g., GUI dialogs, web interfaces).
Exports
| Item | Purpose |
|---|---|
SqliteStore |
SQLite-based session storage |
run_cli |
Interactive REPL loop |
ApprovalPrompter |
Trait for custom approval UX |
SimplePrompter |
Default approval prompter |
DefaultPrompter |
Type alias for SimplePrompter |
PermissionRequest |
Permission request data for prompters |
prompt_for_approval |
Convenience function using default prompter |
PresentationHook |
Rich tool output formatting hook |
Verbosity |
Output verbosity level |
CliError |
Error type for CLI operations |