Skip to content

A Rust-based tool for generating technical documentation from codebases, with support for AI-powered README generation.

Notifications You must be signed in to change notification settings

thesurlydev/techdocs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TechDocs

A Rust-based tool for generating technical documentation from codebases, with support for AI-powered README generation. Available as both a CLI tool and an HTTP API.

Key Features

  • Recursive directory traversal with .gitignore support
  • Smart file filtering and size limits
  • Robust UTF-8 handling with lossy conversion for binary files
  • AI-powered README generation using Claude API
  • Customizable exclude patterns
  • Language-aware code formatting
  • Support for GitHub URLs as input (automatically clones repositories)
  • HTTP API for integration with other tools

Installation

# Clone the repository
git clone https://github.com/thesurlydev/techdocs.git

# Build the project
cargo build --release

# Add CLI to path (optional)
cp target/release/techdocs-cli /usr/local/bin/

Requires:

  • Rust toolchain
  • ANTHROPIC_API_KEY environment variable for Claude integration

Usage

CLI

# List files in a directory
techdocs-cli list path/to/project

# Generate formatted content for AI prompts
techdocs-cli prompt path/to/project --max-file-size-kb 100 --max-total-size-mb 10

# Generate README using Claude AI
techdocs-cli readme path/to/project

# Use with GitHub repositories
techdocs-cli readme https://github.com/username/repo

# Add exclude patterns
techdocs-cli -e "target/,node_modules/" readme path/to/project

HTTP API

The HTTP API is documented using OpenAPI 3.0 specification in openapi.yaml. You can view the API documentation using tools like Swagger UI or Redoc.

# Start the API server
cargo run --bin techdocs-api

# Generate README for a local directory
curl -X POST http://localhost:3000/generate \
  -H "Content-Type: application/json" \
  -d '{
    "path_or_url": "/path/to/project",
    "exclude_patterns": ["target", "node_modules"]
  }'

# Generate README for a GitHub repository
curl -X POST http://localhost:3000/generate \
  -H "Content-Type: application/json" \
  -d '{
    "path_or_url": "https://github.com/username/repo"
  }'

When using GitHub URLs, the tool will automatically:

  1. Clone the repository to a temporary directory
  2. Process the files as requested
  3. Clean up the temporary directory when done

Project Structure

src/
├── lib.rs           # Core library functionality
├── claude.rs        # Claude API integration
└── bin/
    ├── cli.rs       # Command-line interface
    └── api.rs       # HTTP API server

Development

# Run tests
cargo test

# Check code formatting
cargo fmt --check

# Run linter
cargo clippy

# Build documentation
cargo doc --no-deps --open

About

A Rust-based tool for generating technical documentation from codebases, with support for AI-powered README generation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages