6e2880c0788d0cd6b57c9e607ae0d83621cb8757
Shell Memory CLI
A CLI tool that learns from your terminal command patterns to automate repetitive workflows. It records command sequences, detects patterns, suggests time-saving shortcuts, and can generate shell scripts from natural language descriptions.
Features
- Command Recording: Save frequently used commands with descriptions and tags
- Pattern Detection: Automatically detect repeated command sequences and workflows
- Command Library: Personal searchable command library with tagging system
- Session Recording: Record terminal sessions for replay
- Script Generation: Generate shell scripts from natural language descriptions
Installation
# Clone the repository
cd shell-memory-cli
# Install dependencies
pip install -r requirements.txt
# Install the package
pip install -e .
Quick Start
Record a Command
# Add a command to your library
shell-memory cmd add "git status" -d "Check repository status" -t git -t vcs
# List all commands
shell-memory cmd list
# Search for commands
shell-memory cmd search git
Detect Patterns
# Detect patterns in your command history
shell-memory pattern detect
# View workflow statistics
shell-memory pattern stats
# Get suggestions for shortcuts
shell-memory pattern suggestions
Record Sessions
# Start recording a session
shell-memory session start my-workflow
# Record commands during the session
shell-memory session record "cd /path/to/project"
shell-memory session record "npm install"
shell-memory session record "npm test"
# Stop recording
shell-memory session stop
# List all sessions
shell-memory session list
# Replay a session
shell-memory session replay 1
# Export session as shell script
shell-memory session export 1 -o workflow.sh
Generate Scripts
# Generate a shell script from natural language
shell-memory script generate "deploy application to production"
# List available templates
shell-memory script templates
# Add a custom template
shell-memory script add-template deploy production "#!/bin/bash\necho deploying..."
Configuration
Set environment variables to customize behavior:
| Variable | Description | Default |
|---|---|---|
SHELL_MEMORY_DB |
Path to SQLite database file | ~/.shell_memory/shell_memory.db |
SHELL_MEMORY_HOME |
Base directory for data | ~/.shell_memory |
SHELL_MEMORY_VERBOSE |
Enable verbose output | false |
SHELL_MEMORY_FORMAT |
Output format (table, json, plain) | table |
Commands Reference
Command Management (cmd)
shell-memory cmd add <command>- Add a command to libraryshell-memory cmd list- List all commandsshell-memory cmd search <query>- Search commandsshell-memory cmd delete <id>- Delete a commandshell-memory cmd similar <command>- Find similar commands
Pattern Detection (pattern)
shell-memory pattern detect- Detect patterns in command historyshell-memory pattern suggestions- Get workflow shortcutsshell-memory pattern stats- View workflow statistics
Session Recording (session)
shell-memory session start [name]- Start recordingshell-memory session record <command>- Record a commandshell-memory session stop- Stop and save sessionshell-memory session list- List all sessionsshell-memory session replay <id>- Replay a sessionshell-memory session export <id>- Export as script
Script Generation (script)
shell-memory script generate <description>- Generate scriptshell-memory script templates- List templatesshell-memory script add-template <keywords> <description> <template>- Add template
License
MIT
Description
A CLI tool that learns from terminal command patterns to automate repetitive workflows