Skip to content

feat(pm): utoo init - #2589

Merged
elrrrrrrr merged 5 commits into
nextfrom
feat/utoo-init
Feb 11, 2026
Merged

elrrrrrrr merged 5 commits into
nextfrom
feat/utoo-init

Conversation

@elrrrrrrr

Copy link
Copy Markdown
Contributor
  • 🤖 support utoo init to create scaffold

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @elrrrrrrr, 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 implements a new init command for the package manager, allowing users to quickly scaffold a package.json file in their projects. It streamlines the project setup process by intelligently inferring package metadata from the environment, offering both guided and automated creation workflows.

Highlights

  • New init Command: Introduced a new utoo init command to create a package.json file, similar to npm init.
  • Interactive and Default Modes: The init command supports both an interactive mode, prompting the user for package details, and a non-interactive --yes mode that uses sensible defaults.
  • Git Integration for Defaults: Added new helper functions to automatically detect and populate package.json fields such as package name, author, and repository URL from Git configuration and the current directory.
  • JSON Field Order Preservation: Updated the serde_json dependency to enable the preserve_order feature, ensuring that the generated package.json file maintains a consistent and conventional field order.
Changelog
  • crates/pm/Cargo.toml
    • Updated serde_json dependency to version 1.0 with the preserve_order feature enabled.
  • crates/pm/src/cmd/init.rs
    • Added new module to define the init command handler, delegating to the service layer.
  • crates/pm/src/cmd/mod.rs
    • Exported the new init command module.
  • crates/pm/src/constants.rs
    • Added constants for the init command's name, alias (create), and description.
  • crates/pm/src/helper/git.rs
    • Added new module containing utility functions for interacting with Git, including detecting directory names, author information, repository URLs, and normalizing Git URLs.
  • crates/pm/src/helper/mod.rs
    • Exported the new git helper module.
  • crates/pm/src/main.rs
    • Imported the init command handler and related constants.
    • Added Init subcommand to the main CLI application, including a --yes argument.
    • Integrated the init command into the main asynchronous execution flow.
  • crates/pm/src/service/init.rs
    • Added new module containing the core logic for initializing a package.json file.
    • Implemented logic to check for existing package.json files and prevent overwriting.
    • Provided functionality to build package.json content using either default values or interactive prompts.
    • Utilized git helper functions to pre-fill package metadata.
    • Included unit tests for default package structure and error handling for existing files.
  • crates/pm/src/service/mod.rs
    • Exported the new init service module.
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. ↩

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

Copy link
Copy Markdown
Contributor

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 utoo init command to create a package.json scaffold, which is a great addition. The implementation is well-structured, with clear separation between command parsing, service logic, and helper functions. My review focuses on addressing some blocking I/O operations within the asynchronous context, which could affect performance and responsiveness. I've suggested using tokio::task::spawn_blocking for CPU-bound or blocking tasks and replacing synchronous file operations in async tests with their tokio counterparts. I also included a minor suggestion to improve code readability.

Comment thread crates/pm/src/service/init.rs Resolved
Comment thread crates/pm/src/service/init.rs Resolved
Comment thread crates/pm/src/service/init.rs Resolved
Comment thread crates/pm/src/service/init.rs Resolved
@elrrrrrrr
elrrrrrrr marked this pull request as ready for review February 11, 2026 08:47
@elrrrrrrr
elrrrrrrr merged commit 45fc528 into next Feb 11, 2026
18 checks passed
@elrrrrrrr
elrrrrrrr deleted the feat/utoo-init branch February 11, 2026 09:13
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.

3 participants