talon_repl
This directory provides integration and voice command support for the Talon REPL (Read-Eval-Print Loop), an interactive Python shell used by Talon developers to inspect runtime state, simulate voice inputs, and debug configurations.
These files work together to detect when you are using the Talon REPL and to supply a rich set of voice commands for inspecting and testing Talon's inner workings.
Component Overview
Application Detection and Context
The Python file talon_repl.py defines the application context rules.
- It defines the
talon_replapplication by matching specific window titles, such asTalon - REPLor the path to the executable/.talon/bin/repl. - When focused on this application, it configures the code language action to return
"python", adapting standard programming voice commands to the REPL.
Voice Commands and Automation
The voice command file talon_repl.talon activates whenever the REPL window is in focus. It imports helper tags for readline and Python commands and provides specialized debugging tools:
- Input Simulation: Commands like
test <phrase>ortest lastautomatically translate your speech into the REPL simulator command (e.g.,sim('your phrase')), letting you run offline tests of voice commands. - State Introspection: A suite of
debugcommands prints information directly into the REPL console. For example, speaking:"debug tags"insertsactions.user.talon_pretty_print(registry.tags)"debug settings"queries the active system settings."debug running apps"or"debug all windows"dumps current window and UI management hierarchies.
- Action & List Lookup: If you uncomment the
user.talon_populate_liststag (recommended only for performant speech engines), you can speak commands likedebug action {user.talon_actions}ordebug list {user.talon_lists}to quickly inspect custom code definitions.