Code Monkey home page Code Monkey logo

docgpt's Introduction

DocGPT

logo

A CLI written in Java language that generate API interface document and UML diagrams for you using ChatGPT AI(gpt-3.5-turbo).

Feature

  • Generate API interface documentation, which displays the request and response data structures in tabular form and provides sample code for calling the API in both curl and Java.
  • Generate UML activity and class diagrams based on the code. method activity diagram and class diagram.
  • Provide a command-line tool with autocomplete feature.
  • No need for a web proxy even in mainland China.

Installation

Downloaddocgpt.jar,start with java command:

java -jar docgpt.jar

Setup

OpenAI

Please first create your OpenAI API Key. The OpenAI Platform allows you to generate a new API Key.

registry

config

When using DocGPT, there are two ways to configure the OpenAI API Key.

  • One is to set the environment variable using the command below
export OPENAI_API_KEY=sk-xxxxxxx
  • The other is to set the OPENAI_API_KEY configuration using the conf command of DocGPT
docgpt> conf --token=sk-***

Usage

Load project

In order to assemble prompt content more effectively and save token consumption, DocGPT uses the load command to load and parse Java code.

docgpt> load --directory=<Java file directory>

load

Tips:

  1. If you have already specified the directory parameter, you can use the load command to quickly load it without specifying the directory parameter again later. You can use conf to check the default directory. conf
  2. The --directory path support auto-completion, and you can use the tab key to select the path.

List

The ls command list all loaded classes and the number of methods they contain. ls You can add --method=<Class Name> to list the methods that the class contains. ls_class

Generate API interface documentation

By using gen and specifying the method name with --method=, you can generate API documentation in Markdown format. gen_doc api_doc

Generate UML diagram

By using gen --uml --method=<Method name>, you can generate the activity diagram of the method, and gen --uml --class=<Class name> generate the class diagram of the class.


Method activity diagram


Class diagram

Reference

docgpt's People

Contributors

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