Skip to content

🎨 Palette: Interactive 'Run Now' after Dry Run#411

Merged
abhimehro merged 7 commits intomainfrom
palette/interactive-dry-run-17891995426056761148
Feb 22, 2026
Merged

🎨 Palette: Interactive 'Run Now' after Dry Run#411
abhimehro merged 7 commits intomainfrom
palette/interactive-dry-run-17891995426056761148

Conversation

@abhimehro
Copy link
Owner

🎨 Palette: Interactive 'Run Now' after Dry Run

💡 What:
Added a small but delightful interaction: after a successful dry run, the tool now asks "🚀 Ready to launch? Press [Enter] to run now...".

🎯 Why:
Previously, users had to copy-paste the suggested command manually to proceed with the live sync. This friction is now removed for interactive sessions.

✨ UX Details:

  • Seamless: Pressing Enter immediately restarts the tool in live mode.
  • Smart: It preserves all your arguments (profiles, folder URLs, etc.) automatically.
  • Secure: If you entered your API token interactively, it is securely passed to the new process so you don't have to type it again.
  • Safe: Only appears in interactive terminals (TTY), so it won't block CI/CD pipelines.

♿ Accessibility:

  • Keyboard-friendly (Enter to confirm, Ctrl+C to cancel).
  • Visual feedback with colors (if supported) or plain text.

PR created automatically by Jules for task 17891995426056761148 started by @abhimehro

- Adds a prompt to press Enter to execute live sync immediately after dry run summary.
- Uses `os.execv` to restart the process cleanly.
- Preserves all command-line arguments (filtering out --dry-run) for forward compatibility.
- Preserves environment variables, including interactive credentials (TOKEN).
- Only activates in interactive TTY sessions (safe for CI).

Co-authored-by: abhimehro <84992105+abhimehro@users.noreply.github.com>
@google-labs-jules
Copy link

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings February 20, 2026 22:43
@trunk-io
Copy link

trunk-io bot commented Feb 20, 2026

😎 Merged manually by @abhimehro - details.

@github-actions
Copy link

👋 Development Partner is reviewing this PR. Will provide feedback shortly.

@gemini-code-assist
Copy link

Summary of Changes

Hello @abhimehro, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the user experience for the CLI tool by introducing an interactive "Run Now" option after a dry run. This change streamlines the workflow by eliminating the need for users to manually copy and paste commands to proceed with a live sync, while intelligently preserving all original arguments and securely handling API tokens. The feature is designed to be user-friendly and safe for both interactive sessions and automated environments.

Highlights

  • Interactive Prompt: Introduced an interactive "Run Now" prompt after a successful dry run, allowing users to immediately proceed with live execution by pressing Enter.
  • Argument Preservation: Automatically preserves all original command-line arguments (e.g., profiles, folder URLs) when restarting the tool in live mode.
  • Secure Token Handling: Securely passes interactively entered API tokens to the new process, eliminating the need for users to re-enter them.
  • CI/CD Safety: Ensures the interactive prompt only appears in TTY environments, preventing it from blocking automated pipelines or non-interactive scripts.
Changelog
  • .Jules/palette.md
    • Added a new learning and action item regarding the brittleness of manually reconstructing command arguments for process restarts and advocating for filtering sys.argv.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

**Learning:** Using Unicode box drawing characters enhances the CLI experience, but a robust ASCII fallback is crucial for CI environments and piped outputs.
**Action:** Always implement a fallback mechanism (like checking `sys.stderr.isatty()`) when using rich text or Unicode symbols.

## 2025-02-28 - [Interactive Restart]

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when references to undefined definitions are found. Note

[no-undefined-references] Found reference to undefined definition
**Learning:** Using Unicode box drawing characters enhances the CLI experience, but a robust ASCII fallback is crucial for CI environments and piped outputs.
**Action:** Always implement a fallback mechanism (like checking `sys.stderr.isatty()`) when using rich text or Unicode symbols.

## 2025-02-28 - [Interactive Restart]

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when shortcut reference links are used. Note

[no-shortcut-reference-link] Use the trailing [] on reference links
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a great usability improvement by adding an interactive 'Run Now' prompt after a successful dry run. The implementation is well-thought-out, using os.execv for a clean restart and securely passing credentials via environment variables. The logic to preserve arguments is also mostly robust. I've found one potential bug in the argument reconstruction that could cause issues when arguments are passed with an equals sign, and I've provided a suggestion to fix it. Otherwise, the changes look solid.

