Skip to content

feat(cli): add --auto-submit flag to force Enter/Ctrl+Enter/Cmd+Enter…#1099

Open
benys wants to merge 1 commit intocjpais:mainfrom
benys:main
Open

feat(cli): add --auto-submit flag to force Enter/Ctrl+Enter/Cmd+Enter…#1099
benys wants to merge 1 commit intocjpais:mainfrom
benys:main

Conversation

@benys
Copy link
Copy Markdown

@benys benys commented Mar 19, 2026

Please confirm you have done the following:

Human Written Description

I keep auto-submit disabled in settings by default, but for certain my automation I need to selectively trigger an Enter keypress after transcription via CLI.
Also I prepared new struct - for future extend settings.

Related Issues/Discussions

Extends #147

Testing

I used this new CLI in my linux setup

AI Assistance

  • No AI was used in this PR
  • AI was used (please describe below)

If AI was used:

  • Tools used: Claude Code
  • How extensively: Assist to implement my idea

Copilot AI review requested due to automatic review settings March 19, 2026 11:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a per-invocation transcription context to allow CLI/signal-triggered transcriptions to override auto-submit behavior (e.g., force Enter/Ctrl+Enter/Cmd+Enter) without changing persisted settings.

Changes:

  • Introduces TranscriptionContext to carry per-run overrides through the transcription pipeline.
  • Threads TranscriptionContext from CLI/signal inputs through the coordinator into action stop/paste.
  • Extends CLI with --auto-submit[=<key>] and applies override during paste.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src-tauri/src/transcription_coordinator.rs Carries TranscriptionContext through lifecycle state and forwards it into action.stop().
src-tauri/src/signal_handle.rs Updates external trigger helper to accept/pass TranscriptionContext.
src-tauri/src/shortcut/handler.rs Updates coordinator/action stop calls to supply a default TranscriptionContext.
src-tauri/src/settings.rs Adds TranscriptionContext struct for per-invocation overrides.
src-tauri/src/lib.rs Parses --auto-submit from single-instance args and passes context into CLI-triggered transcription.
src-tauri/src/clipboard.rs Updates paste API to accept context and apply auto-submit override selection.
src-tauri/src/cli.rs Adds --auto-submit clap flag with constrained values and optional argument.
src-tauri/src/actions.rs Extends ShortcutAction::stop() to accept context and passes it into paste.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +477 to +482
if let Some(pos) = args.iter().position(|a| a == "--auto-submit") {
let key = args
.get(pos + 1)
.filter(|s| !s.starts_with("--"))
.map(|s| s.as_str())
.unwrap_or("enter");
Comment on lines +95 to +97
Stage::Recording(id, _) if id == &binding_id => {
let ctx = take_recording_context(&mut stage);
stop(&app, &mut stage, &binding_id, &hotkey_string, ctx);
Comment on lines +655 to +662
let (auto_submit, auto_submit_key) = match context.auto_submit_override {
Some(key) => (true, key),
None => (settings.auto_submit, settings.auto_submit_key),
};

if should_send_auto_submit(auto_submit, paste_method) {
std::thread::sleep(Duration::from_millis(50));
send_return_key(&mut enigo, settings.auto_submit_key)?;
send_return_key(&mut enigo, auto_submit_key)?;
DylanBricar added a commit to DylanBricar/Phonara that referenced this pull request Mar 20, 2026
- SHA256 download verification to prevent corrupt partial download loops (cjpais#1095)
- Secondary transcription shortcut with independent language setting (cjpais#1106)
- Double-click tray icon to show main window (cjpais#369)
- CLI --auto-submit flag to force enter after transcription (cjpais#1099)
- OCR template context via ${OCR} variable in post-processing prompts (cjpais#770)
DylanBricar added a commit to DylanBricar/Phonara that referenced this pull request Mar 20, 2026
- Save recordings before transcription to prevent data loss on crash (cjpais#1024)
- Linux Wayland titlebar: disable decorations for custom titlebar (cjpais#1042)
- Add change_secondary_selected_language_setting command (cjpais#1106 gap)
- Fix CLI --auto-submit key type being ignored (cjpais#1099 bug)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants