Download the PHP package genericmilk/sakura without Composer

On this page you can find all versions of the php package genericmilk/sakura. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sakura

# Sakura v1.0.3 [![Tests](https://github.com/genericmilk/sakura/workflows/Tests/badge.svg)](https://github.com/genericmilk/sakura/actions) [![Version](https://img.shields.io/badge/version-1.0.0-blue.svg)](https://packagist.org/packages/genericmilk/sakura) [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE.md) 🤖 Sakura is a Laravel package that automatically generates comprehensive tests for your PHP classes and functions using OpenAI's GPT-4o-mini, Anthropic's Claude, Google's Gemini, or local Ollama models.

Table of Contents

Features

Installation

  1. Install the package via Composer:

  2. Publish the configuration file:

  3. Configure your AI provider:

For OpenAI:

For Claude:

For Gemini:

For Ollama:

  1. Optional: Configure additional settings in your .env file:

Usage

Basic Usage

Generate tests for all changed/new code:

Advanced Usage

Force regeneration of all tests:

Generate tests for a specific class:

Generate tests for a specific function:

Dry run (see what would be generated without creating files):

Override AI provider for this run:

AI Providers

OpenAI

Claude

Gemini

Ollama

Setting up Gemini

  1. Get a Google AI API key:

  2. Configure sakura:

  3. Test the configuration:

Setting up Claude

  1. Get an Anthropic API key:

  2. Configure sakura:

  3. Test the configuration:

Setting up Ollama

  1. Install Ollama:

  2. Start Ollama:

  3. Pull a code model:

  4. Configure sakura:

How It Works

1. Code Analysis

sakura analyzes your codebase and creates a tree of all PHP classes and functions in the configured directories:

2. Change Detection

sakura tracks changes by:

3. Test Generation

For each changed/new item, sakura:

4. Test Organization

Tests are organized following Laravel conventions:

Configuration

AI Provider Settings

OpenAI Settings

Claude Settings

Gemini Settings

Ollama Settings

Analysis Directories

Note: Sakura will only analyze directories that exist in your project. If you see "No changes detected" on a fresh installation, you may need to:

  1. Adjust the directories array to match your project structure
  2. Create some PHP classes in the configured directories
  3. Run php artisan sakura:generate-tests --force to analyze all existing code

Testing Configuration

File Structure

After installation, sakura creates a .sakura directory in your project root:

Example Output

When you run php artisan sakura:generate-tests, you'll see output like:

Generated Test Examples

Pest Feature Test (Controller)

PHPUnit Unit Test (Service)

Provider Comparison

Feature OpenAI Claude Gemini Ollama
Cost Per request Per request Per request Free
Speed ⭐⭐⭐⭐⭐ ⭐⭐⭐⭐ ⭐⭐⭐⭐⭐ ⭐⭐⭐
Quality ⭐⭐⭐⭐⭐ ⭐⭐⭐⭐⭐ ⭐⭐⭐⭐ ⭐⭐⭐⭐
Privacy ⭐⭐ ⭐⭐ ⭐⭐ ⭐⭐⭐⭐⭐
Setup ⭐⭐⭐⭐⭐ ⭐⭐⭐⭐⭐ ⭐⭐⭐⭐⭐ ⭐⭐⭐
Customization ⭐⭐⭐ ⭐⭐⭐ ⭐⭐⭐ ⭐⭐⭐⭐⭐

Troubleshooting

OpenAI Issues

Claude Issues

Gemini Issues

Ollama Issues

General Issues

Requirements

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

The MIT License (MIT). Please see License File for more information.

Support

If you encounter any issues or have questions, please open an issue on GitHub.


Made with ❤️ by Genericmilk


All versions of sakura with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
laravel/framework Version ^10.0|^11.0
guzzlehttp/guzzle Version ^7.0
openai-php/client Version ^0.8.0
wpai-inc/anthropic-sdk-php Version ^0.2.0
google-gemini-php/client Version ^2.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package genericmilk/sakura contains the following files

Loading the files please wait ...