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.
- Recursive directory traversal with
.gitignoresupport - 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
# 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_KEYenvironment variable for Claude integration
# 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/projectThe 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:
- Clone the repository to a temporary directory
- Process the files as requested
- Clean up the temporary directory when done
src/
├── lib.rs # Core library functionality
├── claude.rs # Claude API integration
└── bin/
├── cli.rs # Command-line interface
└── api.rs # HTTP API server
# Run tests
cargo test
# Check code formatting
cargo fmt --check
# Run linter
cargo clippy
# Build documentation
cargo doc --no-deps --open