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

codemancer

v0.0.8

Published

Code with GPT-4 from your command line

Downloads

19

Readme

🧙‍♂ codemancer

Develop 10x faster with GPT-4, write and modify code from the command line.

codemancer is a command line tool that uses the OpenAI API to generate code based on a given prompt and input file. It can change code in-place or create brand new files.

You can use it as a versatile and efficient AI-powered programming assistant that simplifies code generation, streamlines development tasks, and boosts productivity.

💫 You can now try codemancer with our own (free but rate-limited) OpenAI GPT-4 proxy.

https://user-images.githubusercontent.com/1714782/227892213-8cfdcbdb-3dae-4043-b155-9164e1104bc1.mp4

Installation

npm install -g codemancer

Usage

To use codemancer with your own OpenAI API key, you need to set the OPENAI_API_KEY environment variable.

export OPENAI_API_KEY=your_api_key_here

codemancer works best using GPT-4, and will use it by default. If you do not have access and receive a 404, you can use the GPT-3.5 model instead via -m "gpt-3.5-turbo", but code generations will be much less reliable.

Reading and writing to the same file

Modify a file in-place based on a prompt, useful for iterating on functionality, addressing review comments, resolving conflicts, or refactoring.

codemancer -i input_file_path -p "break the /recipe/<id> route into /recipe/<id>/info and /recipe/<id>/image"

Reading and writing to a different file

Useful for generating a new file with similar functionality, readmes, or interface definitions (e.g. rpc).

codemancer -i input_file_path -o output_file_path -p "extract inlined types into interfaces in a separate file"

Writing from prompt to file

For generating blank slate code for new projects, one-offs, or scripts.

codemancer -o output_file_path -p "I need an AppleScript to wipe Safari history on restart"

Simple prompting

Ask questions, get answers and suggestions.

codemancer -p "what's a bulletproof regex for validating emails"

Customizing model and temperature

codemancer -i input_file_path -m gpt-3.5-turbo -t 0.5 -p "change all variable names to obscure animals"

Limitations

  • The file content + prompt are currently limited to 8K tokens for GPT-4. If your file is too large/dense and you exceed this limit you will get a 400 error.
  • If there are multiple code blocks returned in the completion, codemancer will present a confirmation message for each and write only the accepted one. If the verbosity argument is set to 0, it will auto-confirm and write the first code block it encounters to the output file.

License

GPL License - This code was largely written by AI with some human guidance.