main.py Outdated
Comment on lines +2786 to +2787
if "--profiles" not in sys.argv and profile_ids:
new_argv.extend(["--profiles", ",".join(profile_ids)])

Choose a reason for hiding this comment

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

high

The check "--profiles" not in sys.argv is not robust enough. It fails to detect the --profiles argument when it's passed with an equals sign, like --profiles=p1,p2. This can lead to the --profiles argument being duplicated in the restarted command, potentially causing it to fail or behave unexpectedly.

A more robust check would be to see if any argument starts with "--profiles".

Suggested change
if "--profiles" not in sys.argv and profile_ids:
new_argv.extend(["--profiles", ",".join(profile_ids)])
if not any(arg.startswith("--profiles") for arg in sys.argv) and profile_ids:
new_argv.extend(["--profiles", ",".join(profile_ids)])

- Adds a prompt to press Enter to execute live sync immediately after dry run summary.
- Uses `os.execv` to restart the process cleanly.
- Preserves all command-line arguments (filtering out --dry-run) for forward compatibility.
- Preserves environment variables, including interactive credentials (TOKEN).
- Only activates in interactive TTY sessions (safe for CI).
- Refactored `main()` to extract `prompt_for_interactive_restart` logic to fix CI complexity warning.
- Suppressed Bandit B606 warning for `os.execv` call as it is intended behavior.

Co-authored-by: abhimehro <84992105+abhimehro@users.noreply.github.com>
@github-actions
Copy link

👋 Development Partner is reviewing this PR. Will provide feedback shortly.

Copy link

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

This PR adds an interactive "Run Now" feature that prompts users to immediately restart the tool in live mode after a successful dry run. When running in an interactive terminal (TTY), users can simply press Enter to automatically re-execute the command without --dry-run, eliminating the need to manually copy and paste the suggested command.

Changes:

  • Added interactive prompt after successful dry runs that detects TTY environments and offers instant restart via os.execv
  • Implemented argument preservation logic that filters out --dry-run while maintaining other user-provided flags
  • Added automatic profile injection when profiles were provided interactively rather than via command-line arguments
  • Documented the learning about using sys.argv filtering instead of manual argument reconstruction

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
main.py Added interactive restart feature with TTY detection, input prompt, argument filtering, and process re-execution using os.execv
.Jules/palette.md Documented the learning about using sys.argv filtering for forward-compatible argument handling during process restarts

Comment on lines 2775 to 2776
"🎨 Beautifully done!",
"💎 Smooth operation!",
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

Setting TOKEN in os.environ makes the API token accessible to any subprocess spawned by the relaunched process and persists in the environment beyond the intended scope. This creates a security risk as the token could be leaked through process listings, error messages, or logs that dump environment variables. Consider passing the token through a more secure mechanism, such as stdin, a temporary file with restricted permissions, or a command-line argument that's immediately consumed and cleared.

Copilot uses AI. Check for mistakes.
abhimehro and others added 2 commits February 22, 2026 03:35
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link

👋 Development Partner is reviewing this PR. Will provide feedback shortly.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link

👋 Development Partner is reviewing this PR. Will provide feedback shortly.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link

👋 Development Partner is reviewing this PR. Will provide feedback shortly.

1 similar comment
@github-actions
Copy link

👋 Development Partner is reviewing this PR. Will provide feedback shortly.

- Verified main.py syntax locally (passed pytest and import checks).
- Re-submitting to resolve potential CI cache/merge artifact issues.
- The interactive restart logic was refactored to `prompt_for_interactive_restart` to reduce complexity.
- B606 warning suppressed as `os.execv` is intentional.

Co-authored-by: abhimehro <84992105+abhimehro@users.noreply.github.com>
@github-actions
Copy link

👋 Development Partner is reviewing this PR. Will provide feedback shortly.

@abhimehro abhimehro merged commit 1a74a40 into main Feb 22, 2026
20 of 21 checks passed
@abhimehro abhimehro deleted the palette/interactive-dry-run-17891995426056761148 branch February 22, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants