Skip to content

feat(cli): Introduced start:flutter command for Flutter integration, added --write-env-file option to start#4972

Merged
pavelgj merged 9 commits intogenkit-ai:mainfrom
pavelgj:pj/flutter-start
Mar 25, 2026
Merged

feat(cli): Introduced start:flutter command for Flutter integration, added --write-env-file option to start#4972
pavelgj merged 9 commits intogenkit-ai:mainfrom
pavelgj:pj/flutter-start

Conversation

@pavelgj
Copy link
Copy Markdown
Member

@pavelgj pavelgj commented Mar 20, 2026

Run flutter app:

genkit start:flutter -- -d chrome

This is a convenient shortcut for:

genkit start --write-env-file=genkit.env --experimental-reflection-v2 -- flutter run --dart-define-from-file=genkit.env -d chrome

or for more control you can run genkit tooling separately from flutter:

genkit start --write-env-file=genkit.env --experimental-reflection-v2 &
flutter run --dart-define-from-file=genkit.env -d chrome

Checklist (if applicable):

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 Genkit CLI by introducing dedicated support for Flutter development through a new start:flutter command. It also improves the flexibility of the general start command by allowing the export of environment variables to a file. These changes aim to streamline the developer experience for integrating Genkit with Flutter projects and provide better control over the development environment setup.

Highlights

  • New start:flutter command: A new CLI command, start:flutter, has been introduced to enable running Flutter applications in Genkit development mode. This command supports options for controlling the Dev UI, specifying ports, and configuring CORS.
  • New --write-env-file option for start command: The existing start command now includes a --write-env-file option, allowing users to export the generated development environment variables into a specified .env formatted file.
  • Refactored environment variable handling: The logic for generating development environment variables has been extracted into a new utility function, getDevEnvVars, improving modularity and reusability across CLI commands.
  • Simplified process standard I/O: The ProcessManager now uses stdio: 'inherit' for interactive processes, simplifying the handling of standard input/output and removing manual piping logic.
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.

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
Copy Markdown
Contributor

@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 new start:flutter command for better integration with Flutter projects and adds a --write-env-file option to the existing start command. The changes look good overall, but there are a few areas for improvement regarding code duplication, correctness, and efficiency. I've identified a high-severity issue where the --noui flag is not handled in the new start:flutter command, and another high-severity efficiency issue where a function is called unnecessarily when using --write-env-file. Additionally, there are opportunities to clean up unused imports, simplify complex logic, and remove dead code. Please see my detailed comments for suggestions.

Comment thread genkit-tools/cli/src/commands/start-flutter.ts Outdated
Comment thread genkit-tools/cli/src/commands/start.ts Outdated
Comment thread genkit-tools/cli/src/commands/start.ts
Comment thread genkit-tools/cli/src/commands/start-flutter.ts Outdated
Comment thread genkit-tools/cli/src/commands/start-flutter.ts
Comment thread genkit-tools/cli/src/utils/manager-utils.ts Outdated
Comment thread genkit-tools/common/src/manager/process-manager.ts Outdated
@pavelgj pavelgj requested review from MichaelDoyle and ssbushi March 23, 2026 17:59
@pavelgj
Copy link
Copy Markdown
Member Author

pavelgj commented Mar 23, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@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 new start:flutter command to the CLI, enabling users to run Flutter applications in Genkit's development mode, complete with an optional Dev UI. It also enhances the existing start command by adding a --write-env-file option, allowing environment variables to be written to a specified file. The internal manager-utils have been refactored to centralize environment variable retrieval logic, and the process-manager has been updated to simplify stdio handling. Feedback suggests adding the disableRealtimeTelemetry property to the FlutterRunOptions interface for improved type safety and removing an unnecessary unpipe call in the ProcessManager cleanup method.

Comment thread genkit-tools/cli/src/commands/start-flutter.ts
Comment thread genkit-tools/common/src/manager/process-manager.ts Outdated
@pavelgj pavelgj merged commit fa75872 into genkit-ai:main Mar 25, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants