Skip to content

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_repl application by matching specific window titles, such as Talon - REPL or 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> or test last automatically 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 debug commands prints information directly into the REPL console. For example, speaking:
    • "debug tags" inserts actions.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_lists tag (recommended only for performant speech engines), you can speak commands like debug action {user.talon_actions} or debug list {user.talon_lists} to quickly inspect custom code definitions.