Shortcuts TUI
A comprehensive terminal user interface (TUI) application for displaying and managing tools and shortcuts from configuration files.
Features
- 🖥️ Modern TUI Interface - Built with ratatui for a responsive terminal experience
- 📁 Multiple Configuration Formats - Support for both TOML and JSON configuration files
- 🌐 Cross-Platform Config Discovery - Automatic configuration file discovery across Windows, macOS, Linux, and Android/Termux
- 🔧 Environment Variable Support - Use
SHORTCUTS_CONFIGenvironment variable to specify config file location - 🔍 Powerful Search - Search across tool names, descriptions, tags, and metadata
- 🏷️ Flexible Organization - Organize tools by categories and tags
- ⌨️ Keyboard Shortcuts - Define and display keyboard shortcuts for quick access
- 🚀 Command Execution - Execute tool commands directly from the interface
- ✅ Configuration Validation - Built-in validation with helpful error messages
- 📊 Multiple Views - Tools, categories, search, and help views
- 🎨 Customizable - Extensible design for easy customization
Quick Start
Installation
Install from crates.io:
Or build from source:
Basic Usage
-
Create a sample configuration:
-
Edit the configuration file to add your tools and shortcuts
-
Run the TUI application:
# Option 1: Specify config file directly # Option 2: Use environment variable # Option 3: Place config in a standard location and let it auto-discover
Command Line Interface
shortcuts-tui [OPTIONS] [SUBCOMMAND]
OPTIONS:
-c, --config <FILE> Configuration file path (TOML or JSON)
-v, --verbose Increase logging verbosity
-h, --help Print help information
-V, --version Print version information
SUBCOMMANDS:
init Initialize a new configuration file
validate Validate a configuration file
list List tools from configuration
help Print this message or the help of the given subcommand(s)
Configuration
Configuration File Loading
Shortcuts TUI provides flexible configuration loading with multiple options:
1. Environment Variable
Set the SHORTCUTS_CONFIG environment variable to specify a configuration file:
2. Command Line Argument
Specify a configuration file using the --config flag (overrides environment variable):
3. Automatic Discovery
If no configuration is specified, shortcuts-tui searches in these locations (in order):
On All Platforms:
- Current directory (
.) - User config directory (varies by platform)
Linux/Unix/macOS:
/etc/shortcuts-tui//usr/local/etc/shortcuts-tui/$XDG_CONFIG_HOME/shortcuts-tui/(if XDG_CONFIG_HOME is set)$HOME/.config/shortcuts-tui/$HOME/.shortcuts-tui/
Windows:
%PROGRAMDATA%\shortcuts-tui\%APPDATA%\shortcuts-tui\%LOCALAPPDATA%\shortcuts-tui\
Android/Termux:
$PREFIX/etc/shortcuts-tui/(usually/data/data/com.termux/files/usr/etc/shortcuts-tui/)$HOME/.config/shortcuts-tui/$HOME/.shortcuts-tui/
For each directory, it searches for files named:
shortcuts.toml,shortcuts.jsonconfig.toml,config.jsontools.toml,tools.json
Configuration Format
Shortcuts TUI supports both TOML and JSON configuration formats. The configuration consists of:
- Metadata - Information about your tool collection
- Categories - Optional groupings for your tools
- Tools - The actual tools and shortcuts
TOML Example
[]
= "My Development Tools"
= "A collection of useful development tools and shortcuts"
= "1.0"
= "Developer"
[[]]
= "dev"
= "Development"
= "Software development tools"
= "💻"
= "blue"
[[]]
= "system"
= "System"
= "System administration tools"
= "⚙️"
= "red"
[[]]
= "git_status"
= "Git Status"
= "Check git repository status"
= "git status"
= "Ctrl+G S"
= "dev"
= ["git", "vcs"]
= 10
= true
[]
= "https://git-scm.com/docs/git-status"
[[]]
= "disk_usage"
= "Disk Usage"
= "Check disk usage"
= "df -h"
= "system"
= ["disk", "monitoring"]
= 5
= true
JSON Example
TUI Interface
Navigation
- Arrow Keys / j,k - Navigate up/down in lists
- 1-4 - Switch between views (Tools, Categories, Search, Help)
- Tab - Switch between panels
- Enter - Execute selected tool
- Space - Show tool details
- / - Start search
- Esc - Cancel search/close popup
- q / Ctrl+C - Quit application
Views
- Tools View - Main list of tools with details panel
- Categories View - Browse tools by category
- Search View - Search and filter tools
- Help View - Keyboard shortcuts and help
Configuration Schema
Tool Properties
| Property | Type | Required | Description |
|---|---|---|---|
id |
String | ✅ | Unique identifier |
name |
String | ✅ | Display name |
description |
String | ❌ | Tool description |
command |
String | ❌ | Command to execute |
shortcut |
String | ❌ | Keyboard shortcut |
category |
String | ❌ | Category ID |
tags |
Array | ❌ | Tags for searching |
metadata |
Object | ❌ | Custom key-value pairs |
enabled |
Boolean | ❌ | Whether tool is active (default: true) |
priority |
Integer | ❌ | Sort priority (default: 0) |
Category Properties
| Property | Type | Required | Description |
|---|---|---|---|
id |
String | ✅ | Unique identifier |
name |
String | ✅ | Display name |
description |
String | ❌ | Category description |
icon |
String | ❌ | Icon or emoji |
color |
String | ❌ | Color theme |
Library Usage
Shortcuts TUI can also be used as a library in your Rust projects:
use ;
Examples
The examples/ directory contains several examples:
basic_usage.rs- Creating configuration programmaticallyconfig_loader.rs- Different ways to load configurations
Run examples with:
Development
Building
Testing
# Run unit tests
# Run integration tests
# Run all tests with logging
RUST_LOG=debug
# Run expensive tests (large configurations)
Linting
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Development Setup
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Changelog
See CHANGELOG.md for a detailed list of changes in each version.