| Crates.io | shortcuts-tui |
| lib.rs | shortcuts-tui |
| version | 0.2.1 |
| created_at | 2025-08-21 13:34:36.840233+00 |
| updated_at | 2025-08-21 21:50:33.697311+00 |
| description | A cross-platform terminal user interface (TUI) application for managing and executing tools and shortcuts with environment variable support and automatic configuration discovery |
| homepage | |
| repository | https://github.com/Ajaymamtora/shortcuts-and-tools |
| max_upload_size | |
| id | 1804852 |
| size | 410,897 |
A comprehensive terminal user interface (TUI) application for displaying and managing tools and shortcuts from configuration files.
SHORTCUTS_TUI_CONFIG environment variable to specify config file locationInstall from crates.io:
cargo install shortcuts-tui
Or build from source:
git clone https://github.com/yourusername/shortcuts-and-tools
cd shortcuts-and-tools
cargo build --release
Create a sample configuration:
shortcuts-tui init my-tools.toml
Edit the configuration file to add your tools and shortcuts
Run the TUI application:
# Option 1: Specify config file directly
shortcuts-tui --config my-tools.toml
# Option 2: Use environment variable
export SHORTCUTS_TUI_CONFIG="my-tools.toml"
shortcuts-tui
# Option 3: Place config in a standard location and let it auto-discover
mkdir -p ~/.config/shortcuts-tui
mv my-tools.toml ~/.config/shortcuts-tui/shortcuts.toml
shortcuts-tui
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)
Shortcuts TUI provides flexible configuration loading with multiple options:
Set the SHORTCUTS_TUI_CONFIG environment variable to specify a configuration file:
export SHORTCUTS_TUI_CONFIG="/path/to/my/config.toml"
shortcuts-tui # Automatically uses the config from environment variable
Specify a configuration file using the --config flag (overrides environment variable):
shortcuts-tui --config /path/to/my/config.toml
If no configuration is specified, shortcuts-tui searches in these locations (in order):
On All Platforms:
.)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.jsonShortcuts TUI supports both TOML and JSON configuration formats. The configuration consists of:
[metadata]
title = "My Development Tools"
description = "A collection of useful development tools and shortcuts"
version = "1.0"
author = "Developer"
[[categories]]
id = "dev"
name = "Development"
description = "Software development tools"
icon = "💻"
color = "blue"
[[categories]]
id = "system"
name = "System"
description = "System administration tools"
icon = "⚙️"
color = "red"
[[tools]]
id = "git_status"
name = "Git Status"
description = "Check git repository status"
command = "git status"
shortcut = "Ctrl+G S"
category = "dev"
tags = ["git", "vcs"]
priority = 10
enabled = true
[tools.metadata]
documentation = "https://git-scm.com/docs/git-status"
[[tools]]
id = "disk_usage"
name = "Disk Usage"
description = "Check disk usage"
command = "df -h"
category = "system"
tags = ["disk", "monitoring"]
priority = 5
enabled = true
{
"metadata": {
"title": "My Development Tools",
"description": "A collection of useful development tools and shortcuts",
"version": "1.0",
"author": "Developer"
},
"categories": [
{
"id": "dev",
"name": "Development",
"description": "Software development tools",
"icon": "💻",
"color": "blue"
}
],
"tools": [
{
"id": "git_status",
"name": "Git Status",
"description": "Check git repository status",
"command": "git status",
"shortcut": "Ctrl+G S",
"category": "dev",
"tags": ["git", "vcs"],
"priority": 10,
"enabled": true,
"metadata": {
"documentation": "https://git-scm.com/docs/git-status"
}
}
]
}
| 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) |
| 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 |
Shortcuts TUI can also be used as a library in your Rust projects:
use shortcuts_tui::{
config::{Config, Tool, Category, loader::ConfigLoader},
ui::TuiApp,
error::Result,
};
fn main() -> Result<()> {
// Load configuration
let loader = ConfigLoader::new();
let config = loader.load_file("my-config.toml")?;
// Create and run TUI
let app = TuiApp::new(config)?;
app.run()?;
Ok(())
}
The examples/ directory contains several examples:
basic_usage.rs - Creating configuration programmaticallyconfig_loader.rs - Different ways to load configurationsRun examples with:
cargo run --example basic_usage
cargo run --example config_loader
cargo build
# Run unit tests
cargo test
# Run integration tests
cargo test --test integration_tests
# Run all tests with logging
RUST_LOG=debug cargo test
# Run expensive tests (large configurations)
cargo test --features expensive_tests
cargo clippy
cargo fmt
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.
This project is licensed under either of
at your option.
See CHANGELOG.md for a detailed list of changes in each version.