documentor

command module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

README

documentor

documentor is an easy-to-use, efficient, and powerful command-line application that uses the power of AI to review documentation and provide feedback on how to improve it, draft new documentation from scratch, and more.

It assists documentation writers in creating better documentation by automating parts of the writing and review process, allowing them to focus on the content and structure of the document itself.

Installation

From source

First, ensure that the following dependencies are installed:

  • Go 1.24 or above.
  • make.
  • scdoc.

Optionally, you can install glow to render the Markdown output of the review command with more style.

Then, switch to the latest stable tag (v1.2.0), compile, and install:

git checkout v1.2.0
make
sudo make install

Usage

[!NOTE] If you're a Datadog employee, please follow the documentation in Confluence.

$ documentor --help
NAME:
   documentor - improve technical documentation with the power of AI

USAGE:
   documentor [global options] command [command options]

VERSION:
   1.2.0

COMMANDS:
   review, r    review technical documentation
   describe, d  describe an image and generate alt text
   draft, D     draft new documentation based on the provided notes

GLOBAL OPTIONS:
   --key value, -k value          the API key to use [$DOCUMENTOR_KEY]
   --provider value, -p value     the AI provider to use (default: "openai") [$DOCUMENTOR_PROVIDER]
   --endpoint value, -e value     the API endpoint to use (currently only used for the Datadog provider) [$DOCUMENTOR_ENDPOINT]
   --model value, -m value        the AI model to use (default: "gpt-4o") [$DOCUMENTOR_MODEL]
   --temperature value, -t value  the temperature to use for the model (default: 0.8) [$DOCUMENTOR_TEMPERATURE]
   --help, -h                     show help
   --version, -v                  print the version
Examples

1. Review a documentation file using the default provider, OpenAI:

documentor --key 'your-openai-api-key' review '/path/to/file.md'

2. Review a documentation file with the API key set in the environment:

export DOCUMENTOR_KEY='your-openai-api-key'
documentor review '/path/to/file.md'

3. Save the output to a file:

documentor review '/path/to/file.md' >> review.md

4. Format the default Markdown output with glow:

documentor review '/path/to/file.md' | glow

5. Describe an image:

documentor describe '/path/to/image.png'

6. Describe an image with context:

documentor describe --context 'This my cat, Mittens.' '/path/to/image.png'

7. Describe an image and generate a filename for the image:

documentor describe --filename '/path/to/image.png'

8. Draft a document based on your notes:

documentor draft '/path/to/notes/file.md'

9. Draft a document using Anthropic as the AI provider:

documentor --provider 'anthropic' --key 'your-anthropic-api-key' draft '/path/to/notes/file.md'

10. Review a document using a different LLM model:

documentor --model 'o3-mini' review '/path/to/file.md'

Refer to the documentor(1) manpage after installation for more information.

Contributing

Anyone can help make documentor better. Refer to the contribution guidelines for more information.


This project is released under the Apache-2.0 License.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
ai
Package ai provides an interface for interacting with AI providers.
Package ai provides an interface for interacting with AI providers.
ai/anthropic
Package anthropic provides a client wrapper for the Anthropic API that complies with the ai.Provider interface.
Package anthropic provides a client wrapper for the Anthropic API that complies with the ai.Provider interface.
ai/datadog
Package datadog provides a client wrapper for the Datadog AI proxy API that complies with the ai.Provider interface.
Package datadog provides a client wrapper for the Datadog AI proxy API that complies with the ai.Provider interface.
ai/openai
Package openai provides a client wrapper for the OpenAI API that complies with the ai.Provider interface.
Package openai provides a client wrapper for the OpenAI API that complies with the ai.Provider interface.
app
Package app is the main package for the application.
Package app is the main package for the application.
errno
Package errno provides a way to handle errors with exit codes.
Package errno provides a way to handle errors with exit codes.
meta
Package meta provides build information and other metadata for the application.
Package meta provides build information and other metadata for the application.
prompt
Package prompt holds prompts to be used by AI.
Package prompt holds prompts to be used by AI.
validate
Package validate contains functions and utilities for validating input data.
Package validate contains functions and utilities for validating input data.
xbase64
Package xbase64 extends Go's base64 package.
Package xbase64 extends Go's base64 package.

Jump to

Keyboard shortcuts

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