Download the PHP package genericmilk/docudoodle without Composer
On this page you can find all versions of the php package genericmilk/docudoodle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download genericmilk/docudoodle
More information about genericmilk/docudoodle
Files in genericmilk/docudoodle
Package docudoodle
Short Description Generate documentation for your Laravel application using OpenAI
License MIT
Homepage https://github.com/genericmilk/docudoodle
Informations about the package docudoodle
Docudoodle v2.3.0
This is Docudoodle! 👋 The PHP documentation generator that analyzes your codebase and creates comprehensive documentation using AI. It's perfect for helping you and your team understand your code better through detailed insights into your application's structure and functionality.
Docudoodle is fab if you've taken on an application with no existing documentation allowing your team to get up to speed right away.
Docudoodle writes Markdown files which show up great in Github and other source control providers allowing you to get teams up to speed in a matter of moments.
Better yet, Docudoodle skips already existing documentation files. Allowing a quick top-up run after you have concluded a feature, meaning that the entire process of getting good documentation written is a thing of the past 🚀
Table of Contents
- Examples
- Features
- Installation
- Usage
- Configuration
- OpenAI API Key
- Claude API Key
- Gemini API Key
- Azure OpenAI Settings
- Model Selection
- API Provider
- Ollama Configuration
- Token Limits
- File Extensions
- Skip Directories
- Caching
- Template Variables
- Custom Template Example
- Using Azure OpenAI
- Documentation Output Options
- Jira Integration
- Confluence Integration
- Dependencies
- Command Options
- Running Tests
- License
- Contributing
Examples
If you want to see what the output of some documentation looks like, check out the examples folder in this repo which contains a few examples 🥰
Features
- Automatic Documentation Generation: Effortlessly generates documentation for PHP files by analyzing their content.
- Smart Caching: Only processes files that have changed since the last run, saving time and API costs.
- Orphan Cleanup: Automatically removes documentation for deleted source files to keep your docs in sync.
- Flexible AI Integration: Choose between OpenAI's powerful cloud API, Claude API, Google's Gemini API, or run locally with Ollama models for complete privacy.
- Ollama Support: Generate documentation completely offline using your own local Ollama models - perfect for private codebases or when you need to work without an internet connection.
- Azure OpenAI Support: Use Microsoft's Azure OpenAI service for documentation generation with enterprise-grade security and compliance.
- Customizable: Easily configure source directories, output folders, and other settings to match your workflow.
- Command-Line Interface: Includes a simple command-line script for quick documentation generation.
Installation
Getting started with Docudoodle is super easy! Just use Composer with this command:
This will set up all the necessary dependencies defined in the composer.json file.
Usage
Ready to create some amazing documentation? Just run this simple command:
If you're using OpenAI, make sure to set your API key which looks a bit like this: sk-XXXXXXXX in the application configuration file. If you're using Ollama, ensure it's running on your system and properly configured in your settings. For Claude, set your API key in the configuration file.
Configuration
Docudoodle is highly customizable! The package includes a configuration file at config/docudoodle.php that lets you tailor everything to your needs:
OpenAI API Key
Set your OpenAI API key here or in your .env file as OPENAI_API_KEY. Keys typically start with sk-XXXXXXXX.
Claude API Key
Set your Claude API key here or in your .env file as CLAUDE_API_KEY.
Gemini API Key
Set your Gemini API key here or in your .env file as GEMINI_API_KEY.
Azure OpenAI Settings
Configure Azure OpenAI integration. You need to provide the endpoint URL, API key, deployment ID, and optionally the API version if using Azure as your API provider.
Model Selection
Choose which model to use. The default is gpt-4o-mini for OpenAI, but you can specify any OpenAI model, Claude model, Gemini model, or Ollama model name in your .env file with the DOCUDOODLE_MODEL variable.
API Provider
Choose which API provider to use: 'openai' for cloud-based generation, 'azure' for Azure OpenAI, 'claude' for Claude API, 'gemini' for Gemini API, or 'ollama' for local generation. Set in your .env file with DOCUDOODLE_API_PROVIDER.
Ollama Configuration
Configure your Ollama host and port if using Ollama as the API provider. The defaults work with standard Ollama installations.
Token Limits
Control the maximum number of tokens for API calls. Adjust this in your .env file with DOCUDOODLE_MAX_TOKENS if needed.
File Extensions
Specify which file types Docudoodle should process. By default, it handles PHP and YAML files.
Skip Directories
Define directories that should be excluded from documentation generation.
You can publish the configuration file to your project using:
Caching
To improve performance and reduce API calls on subsequent runs, Docudoodle implements a caching mechanism.
How it works:
- When a source file is processed, a hash of its content is calculated.
- This hash is stored in a cache file (
.docudoodle_cache.jsonby default) alongside a hash representing the relevant parts of the configuration (model, prompt template, API provider). - On the next run:
- The overall configuration hash is checked. If it differs, the cache is invalidated, and all files are reprocessed.
- If the configuration hash matches, the content hash of each source file is compared to the stored hash.
- Files with matching hashes are skipped.
- Files with different hashes or files not found in the cache are processed, and the cache is updated.
- Orphan Cleanup: If a source file is deleted, Docudoodle detects this and removes its corresponding documentation file from the output directory and its entry from the cache.
Configuration:
You can control caching via config/docudoodle.php:
use_cache(boolean, default:true): Set tofalseto disable the caching mechanism entirely.cache_file_path(string|null, default:null): Specifies the absolute path to the cache file. Ifnullor empty, it defaults to.docudoodle_cache.jsoninside the configuredoutput_dir.force_rebuild(boolean, default:false): When set totrue, regenerates all documentation regardless of the cache status. Useful for manual cache invalidation.
Command Line Options:
--no-cache: Disables caching for this run, forcing reprocessing of all files. This overrides theuse_cacheconfig setting.--force-rebuild: Forces regeneration of all documentation files regardless of cache status. This overrides theforce_rebuildconfig setting.--cache-path="/path/to/your/cache.json": Specifies a custom absolute path for the cache file for this run, overriding thecache_file_pathconfig setting.
Cache File Format:
The cache file is a JSON document with the following structure:
When the configuration changes (different model, API provider, or prompt template), the _config_hash value changes, which triggers a full rebuild on the next run.
Template Variables
When creating custom prompt templates for documentation generation, you can use the following variables:
| Variable | Description |
|---|---|
{FILE_PATH} |
The full path to the file being documented |
{FILE_CONTENT} |
The content of the file being processed |
{FILE_NAME} |
The filename with extension (e.g., User.php) |
{EXTENSION} |
The file extension (e.g., php) |
{BASE_NAME} |
The filename without extension (e.g., User) |
{DIRECTORY} |
The directory containing the file |
Custom Template Example
Create a markdown file for your custom prompt template:
{EXTENSION} {FILE_CONTENT} `
Then specify the custom template path in your .env file:
Using Azure OpenAI
To generate documentation using Azure OpenAI:
-
Set up your Azure configuration in the
.envfile: - Run the command:
You can also specify Azure parameters directly in the command:
Documentation Output Options
By default, Docudoodle generates documentation in Markdown format in your specified output directory.
Jira Integration
Docudoodle can publish documentation directly to Jira as issues. To enable this:
-
Configure your Jira settings in
.env: - Run the command with Jira enabled:
Confluence Integration
Docudoodle can publish documentation directly to Confluence. To enable this:
-
Configure your Confluence settings in
.env: - Run the command with Confluence enabled:
Dependencies
To use Jira or Confluence integration, make sure to install the Guzzle HTTP client:
Command Options
You can combine these options as needed. For example, to generate documentation in both Jira and Confluence but not in the file system:
Running Tests
Want to make sure everything's working perfectly? Run the tests with:
Or if you're using Laravel's test runner:
License
This project is licensed under the MIT License. Check out the LICENSE file for all the details.
Contributing
We'd love your help making Docudoodle even better! Feel free to submit a pull request or open an issue for any enhancements or bug fixes. Everyone's welcome! 🎉
All versions of docudoodle with dependencies
illuminate/console Version ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0