Type to search documentation...

Getting Started

Get Docit running in your Rails app in under a minute.

Requirements

  • Ruby ≥ 3.2
  • Rails ≥ 7.0

Installation

Add Docit to your Gemfile:

gem "docit"

Then run:

bundle install
rails generate docit:install

What the installer does

The install generator handles everything in one step:

  1. Creates config/initializers/docit.rb with default settings
  2. Mounts the documentation engine at /api-docs in your routes
  3. Asks how you'd like to set up your docs:
    • AI automatic docs — configure an AI provider, then Docit scans your routes and generates complete documentation for every endpoint
    • Manual docs — creates scaffolded doc files with TODO placeholders and injects use_docs into controllers
    • Skip — just install the base config and set up docs later

View your docs

Start your Rails server and visit:

http://localhost:3000/api-docs

You'll see the Scalar API Reference by default. Swagger UI is also available at /api-docs/swagger.

AI setup

If you chose AI setup during install, Docit stores your provider config in .docit_ai.yml with restricted file permissions and adds that file to .gitignore when possible.

Next steps