npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

docubot

v0.5.0

Published

A handy little documenting AI bot for your code

Downloads

38

Readme

Docubot

Docubot is a bot that helps you document your code. It allows you to save your code into memory and chat with it using AnswerAI, or your own OpenAI or Pinecone API Keys

Usage

To use Docubot, you need to install it globally and then run it. Once it's running, you can chat with it using AnswerAI.

First time

  • Add the following environment variables to your .env file
    • PINECONE_API_KEY (required)
    • PINECONE_ENVIRONMENT (required)
    • OPENAI_API_KEY (required)
    • DOCUBOT_PINECONE_INDEX_NAME (defaults to "docubot")
    • DOCUBOT_PINECONE_NAMESPACE (defaults to "default")
npm install -g docubot

Change your directory to your desired repo

  cd your_path_here

Run Docubot

docubot start -full

It will then count the tokens and give you a cost estimate. When you say yes, it will go through all of your files and magic... automated documentation!

Configuration

Sure! Here's a table that describes the properties and values in the configuration file:

| Constant name | Description | | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | | codeBasePath | A string representing the base path of the code. | | pineconeIndexName | A string representing the name of the Pinecone index. | | pineconeNamespace | A string representing the namespace of the Pinecone index. | | docubotDirectoryName | A string representing the name of the Docubot directory. | | docubotDirectory | A string representing the file path of the Docubot directory. | | markdownDirectory | A string representing the file path of the Markdown directory. | | promptsFilePath | A string representing the file path of the prompts file. | | templateFilePath | A string representing the file path of the template file. | | packageJsonPath | A string representing the file path of the package.json file. | | invalidPaths | An array of strings representing invalid file paths. | | invalidFileTypes | An array of strings representing invalid file types. | | invalidFileNames | An array of strings representing invalid file names. | | fileTypes | An object containing key-value pairs representing different file types and their associated properties, such as file types, prompt, and template files. | | fileTypes.docs | An object representing documentation file types and their associated properties. | | fileTypes.react | An object representing React file types and their associated properties. | | fileTypes.api | An object representing API file types and their associated properties. | | fileTypes.config | An object representing configuration file types and their associated properties. | | fileTypes.script | An object representing script file types and their associated properties. | | fileTypes.contentModel | An object representing content model file types and their associated properties. | | fileTypes.default | An object representing the default file type and its associated properties. |

To execute the command on a single file

docubot start /path/to/file

Commands

Docubot has several commands that you can use to interact with it.

docubot save

The save command allows you to save your code into pinecone memory

docubot save

docubot list

The list command allows you to list all of the files that you have saved.

docubot list

TODO Items

CLI

  • Add husky job to save to autodocument the change, allow the user to change the comment then pinecone on commit
  • Classify files based on the area of the site using the embedding API
  • Enable automated syncing to pincone without embeddings on when a file changes
  • handle files over 8k in tokens
  • Git action for pull requests that auto create the change log documentation based on the commit history and path file

UI

  • Add ability to select files to use in completion
  • Show the user how many tokens they can have in the completion based on what files, model, and prompt they have selected

Oberservations:

  • I noticed that getting the correct folder structure is hard to get. I want to add a directory tree to the documentation that gets sent with each request for debugging and teaching purposes