1. Determine the target tmux session, window, and pane.
2. Construct the appropriate tmux command using the socket path.
3. Send keystrokes to the target pane using `tmux send-keys`.
4. Capture the pane output using `tmux capture-pane`.
5. Optionally, use `wait-for-text.sh` to wait for specific patterns in the output.
6. Parse the output to determine the next action or completion status.
7. Repeat steps 3-6 as needed.
8. Clean up the tmux session when finished.