$ recombobulate _
home / tips / generate-custom-artisan-commands-with-claude
0

Generate Custom Artisan Commands with Claude

bagwaa @bagwaa · Mar 25, 2026 · Workflows
generate-custom-artisan-commands-with-claude

Custom Artisan commands are great for maintenance tasks, data imports, scheduled jobs, and one-off scripts — but the boilerplate is always the same. Let Claude write the whole thing from a description.

Describe what you need and Claude will scaffold the command with options, arguments, output, and logic:

Create an Artisan command called reports:generate that:
- Accepts a --from and --to date option
- Accepts an optional --format option (csv or json, default csv)
- Queries orders in that date range
- Writes the output to storage/reports/
- Shows a progress bar while processing
- Logs completion to the Laravel log

Claude generates a fully working command class including the signature, handle method, progress bar, validation, and storage logic:

protected $signature = 'reports:generate
    {--from= : Start date (Y-m-d)}
    {--to= : End date (Y-m-d)}
    {--format=csv : Output format (csv or json)}';

Once the command exists, ask Claude to register it in your scheduler too:

Schedule this command to run every Monday at 6am 
and email the output to admin@example.com

You can also ask Claude to write a Pest test that calls the command via $this->artisan() and asserts against the output and exit code — no manual testing required.

Stop writing the same Artisan boilerplate by hand — describe the behaviour and let Claude ship the command.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Scan Pending Changes for Security Issues with /security-review

The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.

bagwaa @bagwaa · 1 hour ago
0
Run Setup Scripts on Every Session with the SessionStart Hook

The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.

bagwaa @bagwaa · 1 hour ago
0
Write Property-Based Tests with fast-check and Claude

Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.

bagwaa @bagwaa · 2 hours ago