@snelusha/noto
TypeScript icon, indicating that this package has built-in type declarations

1.2.7 • Public • Published

noto ✨

(/nōto/, notebook in Japanese)

Features

  • Instant Commit Messages: Generate clear, context-aware messages based on staged changes.

  • Seamless Git Integration: Apply messages directly, skip the copy-paste.

  • Interactive Editing: Easily refine your commit message with the new --edit flag.

  • Enhanced Configuration: Manage your LLM model preferences with an improved configuration interface.

Installation

Install noto globally using npm:

npm install -g @snelusha/noto

After installation, you can run noto from any terminal.

Prerequisites

Before using noto, you must configure your Google Generative API key. You can now provide your API key in two ways:

1. Using an environment variable (recommended)

Set the NOTO_API_KEY environment variable globally os it's available across your system.

macOS/Linux (eg., in .bashrc, .zshrc or .profile)

export NOTO_API_KEY=your_api_key_here

Then reload your terminal or run:

source ~/.zshrc # or ~/.bashrc or ~/.profile

Windows (Command Prompt or PowerShell):

setx NOTO_API_KEY "your_api_key_here"

Note: You may need to restart your terminal (or system) for changes to take effect.

2. Using the built-in configuration command

noto config key # or simply noto config key YOUR_API_KEY

noto will first look for the NOTO_API_KEY environment variable. If it's not found, it will fall back to the local configuration.

You can also configure a specific Gemini mode (optional):

noto config model

If you ever need to reset your configuration, you can now run:

noto config reset

Usage

Generate a new commit message:

noto

Apply the generated commit message to your current commit:

noto --apply # or simply noto -a

Copy the generated commit message to your clipboard:

noto --copy # or simply noto -c

Specify the commit type for your commit message:

noto --type # or simply noto -t

noto --type chore # or simply noto -t chore

Combine all flags to specify the commit type, and apply the generated commit message in one go:

noto --type feat --apply  # or simply: noto -t feat -a

This command will generate a commit message for a "feat" commit, let you refine it interactively, and then apply it directly to your current commit.

Retrieve the previously generated commit message:

noto prev

Amend the previously generated commit message:

noto prev --amend --edit # or simply: noto prev --amend -e

Note: When using the --amend flag with the noto prev command, the --edit (-e) flag is also required. This combination will allow you to modify (amend) the previous commit message before applying it.

Note: All of the flags shown above (--apply, --copy, --type, --edit) can also be used with the noto prev command to work with the previously generated commit message.

Switch between branches in you git repo with an interactive prompt:

noto checkout

To copy the selected branch to your clipboard immediately after choosing it, use the new -c flag:

noto branch

To list all branches, including remote branches, use the -r flag

noto branch -r

Delete local branches:

noto branch delete

If you need to force delete a branch, you can use the force flag:

noto branch delete --force # simply: noto branch delete -f

Pro Tips

  • 🚀 Get fast commits on the fly with noto -a to streamline your workflow!

Contributing

We welcome contributions and suggestions! If you have ideas or improvements, feel free to reach out or open a pull request.

Thank you for using noto! If you have any feedback or suggestions, feel free to reach out or contribute to the project. ✨

License

This project is licensed under the MIT License. © 2024 Sithija Nelusha Silva

Package Sidebar

Install

npm i @snelusha/noto

Weekly Downloads

10

Version

1.2.7

License

MIT

Unpacked Size

42.6 kB

Total Files

5

Last publish

Collaborators

  • snelusha