A lightweight Flask application for storing, searching, and managing your shell commands with both a web UI and CLI client.
- π Web Interface β Clean Bootstrap 5 UI with search, pagination, and mobile support
- π» CLI Client β Pure Bash client for terminal workflows (
repocomcli) - π Search β Full-text search across commands, descriptions, and tags
- π Copy to Clipboard β One-click copy from web or CLI
- π€ Export/Import β Backup and restore your commands as JSON
- π³ Docker Ready β Easy deployment with persistent storage
- π·οΈ Tagging β Organize commands with comma-separated tags
# Pull and run with persistent storage
docker run -d \
--name command-cli \
--restart unless-stopped \
-p 5001:5001 \
-v command-cli-data:/app/instance \
ftsiadimos/command-cli-image:latestOpen http://localhost:5001 in your browser.
# Clone the repository
git clone https://github.com/ftsiadimos/command-cli-repo
cd command-cli-repo
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Run the application
python app.pyOpen http://127.0.0.1:5000 in your browser.
A pure Bash CLI client for managing commands from the terminal.
# Copy to your PATH
sudo cp repocomcli /usr/local/bin/
sudo chmod +x /usr/local/bin/repocomcli
# Configure the server (if not localhost)
repocomcli config set 192.168.1.100 --port 5001- curl (required)
- jq (recommended for better output)
- xclip or xsel (optional, for clipboard support)
# Add a new command
repocomcli add "docker ps -a" -d "List all containers" -t "docker"
# List all commands
repocomcli list
# Search commands
repocomcli list -s docker
# Show specific command details
repocomcli show 5
# Copy command to clipboard
repocomcli copy 5
# Export all commands to JSON
repocomcli export backup.json
# Import commands from JSON
repocomcli import backup.json
# View/change configuration
repocomcli config get
repocomcli config set myserver.local --port 5001| Command | Description |
|---|---|
add <cmd> [-d desc] [-t tags] |
Add a new command |
list [-s search] [-n limit] |
List commands with optional search/limit |
show <id> |
Display full details of a command |
copy <id> |
Copy command to clipboard |
export <file.json> |
Export all commands to JSON file |
import <file.json> |
Import commands from JSON file |
config get |
Show current configuration |
config set <host> [--port N] |
Configure API server |
--help |
Show help message |
--version |
Show version |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/commands |
List all commands |
GET |
/api/commands?search=<query> |
Search commands |
POST |
/api/commands |
Add a new command |
GET |
/export-json |
Export all commands as JSON |
POST |
/import-json |
Import commands from JSON |
Add a command:
curl -X POST http://localhost:5000/api/commands \
-H "Content-Type: application/json" \
-d '{
"command": "find . -name \"*.log\" -mtime +7 -delete",
"description": "Delete log files older than 7 days",
"tags": "cleanup,logs,find"
}'Search commands:
curl "http://localhost:5000/api/commands?search=docker"Export all commands:
curl http://localhost:5000/export-json -o backup.jsonExported JSON now includes subcommands (if present). Example exported item:
{
"id": 42,
"command": "git",
"description": "version control",
"tags": "git",
"created_at": "2026-02-14T12:00:00",
"subcommands": [
{ "command": "clone --recursive", "description": "Clone recursively" },
{ "command": "commit -m", "description": "Commit with message" }
]
}You can re-import that file (web UI or CLI) and subcommands will be preserved.---
version: '3.8'
services:
command-cli:
image: ftsiadimos/command-cli-image:latest
container_name: command-cli
restart: unless-stopped
ports:
- "5001:5001"
volumes:
- command-cli-data:/app/instance
volumes:
command-cli-data:command-cli/
βββ app.py # Flask application
βββ config.py # Configuration settings
βββ models.py # SQLAlchemy models
βββ forms.py # WTForms definitions
βββ repocomcli # Bash CLI client
βββ requirements.txt # Python dependencies
βββ Dockerfile # Docker build file
βββ docker-compose.yml # Docker Compose config
βββ instance/
β βββ app.db # SQLite database
βββ templates/ # Jinja2 templates
β βββ layout.html
β βββ index.html
β βββ add.html
β βββ edit.html
β βββ help.html
β βββ import.html
βββ static/
βββ js/ # JavaScript files
| Variable | Default | Description |
|---|---|---|
FLASK_ENV |
production |
Flask environment |
SECRET_KEY |
(random) | Session secret key |
The CLI stores its configuration in ~/.config/command-cli/config.json:
{
"api_base": "192.168.1.100",
"port": 5001
}This project is licensed under the GPT-3 License.
Fotios Tsiadimos
- GitHub: @ftsiadimos
Contributions, issues, and feature requests are welcome!
