DEV Community

Alec Lindsay
Alec Lindsay

Posted on

AI-documentor: "automagic" wiki / docs for your web apps

Overview

AI-documentor is an open-source command-line tool that automatically generates documentation for your TypeScript projects. Optimized for react apps.

I built this because shipping velocity has 10x'd with AI, completely outpacing the tempo with which features can be properly documented for all stakeholders to understand how they're supposed to work.

Instead of writing docs by hand, AI-documentor uses generative AI to scan your source files and produce human-readable Markdown. It identifies modules, classes, functions and interfaces and creates a structured docs/ folder with a separate page for each file.

How it works

  • Runs from the command line: npx ai-documentor src/index.ts or install globally via npm install -g ai-documentor.
  • Parses your code's abstract syntax tree to understand the structure.
  • Uses the OpenAI API to generate docstrings and explanations.
  • Outputs tidy Markdown files that you can commit or publish as static site content.

Try it out

  1. Install via npm:
npm install -g ai-documentor
Enter fullscreen mode Exit fullscreen mode
  1. Run against your project:
npx ai-documentor src
Enter fullscreen mode Exit fullscreen mode
  1. Open the generated docs folder to see the results.

Get involved

AI-documentor is still early and a bit rough around the edges, so feedback and contributions are welcome. The code is open source under the MIT licence at github.com/aleclindz/ai-documentor and the npm package is available at npmjs.com/package/ai-documentor.

Let me know what you think — feel free to open issues, fork the project, or submit pull requests. Thanks for reading and happy documenting!

Top comments (0)