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.
- Enscapsulate the project AI strategy using prompts defined in markdown
- 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
You can install the package via composer:
composer require codinglabsau/codyIn 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=trueThe 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 [
];There are two main ways to use Cody Agent; on-demand, or on a schedule.
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)
composer testPlease see CHANGELOG for more information on what has changed recently.
Create an issue to notify us of any security vulnerabilities.
The MIT License (MIT). Please see License File for more information.