Skip to content

Commit 765e95c

Browse files
feat: add config reload/edit hotkeys, automatic subdivisions, and AI automation prompts
1 parent 8be597b commit 765e95c

16 files changed

Lines changed: 289 additions & 62 deletions

File tree

README.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
```
2121

2222
2. **Initialize Configuration:**
23-
Create a config file at `~/.config/shortcuts/config.yaml`. See the [Configuration](#-configuration) section for details.
23+
Create a config file at `~/.config/shortcuts-tui/config.yaml`. See the [Configuration](#-configuration) section for details.
2424

2525
3. **Launch:**
2626
Simply run `shortcuts-tui`.
@@ -35,10 +35,54 @@
3535
- **📖 Markdown Documentation:** Renders `.md` files with beautiful formatting for your guides and cheatsheets.
3636
- **⌨️ Vim-First Navigation:** Full support for `j/k`, `d/u`, and `f/b` motions.
3737
- **📂 Multi-Tab Interface:** Organize your workflows into logical tabs (e.g., "Dev", "Ops", "Guides").
38+
- **🗂 Automatic Subdivisions:** Group items within tabs by placing files in subdirectories (e.g., `work/git.zsh` becomes `[Work > Git]`).
39+
- **🤖 AI Automation:** Use the included [Prompts](prompts/generate_aliases.md) to generate aliases from your command history.
3840
- **🎨 Catppuccin Theme:** Built-in support for the high-contrast Catppuccin Mocha palette.
3941

4042
---
4143

44+
## 🤖 AI Automation
45+
46+
You can automate the creation of your aliases using the system prompt found in `prompts/generate_aliases.md`. This is the fastest way to turn your command history into a searchable TUI interface.
47+
48+
### Using Gemini CLI (Recommended)
49+
```bash
50+
history -n -50 | gemini -p "$(cat prompts/generate_aliases.md)" >> ~/.dotfiles/scripts/local/generated.zsh
51+
```
52+
53+
### Using Claude Code
54+
```bash
55+
history -n -50 | claude -p "$(cat prompts/generate_aliases.md)" >> ~/.dotfiles/scripts/local/generated.zsh
56+
```
57+
58+
### Using OpenAI CLI
59+
```bash
60+
history -n -50 | openai api chat.completions.create -m gpt-4o -g user "$(cat prompts/generate_aliases.md)" >> ~/.dotfiles/scripts/local/generated.zsh
61+
```
62+
63+
*Tip: After generating new aliases, press **`r`** inside Shortcuts TUI to reload and see them instantly!*
64+
65+
---
66+
67+
## 🗂 Subdivisions & Organization
68+
69+
Shortcuts TUI automatically organizes your items based on your directory structure. This is perfect for separating `local`, `work`, and `github` tools within the same tab.
70+
71+
### How it works:
72+
1. **Directory Structure:**
73+
```text
74+
~/.dotfiles/scripts/
75+
├── local/
76+
│ └── dev.zsh # [Local > Dev]
77+
└── work/
78+
└── cloud.zsh # [Work > Cloud]
79+
```
80+
2. **Display:** Items will be prefixed with their subdivision in the list: `[Local > Dev] My Shortcut`.
81+
3. **Ordering:** Items are automatically sorted by Subdivision, then Category (filename), then Title.
82+
4. **Filtering:** Subdivisions are searchable! Type `work` to instantly see all your work-related shortcuts.
83+
84+
---
85+
4286
## 🛠 Installation
4387

4488
### Homebrew (Recommended)
@@ -60,7 +104,7 @@ mv shortcuts-tui /usr/local/bin/ # Or any directory in your $PATH
60104

61105
## ⚙️ Configuration
62106

63-
By default, **Shortcuts TUI** looks for `~/.config/shortcuts/config.yaml`.
107+
By default, **Shortcuts TUI** looks for `~/.config/shortcuts-tui/config.yaml`.
64108

65109
<details>
66110
<summary><b>Click to expand Configuration Details</b></summary>

config.yaml.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Shortcuts TUI Configuration Example
22

33
# Define your custom tabs/views
4+
# Subdivisions are automatically derived from subdirectories (e.g., $HOME/dotfiles/scripts/work/git.zsh -> [Work > Git])
45
views:
56
- name: "Aliases"
67
type: "alias"
78
dirs:
89
- "$HOME/dotfiles/scripts"
10+
- "./examples"
911
- name: "Docs"
1012
type: "doc"
1113
dirs:
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,24 @@ alias gc="git commit -v" # Commit changes with verbose output
5151

5252
---
5353

54+
## 🗂 Automatic Subdivisions
55+
You can group shortcuts within a single tab by using subdirectories. This is ideal for organizing your tools into `Local`, `Work`, or `GitHub` projects.
56+
57+
1. Create a subfolder in your scripts directory: `~/dotfiles/scripts/work/`.
58+
2. Move your `.zsh` files there: `work/git.zsh`.
59+
3. The TUI will display these items with a subdivision prefix: **`[Work > Git]`**.
60+
61+
*Tip: Subdivisions are indexed for search. Type `work` to instantly filter all work-related tools.*
62+
63+
---
64+
5465
## ⌨️ Navigation Reference
5566

5667
### List View
5768
- `j` / `k`: Navigation
5869
- `Tab` / `l`: Next Tab
5970
- `Shift+Tab` / `h`: Previous Tab
60-
- `/`: Search
71+
- `/`: Search (Titles, Descriptions, Subdivisions)
6172
- `Enter`: Run/View
6273
- `y`: Copy to Clipboard
6374
- `q`: Quit
File renamed without changes.
File renamed without changes.
File renamed without changes.

examples/github/repo.zsh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
alias gs="git status" # Show git status
2+
alias gp="git push" # Push to origin
3+
alias gl="git pull" # Pull from origin

examples/local/dev.zsh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
alias ll="ls -la" # List all files in long format
2+
alias v="nvim" # Launch Neovim
3+
alias t="tmux" # Open tmux session

examples/work/cloud.zsh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
alias k="kubectl" # Kubernetes CLI
2+
alias d="docker" # Docker CLI
3+
alias tf="terraform" # Terraform CLI

internal/config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func LoadConfig() Config {
6464
// Setup config file search paths
6565
viper.SetConfigName("config")
6666
viper.SetConfigType("yaml")
67+
viper.AddConfigPath(filepath.Join(home, ".config", "shortcuts-tui"))
6768
viper.AddConfigPath(filepath.Join(home, ".config", "shortcuts"))
6869
viper.AddConfigPath(".")
6970

0 commit comments

Comments
 (0)