Giter Site home page Giter Site logo

mvrilo / boilerplaite Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 337 KB

boilerplaite is a command-line tool and go package to generate boilerplate code from a prompt using openai's chatgpt api

License: MIT License

Makefile 1.45% Go 98.55%
boilerplaite boilerplate chatgpt cli cobra code-generation command-line go golang openai

boilerplaite's Introduction

boilerplaite

GoDoc Go Report Card

boilerplaite is a command-line tool and library to generate boilerplate code from a prompt using openai's chatgpt api.

demo

Installation

go install github.com/mvrilo/boilerplaite/cmd/boilerplaite@latest

Usage

boilerplaite is a package and cli tool to generate boilerplate code from a prompt using openai's chatgpt api.

Usage:
  boilerplaite [flags]

Examples:
boilerplaite -o ./examples/go-cli-example -p "go program, package main, using cobra"

Flags:
  -h, --help            help for boilerplaite
  -m, --model string    OpenAI model (default "gpt-3.5-turbo")
  -o, --output string   Output directory
  -p, --prompt string   Prompt
  -t, --timeout int     Timeout in seconds (default 60)
  -v, --verbose         Verbose logs

See examples below.

Configuration

Most options can be used as flags as shown below in "usage".

Except for OpenAI api key which must be set as environment variable: BOILERPLAITE_OPENAI_KEY

Examples

  • A Go program using cobra.
boilerplaite -o ./examples/go-cli-example -p "go program, package main, using cobra"
  • A Rust server using axum.
boilerplaite -o ./examples/rust-axum-hello -p "hello world program using rust with axum server and cli with clap"
  • SQL tables and queries
./boilerplaite -o ./examples/sql-users-table -p "sql file containing create table statement for users, insert and update queries, the table should include id, name and email"
  • A Python app using flask listening on port 3000.
./boilerplaite -o ./examples/python-flask-hello-world -p "python app using flask, hello world endpoint, listening on port 3000"
  • A Ruby app using sinatra, fetchin data from sqlite db, listening on port 5000, with extra files.
./boilerplaite -o ./examples/ruby-sinatra -p "a ruby app using sinatra, fetching some data from a sqlite database, listening on port 5000, with dockerfile, gemspec and bundle files"
  • A Ruby script for encoding data into sha256 from stdin to stdout
./boilerplaite -o ./examples/ruby-sha256 -p "ruby script for encoding data into sha256 from stdin to stdout"

Check the output here: ./examples.

Notes

  • Responses may contain innacurate or incorrect data.
  • GPT-3.5-turbo is used as default model.
  • Beware the high costs when changing the model to GPT-4.
  • No overwrites when writing to files.

boilerplaite's People

Contributors

mvrilo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.