1
0

feat: Add dynamic JSON skill management via toak skill command and introduce an uninstallation script.

This commit is contained in:
2026-02-28 13:52:31 +01:00
parent 7b144aedd7
commit ab48bdabcc
2 changed files with 32 additions and 8 deletions

View File

@@ -42,6 +42,11 @@ The script will:
3. Install **Zsh completions** to `/usr/share/zsh/site-functions/`. 3. Install **Zsh completions** to `/usr/share/zsh/site-functions/`.
4. Install and enable the `toak.service` systemd user service so the background daemon runs automatically. 4. Install and enable the `toak.service` systemd user service so the background daemon runs automatically.
To remove Toak from your system, simply run:
```bash
./uninstall.sh
```
--- ---
## 🎮 Usage ## 🎮 Usage
@@ -54,6 +59,7 @@ The script will:
- **`toak latency-test`**: Benchmarks your network and API latency to ensure optimal performance. - **`toak latency-test`**: Benchmarks your network and API latency to ensure optimal performance.
- **`toak show`**: Displays your current configuration in a clean table. - **`toak show`**: Displays your current configuration in a clean table.
- **`toak config <key> <value>`**: Quickly update a specific setting (e.g., `toak config whisper whisper-large-v3-turbo`). - **`toak config <key> <value>`**: Quickly update a specific setting (e.g., `toak config whisper whisper-large-v3-turbo`).
- **`toak skill`**: Manage dynamic JSON skills via `list`, `add`, or `remove` subcommands.
### Flags ### Flags
@@ -65,14 +71,27 @@ The script will:
## 🤖 Skills System ## 🤖 Skills System
Toak includes a modular skills system triggered by saying the **"System"** hotword at the start of your dictation. Toak includes a robust, data-driven skills system triggered by saying hotwords (like **"System"**) at the start of your dictation. Skills are defined as simple JSON files entirely configurable without modifying the C# codebase.
| Skill | Hotwords | Description | At runtime, skills are loaded from `~/.config/toak/skills/`.
| :--- | :--- | :--- |
| **Terminal** | "System terminal", "System run" | Executes the spoken command in your shell. | ### Default Skills
| **Translate** | "System translate to [language]" | Translates your dictation into the target language. | | Skill | Hotwords | Description | Type |
| **Professional**| "System professional", "System formalize" | Rewrites your text to be articulate and formal. | | :--- | :--- | :--- | :--- |
| **Summary** | "System summary", "System concise" | Strips fluff and provides a direct, crisp summary. | | **Terminal** | "System terminal", "System run" | Passes the command to `terminal_action.sh` to execute the spoken shell command. | `script` |
| **Translate** | "System translate to [language]" | Translates your dictation into the target language. | `type` |
| **Professional**| "System professional", "System formalize" | Rewrites your text to be articulate and formal. | `type` |
| **Summary** | "System summary", "System concise" | Strips fluff and provides a direct, crisp summary. | `type` |
### Customizing & Adding Skills
You can build infinite capabilities using the CLI wizard:
```bash
toak skill add
```
This generates a JSON file in `~/.config/toak/skills/`. Skills support two actions:
1. **`type` Action**: Transforms the dictated text via a custom System Prompt and types it into the active window (or pipes/copies if flags are requested).
2. **`script` Action**: Transforms the text and passes the result as `$1` to a local shell script, allowing Toak to control system functions, APIs, or smart home devices completely autonomously.
--- ---

View File

@@ -22,6 +22,7 @@ Toak/
│ ├── OnboardCommand.cs # Initial interactive configuration setup │ ├── OnboardCommand.cs # Initial interactive configuration setup
│ ├── ConfigUpdaterCommand.cs # Direct configuration modifications │ ├── ConfigUpdaterCommand.cs # Direct configuration modifications
│ ├── ShowCommand.cs # Display current configuration │ ├── ShowCommand.cs # Display current configuration
│ ├── SkillCommand.cs # CLI controller for discovering and adding Dynamic JSON Skills
│ └── LatencyTestCommand.cs # Benchmark tool for API calls │ └── LatencyTestCommand.cs # Benchmark tool for API calls
├── Configuration/ ├── Configuration/
│ ├── ConfigManager.cs # Loads and saves JSON configuration from the user's home folder │ ├── ConfigManager.cs # Loads and saves JSON configuration from the user's home folder
@@ -31,7 +32,10 @@ Toak/
│ ├── Logger.cs # Logging utility (verbose logging) │ ├── Logger.cs # Logging utility (verbose logging)
│ ├── PromptBuilder.cs # Constructs the system prompts for the LLM based on user settings │ ├── PromptBuilder.cs # Constructs the system prompts for the LLM based on user settings
│ ├── StateTracker.cs # Tracks the current application state (e.g. is recording active?) │ ├── StateTracker.cs # Tracks the current application state (e.g. is recording active?)
│ └── Skills/ # Modular capabilities (e.g., Terminal mode, Language Translation) │ └── Skills/ # Data-driven JSON skill integrations
│ ├── SkillDefinition.cs # JSON Model
│ ├── DynamicSkill.cs # Runtime implementation mapping LLM context to actions
│ └── SkillRegistry.cs # Loads and detects skills from ~/.config/toak/skills/
├── IO/ ├── IO/
│ ├── ClipboardManager.cs # Cross-session (Wayland/X11) clipboard manipulation (`wl-copy`, `xclip`) │ ├── ClipboardManager.cs # Cross-session (Wayland/X11) clipboard manipulation (`wl-copy`, `xclip`)
│ ├── TextInjector.cs # Native keyboard injection handling (`wtype`, `xdotool`) │ ├── TextInjector.cs # Native keyboard injection handling (`wtype`, `xdotool`)
@@ -40,6 +44,7 @@ Toak/
│ └── AppJsonSerializerContext.cs # System.Text.Json source generation context for AOT support │ └── AppJsonSerializerContext.cs # System.Text.Json source generation context for AOT support
├── docs/ # Documentation ├── docs/ # Documentation
├── toak.service # systemd user service file to run the daemon automatically ├── toak.service # systemd user service file to run the daemon automatically
├── uninstall.sh # Script to completely remove daemon, service, and binaries
└── Program.cs # Application entry point using System.CommandLine └── Program.cs # Application entry point using System.CommandLine
``` ```