The new Interactive CLI Mode provides a powerful, user-friendly interface for searching and managing commands. It supports both natural language queries and traditional search patterns.
Launch interactive mode using any of these commands:
scmd.exe --interactive
scmd.exe -i
scmd.exe --cliAsk questions naturally, and SCMD will extract keywords and search for you:
scmd> provide me with postgresql replication example
scmd> show me docker commands
scmd> how to check kubernetes pods
scmd> find git commands for branches
The system automatically removes common question words and extracts the relevant search terms.
Type keywords directly without any command prefix:
scmd> postgresql replication
scmd> docker,kubernetes
scmd> git branch
Use slash commands for specific actions:
scmd> /help
scmd> /?
scmd> /search postgresql replication
scmd> /search docker,kubernetes
scmd> /add docker ps -a | List all containers
scmd> /add kubectl get pods | Show all Kubernetes pods
Note: Use the pipe symbol | to separate command and description.
scmd> /list
Shows the 10 most recent commands in the database.
scmd> /count
Displays the total number of commands in the database.
scmd> /clear
scmd> /cls
scmd> /exit
scmd> /quit
scmd> /q
For convenience, these commands also work without the slash:
helpor?- Show help messageclearorcls- Clear the screenexit,quit, orq- Exit interactive mode
╔════════════════════════════════════════════════════════════════╗
║ SCMD Interactive CLI - PostgreSQL Edition ║
║ Version 1.3.8 ║
╚════════════════════════════════════════════════════════════════╝
Type 'help' for available commands or 'exit' to quit
You can search using:
- Natural language: provide me with postgresql replication example
- Search command: /search postgresql replication
- Direct pattern: postgresql replication
scmd> provide me with postgresql replication on master example
Found 1 result(s) for: postgresql replication master
══════════════════════════════════════════════════════════════
ID: 785
Description: Postgresql Replication check on Master Server inside a docker container
Command:
$ docker exec POSTGRESQL psql -U ricardo -c "SELECT * FROM pg_stat_replication;"
──────────────────────────────────────────────────────────────
scmd> /search docker,kubernetes
Found 15 result(s) for: docker,kubernetes
══════════════════════════════════════════════════════════════
[Results displayed here...]
scmd> /add docker logs -f mycontainer | Follow container logs in real-time
✓ Command added successfully!
Command: docker logs -f mycontainer
Description: Follow container logs in real-time
scmd> /count
Total commands in database: 1247
scmd> exit
Goodbye!
The system removes common question words and phrases:
- "show me", "give me", "provide me with"
- "how to", "how do i"
- "what is", "what are"
- "can you", "please"
- "i need", "i want"
- "looking for", "search for"
- "example", "examples"
- "command", "commands"
- Case-insensitive search using PostgreSQL ILIKE
- Searches both command text and descriptions
- Supports comma-separated patterns for multiple terms
- Results are ordered by ID
# Search
scmd.exe --search "postgresql replication"
# Add command
scmd.exe --save "docker ps -a" "List all containers"scmd> postgresql replication
scmd> /add docker ps -a | List all containers
- No need to remember exact syntax - Ask questions naturally
- Faster workflow - Stay in one session for multiple queries
- Immediate feedback - See results instantly
- Easy command management - Add, search, and list in one place
- User-friendly - Clear prompts and formatted output
- Use natural language for quick searches without worrying about syntax
- Use /search when you want to be explicit about searching
- Use /add to quickly add commands you discover
- Use /list to browse recent additions
- Use comma-separated patterns to search multiple terms at once
Ctrl+C- Exit interactive mode (alternative to typing 'exit')Enteron empty line - Does nothing (safe to press)
The interactive mode provides clear error messages:
- No results found - Suggests trying different keywords
- Duplicate command - Warns when trying to add existing command
- Database errors - Shows connection or query errors
- Invalid syntax - Provides usage examples
Interactive mode uses the same PostgreSQL backend as:
- Traditional CLI search (
--search) - Traditional CLI save (
--save) - Web interface
All commands added in interactive mode are immediately available in all interfaces.
- Fast startup - Connects to PostgreSQL once at launch
- Instant searches - Direct database queries
- Efficient - Reuses database connection for all operations
- Responsive - No delays between commands
Potential future features:
- Command history (up/down arrows)
- Auto-completion
- Fuzzy search
- Command editing
- Batch operations
- Export/import commands
- Favorites/bookmarks
Ensure your .env file has correct PostgreSQL credentials and the database is running.
Try:
- Different keywords
- Broader search terms
- Check if data exists with
/count
Verify:
- Command was added successfully (look for ✓ message)
- Database connection is stable
- Table name in
.envis correct
For issues or questions about interactive mode:
- Type
helpin interactive mode - Check this documentation
- Review POSTGRESQL_MIGRATION.md for database setup
- Test connection with
test_connection.go