Skip to content

windows_command_processor

The community/apps/windows_command_processor directory contains files that provide Talon bindings for interacting with the Windows Command Prompt and Windows Terminal. These files enhance the command-line experience with features like directory navigation, file operations, and more.

The core functionality is provided by two files:

  • command_processor_actions_win.py: This file defines a context that matches the Windows Command Prompt and Windows Terminal applications with a title containing "Command Prompt". It assigns the user.file_manager, user.git, user.kubectl, and terminal tags, enabling more specific commands for these contexts.

    • It implements actions to refresh the title (file_manager_refresh_title), navigate to the parent directory (file_manager_open_parent), and to delete a line (delete_line). The refresh title action updates the title of the window to display the current directory.
  • command_processor_win.py: This file expands on command_processor_actions_win.py, providing additional functionality for file management and terminal interactions. It defines a context similar to command_processor_actions_win.py and also assigns the same tags.

    • It implements file_manager_refresh_title and file_manager_open_parent the same way as command_processor_actions_win.py.
    • The file_manager_current_path action extracts the current path from the window title and cleans it up.
    • The file implements various actions for interacting with the file system, including:
      • file_manager_open_directory: Opens a specified directory.
      • file_manager_select_directory: Selects a directory.
      • file_manager_new_folder: Creates a new folder using mkdir.
      • file_manager_open_file: Opens a file.
      • file_manager_select_file: Selects a file.
      • file_manager_open_volume: Opens a volume.
    • It provides actions for terminal interactions, including:
      • terminal_list_directories: Lists directories using dir.
      • terminal_list_all_directories: Lists all directories including hidden ones using dir /a.
      • terminal_change_directory: Changes the current directory using cd.
      • terminal_change_directory_root: Changes the directory to the root of the current drive using cd /.
      • terminal_clear_screen: Clears the screen using cls.
      • terminal_run_last: Executes the last command from the history.
      • terminal_kill_all: Kills the current process.

These files work together to provide a comprehensive set of Talon actions for navigating and interacting with the Windows Command Prompt and Windows Terminal. The actions defined here can be invoked through voice commands, making it easier to perform common tasks on the command line.