autodocs

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 14 Imported by: 0

README

AutoDocs

AutoDocs is a command-line tool that uses OpenAI to automatically generate documentation for Go functions that don't have comments. It can process a single Go file or all Go files in a directory.

Requirements

AutoDocs uses the OpenAI API to generate documentation. To use AutoDocs, you need to have an OpenAI API key and set it as an environment variable:

export OPENAI_API_KEY=your-api-key

Replace your-api-key with your actual OpenAI API key.

Installation

You can install AutoDocs directly using the go install command:

go install github.com/tbuchaillot/autodocs@latest

This will download the source code, compile it, and move the autodocs executable to $GOPATH/bin.

Make sure $GOPATH/bin is in your PATH to run the autodocs command from anywhere.

Usage

You can run AutoDocs on a single Go file with the -f flag:

autodocs -f myfile.go

This will add documentation to myfile.go functions.

You can also run AutoDocs on all Go files in a directory with the -d flag:

autodocs -d mydir

This will add documentation to all .go files functions in mydir.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL