Open
Conversation
Author
|
A couple more examples from discussions to keep README small: Example quoting clipboard content and appending transcription: #!/bin/bash
clipboard=$(pbpaste)
if [ -n "$clipboard" ]; then
echo "> $clipboard"
echo
fi
catExample expanding voice commands to actual commands and emoji shortcuts: #!/usr/bin/env python3
import sys
text = sys.stdin.read()
# Command expansions and emoji shortcuts
replacements = {
# Commands
"run unit tests": "pnpm run tests",
"run tests": "pnpm run tests",
"run dev": "pnpm run dev",
"run build": "pnpm run build",
"git status": "git status",
"git commit": "git commit",
# Emojis
"grin emoji": ":grin:",
"smile emoji": ":smile:",
"thumbs up emoji": ":thumbsup:",
"heart emoji": ":heart:",
"fire emoji": ":fire:",
"rocket emoji": ":rocket:",
"eyes emoji": ":eyes:",
"party emoji": ":tada:",
}
# Strip punctuation for lookup
lookup_text = text.strip().lower().rstrip('.,!?;:')
sys.stdout.write(replacements.get(lookup_text, text)) |
6901201 to
d7554a1
Compare
Author
|
As a possible future extension I have the following idea: Handy supports multiple hotkeys and the hotkey used to capture transcription is passed to the script via environment variable or an argument - this way script may perform different actions based on the hotkey. |
d7554a1 to
2b08e4f
Compare
4 tasks
| } | ||
| }; | ||
|
|
||
| let transcription_hook = app_data_dir.join("transcription_hook"); |
Author
There was a problem hiding this comment.
If this is moving forward it might be better to reserve dedicated folder hooks/post_transcription
thukabjj
added a commit
to thukabjj/Handy
that referenced
this pull request
Mar 2, 2026
- PR cjpais#477: Graceful handling when no microphone is connected - Validate device config before spawning worker thread - Use HandyError with user-friendly messages and recovery suggestions - PR cjpais#930: Transcription hook for external script processing - Add transcription_hook_enabled and transcription_hook_path settings - Pipe transcription through external scripts for custom processing - PR cjpais#814: Secure API key storage in OS keychain - Add keyring module for macOS Keychain, Windows Credential Manager, Linux Secret Service - Commands: set_api_key, get_api_key, delete_api_key, get_masked_api_key - PR cjpais#455: Text replacements with regex and magic commands - Support literal and regex pattern matching - Magic commands: [date], [time], [datetime] - Import/export functionality for replacement rules - PR cjpais#851: Per-entry post-process button for history - Retroactively post-process transcription history entries - Store post-processed text and prompt used - PR cjpais#618: Wake-word detection for Active Listening trigger - Transcript-based wake phrase detection - Configurable trigger actions, cooldown, and threshold
Add support for transcription hook - an executable script in app's data directory. If `transcription_hook` file exists, Handy runs it passing transcription text via stdin and uses script stdout as a transcription result. This approach is a flexible extension point for advanced users (which nowadays means with access to coding LLM) akin to git hooks. Here are some possible scenarios: * simple transcription modifications * a pipeline involving LLM processing, language detection and translation * custom paste method (as Handy does nothing if transcription is empty) * conditional processing based on the active application waiting for the input See related: * cjpais#168 * cjpais#162 * cjpais#916 * cjpais#911 * cjpais#834 * cjpais#847 * cjpais#833 * cjpais#662 * cjpais#601 * cjpais#335 * cjpais#739 * cjpais#638 * cjpais#455 * cjpais#157
2b08e4f to
a15c881
Compare
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before Submitting This PR
Please confirm you have done the following:
If this is a feature or change that was previously closed/rejected:
Human Written Description
Add support for transcription hook - an executable script in app's data directory.
If
transcription_hookfile exists, Handy runs it passing transcription text via stdin anduses script stdout as a transcription result.
This approach is a flexible extension point for advanced users
(which nowadays means with access to coding LLM) akin to git hooks.
Here are some possible scenarios:
Related Issues/Discussions
See related:
Community Feedback
Testing
Build and ran Handy with both example scripts.
Screenshots/Videos (if applicable)
AI Assistance
If AI was used: