Git Product home page Git Product logo

ottodocs's Introduction

OttoDocs 🦦

License: AGPL v3

Ottodocs is a command-line tool built in Go that utilizes OpenAI's ChatGPT API to generate commit messages, pull requests, answers to questions, and even shell commands based on input prompts and code context. It helps developers automate various parts of their development workflow using AI. The tool requires an OpenAI API key to function.

Installation

There are two methods to install OttoDocs:

  1. Precompiled binaries: Download the precompiled binaries from the GitHub releases tab.
  2. Build from source: Clone the repo and build the binary by running the following commands:

Installing Precompiled Binaries

Simply download the binary for your platform from the GitHub releases tab and place it in your $PATH .

Building From Source

OttoDocs utilizes the just command runner for building and running tasks, making maintaining the project easier. If you do not have just installed, see here for installation methods. Ottodocs requires Go 1.20+ to build.

git clone https://github.com/chand1012/ottodocs.git
cd ottodocs
just build # will build to bin/otto
# or
just install # will build & copy to $GOPATH/bin. 

If you want to build for all supported platforms, you can run the following command:

just crossbuild

This will build and compress binaries for all supported platforms and place them in the dist directory.

Getting Started

First, you need to create an OpenAI API Key. If you do not already have an OpenAI account, you can create a new one and get some free credits to try it out. Once you have an account, you can create an API key by going to the API Keys tab in your account settings.

Once you have an API key, you can log in to ottodocs by running the following command:

otto config --apikey $OPENAI_API_KEY

You can set the model to use by running:

otto config --model $MODEL_NAME

You can add a GitHub Personal Access Token for opening PRs by running:

otto config --token $GITHUB_TOKEN

Make sure that your access token has the repo scope.

Once that is complete, you can start generating documentation by running the following command:

otto docs <path to repo or file>

Or for a single file, you can run:

otto doc -f <path to file>

Ask a question about a repo:

otto ask . -q "What does LoadFile do differently than ReadFile?"

Generate a commit message:

otto commit # optionally add --push to push to remote

Generate a pull request:

# make sure you are creating the PR on the correct base branch
otto pr -b main # optionally add --publish to publish the Pull Request

Ask it about commands:

otto cmd -q "what is the command to add a remote?"

Usage

For detailed usage instructions, please refer to the documentation.

ottodocs's People

Contributors

chand1012 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.