npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

branchcraft

v1.1.28

Published

An npm package that creates a new git branch, suggests a name, and uses OpenAI's ChatGPT to develop code for the branch.

Downloads

19

Readme

BranchCraft

BranchCraft is an interactive CLI tool that streamlines branch creation and code suggestions for Git repositories. Powered by OpenAI's GPT, it enhances your development workflow by seamlessly generating new branches with relevant code snippets. With BranchCraft, you can quickly create new branches containing relevant code snippets, making it easier to jumpstart your development process.

** note that this is a beta package. It may be buggy and is not yet ready for production use. You may (probably will) experience buggy behavior. **

using GPT 3.5 turbo

Branchcraft natively uses GPT 3.5 turbo. This means that you need a premium OpenAI account to use BranchCraft. If you don't have a premium account, you can sign up for one here. Support for the free model is coming soon.

bugs and issues

A note on BranchCraft's current state: BranchCraft is currently in beta. It is not yet ready for production use. We are actively working on improving the tool and adding new features. If you have any feedback or suggestions, please feel free to contribute.

token limit exceeded

For large code bases or repos, you may encounter issues with max token length. Smartly handling large code bases is a high priority, but there's a fine line to be walked in trimming context and preserving necessary context. We're working on it! If you do encounter an error, try adding special instructions to limit the potential scope of what files BranchCraft will look at. For example, if you're working on a React app, you can add the following special instructions to the CLI: "you should only ask me for .tsx files in the /src/pages/home directory". This will limit the scope of the search and hopefully prevent the error from occurring.

unparsable code replies (suggestions is not iterable)

With gpt prompting being what it is, GPT can sometimes generate code that is not valid. This is due to it ignoring the prompt for returning a proper code block as suggestion. IF this happens, please try again and add special instructions to try to steer GPT.

Installation

To install BranchCraft globally and use it in your own Git repositories, run the following command:

npm install -g branchcraft

Configuration

The first time you use branchcraft, you will need to configure your OpenAI API key. You will be prompted for the key by the Cli. Your API key can be found in your OpenAI account settings.

The key is stored by branchraft in your home directory in a file called .branchcraft. If you need to change your key, you can do so by editing this file.

Creating a new branch

To create a new branch using BranchCraft, navigate to your Git repository and run the following command:

branchcraft

The CLI will prompt you for information about the new branch, such as the type of content it should include, the programming languages the code should be written in, and any special instructions for GPT. Once you provide the necessary information, BranchCraft will generate code suggestions and apply them to the new branch.

Workflow example:

Here's an example of how you might use BranchCraft in your workflow:

First, install BranchCraft globally by running the following command in your terminal:

npm install -g branchcraft

Configure your OpenAI API key. When you run BranchCraft for the first time, it will prompt you for the key. You can find the key in your OpenAI account settings. The key will be stored in a .branchcraft file in your home directory.

Now, navigate to your existing Git repository:

cd /path/to/your/repository

Run the BranchCraft CLI tool:

branchcraft

The CLI will guide you through a series of prompts. Based on your input, BranchCraft will use GPT to generate relevant code suggestions for the new branch.

BranchCraft creates the new branch and applies the generated code suggestions You can now review the generated code, make any necessary adjustments, and continue working on the new feature.