Skip to content

implement --open for hosting:channel:deploy#9961

Open
aalej wants to merge 1 commit intomainfrom
aalej_imp-hostchandep-open
Open

implement --open for hosting:channel:deploy#9961
aalej wants to merge 1 commit intomainfrom
aalej_imp-hostchandep-open

Conversation

@aalej
Copy link
Contributor

@aalej aalej commented Feb 22, 2026

Description

implement --open for hosting:channel:deploy

Scenarios Tested

Ran the hosting:channel:deploy command with --open flag

$ firebase hosting:channel:deploy basic --open

=== Deploying to 'PROJECT_ID'...

i  deploying hosting
i  hosting[PROJECT_ID]: beginning deploy...
i  hosting[PROJECT_ID]: found 1 files in public
✔  hosting[PROJECT_ID]: file upload complete
i  hosting[PROJECT_ID]: finalizing version...
✔  hosting[PROJECT_ID]: version finalized
i  hosting[PROJECT_ID]: releasing new version...
✔  hosting[PROJECT_ID]: release complete

✔  Deploy complete!

Project Console: https://console.firebase.google.com/project/PROJECT_ID/overview
Hosting URL: https://PROJECT_ID.web.app

✔  hosting:channel: Channel URL (PROJECT_ID): https://PROJECT_ID--basic-7t57gcv1.web.app [expires 2026-03-01 20:02:58]

Sample Commands

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @aalej, 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 enhances the hosting:channel:deploy command by introducing an --open flag. This new functionality streamlines the deployment workflow by automatically launching the newly created hosting channel URLs in the user's default web browser, eliminating the need for manual copying and pasting. The change improves developer efficiency and provides immediate access to deployed previews.

Highlights

  • New Feature: --open flag: Implemented the --open flag for the hosting:channel:deploy command, allowing users to automatically open the deployed channel URL(s) in their default web browser.
  • Dependency Integration: Integrated the open package to handle the browser opening functionality across different operating systems.
  • Code Cleanup: Removed the placeholder FirebaseError that previously indicated the --open flag was not yet implemented.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • CHANGELOG.md
    • Added an entry for the implementation of --open for hosting:channel:deploy.
  • src/commands/hosting-channel-deploy.ts
    • Imported the open package to enable browser launching.
    • Removed the TODO comment and error handling for the previously unimplemented --open flag.
    • Added logic to open the deployed channel URLs in a browser when the --open flag is provided and the command is interactive.
Activity
  • Pull request created by aalej to implement the --open flag.
  • Initial code changes were made to integrate the open utility and add the necessary logic.
  • The author self-tested the feature with a hosting:channel:deploy command using the --open flag.
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.

Copy link
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

The pull request successfully implements the --open flag for the hosting:channel:deploy command, allowing users to automatically open the deployed channel URLs in their default browser. The implementation correctly handles non-interactive environments. My feedback focuses on adhering to the repository's style guide by using existing utility functions and ensuring that asynchronous operations are properly awaited to avoid potential race conditions during process exit.

import { requireHostingSite } from "../requireHostingSite";
import { HostingOptions } from "../hosting/options";
import { Options } from "../options";
import * as opn from "open";
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This import introduces a direct dependency on the open package, which is already wrapped by the openInBrowser utility in src/utils.ts. According to the repository style guide, existing utilities should be used whenever possible. Please remove this import and add openInBrowser to the existing import from ../utils on line 20.

References
  1. Look for existing utilities first: Before writing common helper functions (e.g., for logging, file system operations, promises, string manipulation), check src/utils.ts to see if a suitable function already exists. (link)


if (options.open && !options.nonInteractive) {
for (const site of sites) {
opn(site.url);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Use the openInBrowser utility instead of calling opn directly. Additionally, await the call to ensure the browser process is spawned before the CLI process exits. Since openInBrowser returns a promise, awaiting it is best practice here.

Suggested change
opn(site.url);
await openInBrowser(site.url);
References
  1. Look for existing utilities first: Before writing common helper functions (e.g., for logging, file system operations, promises, string manipulation), check src/utils.ts to see if a suitable function already exists. (link)

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.

1 participant