Usage Guide: Smart-Shell

July 1, 2025 ยท View on GitHub

This guide covers all special commands, system-level commands, and usage patterns for Smart-Shell, including both CLI and interactive modes.


Quick Start

  • Interactive Mode:
    smart-shell --interactive
    
  • One-off Command:
    smart-shell run "list all PDF files in the current directory"
    
  • Help:
    smart-shell --help
    

Special Commands (Interactive Mode)

Type these at the Smart-Shell prompt (not in your system shell):

CommandDescription
!helpShow help message
!historyShow command history
!lastShow the last generated command
!redoRe-execute the last command
!clearClear the screen
!modelsList available AI models
!models freeList only free models
!models premiumList only premium models
!models legacyList only legacy models
!models refreshRefresh model info from web sources
!model <model-name>Switch to a different AI model (with cost warning)
!webToggle web search for commands
!updateCheck for updates from GitHub and install
!errorsShow the error log
!forget-sudoClear the session sudo password
!creatorShow information about the creator
!docsShow link to documentation
  • Exit: Type exit, quit, bye, q, or press Ctrl+C.

System-Level CLI Commands

Run these in your system shell:

CommandDescription
smart-shell run <prompt>Run a one-off natural language command
smart-shell --interactiveStart interactive mode
smart-shell setupConfigure API key and settings
smart-shell modelsList available models
smart-shell historyShow command history
smart-shell --help or -hShow CLI help
smart-shell version or --versionShow version information
smart-shell --dry-run or -dShow command without executing
smart-shell --yes or -yAuto-confirm all prompts

Advanced Features

  • Protected Prompt: When typing, backspacing won't delete the "Smart-Shell (model):" prefix.
  • Smart Command Detection: If you try to run Smart-Shell commands inside Smart-Shell, it will guide you to exit first.
  • Robust Update System: !update checks GitHub for the latest version and updates automatically.
  • Enhanced AI: More resilient command generation with better error handling.
  • Y/N Confirmations: All confirmations accept both y/yes and n/no in any case.

Safety System

Smart-Shell includes a comprehensive safety system with confirmation prompts:

  • ๐ŸŸข Safe: Command is safe to run (executed automatically).
  • ๐ŸŸก Medium Risk: Commands like sudo operations (requires y/n confirmation).
  • ๐Ÿ”ด High Risk: Dangerous commands like rm -rf (requires y/n confirmation).

All medium and high-risk commands require explicit user confirmation before execution. You can respond with y/yes or n/no (case insensitive).


Configuration

  • To reconfigure, exit Smart-Shell and run:
    smart-shell setup
    

Documentation


Notes

  • Premium models may incur costs or have stricter rate limits.
  • All commands and features are available in both Bash and Zsh environments.
  • For troubleshooting, use !errors or check the error log.

For more details, see the full documentation or use !help in interactive mode.