codinglabsau / cody
Cody Agent orchestrates and runs AI workflows on a Laravel app.
Fund package maintenance!
codinglabsau
Installs: 419
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/codinglabsau/cody
Requires
- php: ^8.3
- dragonmantank/cron-expression: ^3.6
- illuminate/contracts: ^11.0||^12.0
- spatie/laravel-package-tools: ^1.16
- symfony/yaml: ^7.2
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^10.0.0||^9.0.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- spatie/laravel-ray: ^1.35
This package is auto-updated.
Last update: 2025-12-15 01:31:01 UTC
README
Cody is an AI Agent that allows you to run AI workflows on-demand, or on a schedule that you define, right inside your Laravel app.
Features
- Enscapsulate the project AI strategy using prompts defined in simple YAML files
- Manage git worktrees in your local environment through simple artisan commands
- PRs submitted automatically to GitHub with AI-generated summaries
- Workflows can be invoked on-demand or scheduled as recurring background tasks
Installation
You can install the package via composer:
composer require codinglabsau/cody
In addition to the package, the following commands can be run as required:
# dependencies npm install -g @openai/codex brew install gh # authenticate with codex codex login # authenticate with GitHub gh auth login # authenticate with Linear codex mcp add --url https://mcp.linear.app/mcp linear codex mcp login linear -c experimental_use_rmcp_client=true
The project composer.json should include a Cody setup script, which is executed on git worktrees to get the branch
ready for agent workflows. For example:
{
"scripts": {
"ai": [
"composer install",
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\"",
"@php artisan key:generate",
"@php artisan boost:update",
"npm ci"
]
}
}
You can publish the config file with:
php artisan vendor:publish --tag="cody-config"
This is the contents of the published config file:
return [ 'scheduler' => [ 'enabled' => env('CODY_SCHEDULER_ENABLED', true), 'timezone' => env('CODY_TIMEZONE', 'UTC'), ], ];
Usage
There are two main ways to use Cody Agent; on-demand, or by creating reusable prompts with optional scheduling.
On-demand
Coding can be invoked with php artisan cody <branch-name> --prompt='<prompt>'.
For example:
php artisan cody migrate-to-wayfinder --prompt='Switch from ziggy.js to Laravel Wayfinder. Update all references.'
This command will:
- Create a new git worktree at
../<app-name>-migrate-to-wayfinder - Call
composer aiscript on the worktree - Call Codex CLI with the prompt to complete the task
- Again call Codex to create a succint commit message and PR description
- Commit, push, and create a PR on GitHub using the PR template (when available)
Reusable Prompts
Reusable prompts can be created by running php artisan cody:prompt. This command will ask for all required inputs and
output a YAML file to .ai/prompts/<prompt-name>.yaml.
If you have defined prompts that you want to run on a schedule, you can run php atisan cody:run to have them run at
the scheduled time.
Note the scheduler.timezone configuration item; if your local PHP timezone is set to UTC, and you set the schedule in
local time, you'll want to set the
config item to match your local timezone to ensure the scheduler runs at the correct time.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security Vulnerabilities
Create an issue to notify us of any security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.