Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laragenie Laravel Package

joshembling/laragenie

Laragenie is an AI-powered CLI assistant for Laravel. Index your codebase with embeddings, chat from the terminal, ask natural-language questions about your project, and get context-aware answers or code suggestions using OpenAI.

View on GitHub
Deep Wiki
Context7

Getting Started

laragenie is an Artisan-driven AI chat assistant that lives inside your Laravel app, so the fastest way to understand it is to install it into a real project and ask it something you'd otherwise grep for.

  1. Install the package: composer require joshembling/laragenie --dev (keep it in require-dev — it's a developer tool, not a runtime dependency).
  2. Put your provider key in .env (OPENAI_API_KEY=... by default) before running anything.
  3. Run php artisan laragenie. On first run the package walks you through an interactive install/question flow and publishes config/laragenie.php.
  4. Read that config file immediately — it's the single source of truth for model, temperature, streaming, and which parts of your codebase get sent as context.
  5. First use case: open a chat and ask a codebase question you already know the answer to ("where is the Order model's status column defined?"). You're calibrating what context it actually sees, not testing its intelligence.

Check php artisan laragenie --help for the current flags (history clearing, output saving) rather than relying on blog posts — options have shifted across 1.x releases.

Implementation Patterns

Treat the config file as project infrastructure. config/laragenie.php controls model, temperature, streaming and the context/exclusion lists. Commit a shared version of it (minus secrets) so every developer gets the same model and the same view of the codebase. Model choice in particular is a team decision, not a personal one — inconsistent models produce inconsistent code review conversations.

Generate-then-review, not generate-then-commit. The productive loop is: ask laragenie for a migration/action/test, paste it into the file yourself, run the test suite, then iterate in the same chat session. Use php artisan make:* for scaffolding you can produce deterministically and reserve the assistant for the parts that actually need judgement.

Scope context per question, not per project. Point the context at the directories relevant to the task (a single domain folder, a service class) instead of the whole app. Smaller context means cheaper requests, faster responses, and less chance the model latches onto an unrelated pattern from a legacy module.

Clear history between topics. Long chat sessions accumulate stale assumptions ("we're using repositories") that silently corrupt later answers. Start a fresh session when you switch from, say, billing to auth.

Pair with tests as the contract. Ask for behaviour ("a test asserting a refund over 30 days is rejected"), let it produce the Pest/PHPUnit file, then let the test — not the model — decide whether the subsequent implementation is correct.

Use it as an exploration aid on unfamiliar code. New joiners get more value from "explain what this middleware does and who registers it" than from "write me a CRUD controller", because the failure mode is recoverable.

Gotchas and Tips

  • Your code leaves the machine. Context files and your questions go to a third-party API. Audit the exclusion list in config/laragenie.php before the first run in a client repo, and make sure .env, credentials, and proprietary vendor code aren't in the context paths.
  • Config caching bites. If you run php artisan config:cache in local dev (some teams do via a deploy script), edits to laragenie.php won't take effect. php artisan config:clear first when a config change appears ignored.
  • Streaming fails in non-interactive contexts. Streamed output is a TTY feature; running the command in CI, a scheduler, or piped into another program will behave badly. Don't wire it into build scripts.
  • Errors are usually provider-side. 401 → key not loaded (env or config cache). 429 → rate limit, back off. "Model does not exist" → the configured model string isn't available to your account. Check these before assuming a package bug.
  • Watch token costs. Whole-repo context plus a long history quietly runs up the bill. Keep context narrow, clear history, and prefer a cheaper model for exploration.
  • Hallucinated Laravel is the default failure mode. Generated code frequently targets APIs from a different major version. Always cross-check against the installed framework, and never accept a facade/method you can't find in vendor/ or the docs.
  • Setup flow quirks. The interactive installer asks a sequence of questions and branches on your answers; v1.2.2 reordered conditions in Questions.php to fix a mis-branching path. If you previously got stuck or got the wrong config generated during install, delete the published config and rerun php artisan laragenie on 1.2.2+ rather than hand-patching.
  • Extension point is the config file, not the code. Tune model, temperature, streaming and context there. Forking the command is a last resort and will cost you on every upgrade.
  • Pin the version in composer.json. 1.x has moved quickly; a floating constraint can change default model or prompt behaviour under you mid-sprint.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo