Skip to content

Fluen core code documentation functionality exposed as a CLI command

License

Notifications You must be signed in to change notification settings

Fluen-io/fluen-core

Repository files navigation

Fluen: AI-Powered Code Documentation Generator

License Python 3.9+

Fluen is a modern, LLM-powered documentation generator that understands your code. Point it at any git repository, and it will create comprehensive, intelligent documentation that captures not just the structure, but the intent and relationships within your codebase.

Quick Demo

Demo

✨ Features

  • Language Agnostic: Works with any programming language - understands patterns, idioms, and best practices across different languages
  • Intelligent Analysis: Uses LLMs to understand code purpose, relationships, and architectural patterns
  • Git Integration: Works with any git repository, tracks changes, and updates documentation incrementally
  • Rich Documentation: Generates both HTML and Markdown documentation with:
    • Cross-referenced code elements
    • Dependency graphs
    • Public API documentation
    • Code purpose analysis
    • Framework detection

🚀 Quick Start

  1. Install Fluen:
pip install fluen
  1. Create a configuration file:
# Copy the example config
cp fluen_config.example.yml fluen_config.yml

# Edit the config file with your LLM provider settings
vim fluen_config.yml
  1. Generate documentation: The generate command analyzes the project and generates a code manifest.json file. We recommend you to first clone a repository and then run fluen from the root of your local repository.
# For local repository
fluen docs generate

# For remote repository
fluen docs generate --repo https://github.com/username/repo.git

Once the manifest.json generation succeeds, run the export command to export in html or markdown format

# Default export type configured in fluen_config.yml
fluen docs export

# Explicitly tell the export format type html/md
fluen docs export --type md
  1. View your documentation:
# Documentation will be available in ./docs directory
open docs/html/index.html
  1. Update your documentation Fluen is designed to update documentation incrementally with git commits. However there might be scenarios where you need to fore an update. Simply use the --force flag
fluen docs generate --force
  1. Selective scanning (of sub directories) In case you want Fluen to look at only a specific sub-directory, then use the --scan flag
fluen docs generate --scan path:<your_sub_path>

You may use the --force flag to force updates

📖 Use Cases

1. Project Onboarding

Help new team members understand your codebase quickly with AI-generated documentation that explains not just what the code does, but why it does it.

2. Code Audits

Get a comprehensive view of your project's architecture, dependencies, and exposed APIs. Perfect for security audits and architectural reviews.

3. Technical Documentation

Generate and maintain up-to-date technical documentation without manual effort. Fluen tracks changes and updates only what's needed.

4. Legacy Code Understanding

Make sense of legacy codebases by letting Fluen analyze patterns, dependencies, and architectural decisions embedded in the code.

⚙️ Configuration

Fluen uses a YAML configuration file (fluen_config.yml) for customization. Here's a minimal configuration:

llm:
  # Choose your provider: 'openai' or 'mistral' or 'ollama' for local use
  provider: openai
  api_key: your-api-key-here
  model: gpt-3.5-turbo  # or 'gpt-4o' for better results

# Output directory for generated documentation
output_dir: docs

# Documentation format
default_export_type: html  # or 'md' for markdown

See fluen_config.example.yml for a complete configuration example with all available options.

🔧 Requirements

  • Python 3.9 or higher
  • Git
  • An API key from OpenAI or Mistral AI (recommended providers)

🚧 Roadmap

Exciting features coming soon:

  • Interactive code chat interface with project-wide search
  • Enhanced code element descriptions and relationships
  • PDF export
  • Custom template support
  • Plugin system
  • CI/CD integration

🤝 Contributing

We welcome contributions! Whether it's bug reports, feature requests, or code contributions, please feel free to contribute.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Install development dependencies:
pip install -e ".[dev]"
  1. Make your changes
  2. Run tests:
pytest
  1. Submit a Pull Request

📄 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

🙋‍♂️ Support

🌟 Show your support

Give a ⭐️ if this project helped you!


Made with ❤️ by Fluen using the Jiva Framework and Claude by Anthropic