A command-line tool that uses OpenAI to generate code from a prompt and an input file. Change code in-place, write new files, or just ask questions. A versatile AI-powered programming assistant that streamlines tasks and boosts productivity.
To use Codemancer with your own OpenAI API key, set OPENAI_API_KEY in your environment.
export OPENAI_API_KEY=your_api_key_here
Defaults to GPT-4. If you don't have access and hit a 404, you can fall back to GPT-3.5 with -m "gpt-3.5-turbo" — code generation is less reliable on 3.5.
codemancer -i input_file -p "break the /recipe/<id> route into /recipe/<id>/info and /recipe/<id>/image"
codemancer -i input_file -o output_file -p "extract inlined types into interfaces in a separate file"
codemancer -o output_file -p "I need an AppleScript to wipe Safari history on restart"
codemancer -p "what's a bulletproof regex for validating emails"
codemancer -i input_file -m gpt-3.5-turbo -t 0.5 -p "change all variable names to obscure animals"
GPL License — this code was largely written by AI with some human guidance.