Skip to content

Conversation

@IvanHunters
Copy link

@IvanHunters IvanHunters commented Aug 5, 2025

Summary by CodeRabbit

  • New Features
    • Added support for a non-interactive installation mode using the -yes flag to automatically confirm prompts.
  • Documentation
    • Updated the README with instructions for non-interactive installation, detailed usage examples, and a comprehensive table of command-line flags.

Signed-off-by: ohotnikov.ivan <[email protected]>
@coderabbitai
Copy link

coderabbitai bot commented Aug 5, 2025

Walkthrough

A new -yes flag has been added to the boot-to-talos tool, enabling fully non-interactive execution by automatically affirming prompts. The README.md was updated to document this feature, including usage instructions, a command-line flags table, and examples for automated installations.

Changes

Cohort / File(s) Change Summary
Non-interactive Flag Implementation
main.go
Introduced a -yes flag for non-interactive mode; updated prompt helper functions to respect this flag, allowing automated responses.
Documentation Update
README.md
Added documentation for the -yes flag, detailed usage instructions, a command-line flags table, and automation examples.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI Tool
    participant System

    User->>CLI Tool: Run with -yes flag and parameters
    CLI Tool->>CLI Tool: Check for -yes flag
    alt -yes flag is true
        CLI Tool->>CLI Tool: Auto-respond to prompts with defaults
    else -yes flag is false
        CLI Tool->>User: Prompt interactively for input
    end
    CLI Tool->>System: Execute installation steps
    System-->>CLI Tool: Return results
    CLI Tool-->>User: Output status and results
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Poem

A bunny with a flag in paw,
Hopped past prompts without a flaw.
Now -yes makes answers swift,
No more pauses—what a gift!
Docs are clear, the path is set,
Automated installs—best one yet!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aa4ffe1 and 0c882c4.

📒 Files selected for processing (2)
  • README.md (1 hunks)
  • main.go (4 hunks)
🔇 Additional comments (7)
main.go (5)

37-37: LGTM!

The yesFlag variable declaration follows Go conventions and is properly placed with other flag variables.


44-44: LGTM!

The flag initialization is correct with appropriate name, default value, and description.


101-104: LGTM!

The non-interactive behavior is correctly implemented. When yesFlag is true, it transparently shows the prompt with the default value and returns it immediately, maintaining good user feedback even in automated mode.


115-117: LGTM!

Correct handling of required inputs in non-interactive mode. The fatal error with clear messaging ensures users provide all necessary parameters when using the -yes flag.


129-132: LGTM!

The non-interactive handling for yes/no prompts is well implemented. The boolean-to-string mapping provides clear feedback about the automated choice, and the logic correctly returns the default value.

README.md (2)

72-86: LGTM!

The non-interactive installation section clearly explains the new feature with practical examples. The progression from basic -yes usage to full parameter specification helps users understand different automation scenarios.


87-98: LGTM!

The command-line flags table is comprehensive and accurate. All flag descriptions, types, and examples match the code implementation. The tip about flag combinations and interactive fallback behavior is particularly helpful for users.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/add-autoinstall-flag

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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.

Summary of Changes

Hello @IvanHunters, 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 boot-to-talos tool by introducing a -yes flag, enabling fully automated and non-interactive execution. This change streamlines the installation process for scripting and automation workflows, complemented by clear documentation updates to guide users on its usage.

Highlights

  • New Feature: Non-interactive Mode: Introduced a new -yes command-line flag to allow the boot-to-talos tool to run in a fully automated, non-interactive mode, bypassing all user prompts for confirmation or input.
  • Core Logic Modification: Modified the ask, askRequired, and askYesNo functions in main.go to respect the new -yes flag. When active, ask and askYesNo will automatically accept their default values, while askRequired will log a fatal error if a required input is missing, as it cannot be auto-filled.
  • Documentation Update: Updated README.md to include a new section on 'Non-interactive installation' with practical usage examples for the -yes flag. Additionally, a comprehensive table detailing all available command-line flags and their descriptions has been added for clarity.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 or fill out our survey to provide feedback.

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.

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 -yes flag for non-interactive execution, which is a great addition for automation. The changes in main.go correctly implement this by bypassing user prompts, and the README.md is updated to document the new flag and list all available command-line options.

My review includes a few suggestions to improve the implementation and documentation:

  • In README.md, I've suggested a minor tweak to the flag type for consistency.
  • In main.go, I've recommended a more descriptive help message for the new flag and a refactoring of the askYesNo function to improve readability, performance, and consistency of the output in non-interactive mode.

| `-disk string` | Target disk (will be wiped) | `-disk /dev/sda` |
| `-image string` | Talos installer image (default: `ghcr.io/cozystack/cozystack/talos:v1.10.5`) | `-image ghcr.io/cozystack/cozystack/talos:v1.10.5` |
| `-image-size-gib uint`| Size of image.raw in GiB (default: 2) | `-image-size-gib 4` |
| `-extra-kernel-arg value` | Extra kernel argument (can be repeated) | `-extra-kernel-arg "console=ttyS0"` |

Choose a reason for hiding this comment

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

medium

For consistency with other flags in this table, the type for -extra-kernel-arg should be string instead of value. This makes the documentation clearer for users.

Suggested change
| `-extra-kernel-arg value` | Extra kernel argument (can be repeated) | `-extra-kernel-arg "console=ttyS0"` |
| `-extra-kernel-arg string` | Extra kernel argument (can be repeated) | `-extra-kernel-arg "console=ttyS0"` |

flag.StringVar(&imageFlag, "image",
"ghcr.io/cozystack/cozystack/talos:v1.10.5", "Talos installer image")
flag.StringVar(&diskFlag, "disk", "", "target disk (will be wiped)")
flag.BoolVar(&yesFlag, "yes", false, "automatic yes to prompts")

Choose a reason for hiding this comment

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

medium

The help text for the -yes flag could be more descriptive to better align with its function and the documentation in README.md. A more explicit description would clarify that it accepts defaults and skips all interactive prompts.

Suggested change
flag.BoolVar(&yesFlag, "yes", false, "automatic yes to prompts")
flag.BoolVar(&yesFlag, "yes", false, "Run non-interactively, accepting defaults and skipping confirmations")

Comment on lines +129 to +132
if yesFlag {
fmt.Printf("%s [%s]: %v\n", msg, map[bool]string{true: "yes", false: "no"}[def], def)
return def
}

Choose a reason for hiding this comment

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

medium

This implementation creates a new map on every function call, which is inefficient. Using an if/else block would be more readable and performant.

Additionally, printing the string "yes" or "no" instead of the boolean true or false makes the non-interactive output more consistent with the ask function's behavior and the user-facing prompt.

Suggested change
if yesFlag {
fmt.Printf("%s [%s]: %v\n", msg, map[bool]string{true: "yes", false: "no"}[def], def)
return def
}
if yesFlag {
defStr := "no"
if def {
defStr = "yes"
}
fmt.Printf("%s [%s]: %s\n", msg, defStr, defStr)
return def
}

@0xE282B0
Copy link

Great, a non-interactive is exactly what I was missing <3

@kvaps kvaps merged commit 57b3948 into main Nov 6, 2025
2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Nov 17, 2025
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.

4 participants