PHPackages                             ultraviolettes/hive-cli-agent-for-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. ultraviolettes/hive-cli-agent-for-laravel

ActiveProject[CLI &amp; Console](/categories/cli)

ultraviolettes/hive-cli-agent-for-laravel
=========================================

Laravel agent orchestration CLI — turns GitHub backlogs and Nightwatch exceptions into parallel Claude Code agents.

001[1 PRs](https://github.com/ultraviolettes/hive-cli-agent-for-laravel/pulls)PHP

Since Mar 24Pushed 3w agoCompare

[ Source](https://github.com/ultraviolettes/hive-cli-agent-for-laravel)[ Packagist](https://packagist.org/packages/ultraviolettes/hive-cli-agent-for-laravel)[ RSS](/packages/ultraviolettes-hive-cli-agent-for-laravel/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

🐝 Hive
======

[](#-hive)

> The Laravel agent orchestration CLI.
> `hive plan` turns your GitHub backlog into parallel Claude Code agents.
> `hive fix` turns your Nightwatch exceptions into pull requests.

[![Hive CLI demo](demo.gif)](demo.gif)

Hive is a **Laravel Zero** CLI that reads your GitHub issues or Nightwatch exceptions, analyzes task dependencies with AI, and spawns parallel [Claude Code](https://docs.anthropic.com/en/docs/claude-code) agents — each in its own git worktree with a task-specific `CLAUDE.md`.

Why Hive?
---------

[](#why-hive)

Tools like [Polyscope](https://getpolyscope.com) (by BeyondCode) and [Superset](https://superset.sh) are excellent at running parallel agents. Polyscope in particular is deeply integrated with the Laravel ecosystem — Nightwatch, GitHub, autopilot mode. If you don't use it, you should try it.

Hive is a different kind of tool. It's not an app — it's a CLI that fits into any workflow.

**The key difference: hierarchical task planning.**

Hive reads your existing issues or exceptions and reasons about their dependencies before spawning anything:

- *"This feature depends on that security patch — spawn the patch first, block the feature until it's done."*
- *"These 4 bug fixes are independent — spawn them all in parallel right now."*
- *"This Nightwatch exception happens in `UserController:42` with 150 occurrences — inject the exact stacktrace as context for the fix agent."*

```
# Analyzes dependencies, builds a DAG, spawns in the right order
hive plan --github owner/repo --milestone "Sprint 4"

# Fetches unresolved exceptions, sorts by impact, spawns fix agents
hive fix --nightwatch
```

Because it's a CLI, it works with Polyscope, Superset, your terminal, or anything else.

How it works
------------

[](#how-it-works)

```
GitHub Issues / Nightwatch Exceptions
            │
            ▼
    QueenBee (DagAnalyzer)
    Analyzes dependencies → builds execution DAG
    Priority: security (100) > bugs (60) > features (30)
            │
            ▼
    Ready tasks spawned in parallel
    Blocked tasks wait for their dependencies
            │
            ▼
    Each worktree gets a CLAUDE.md with:
      · Task description & context
      · Stack info (Filament, Pest, Livewire…)
      · TDD instructions if Pest detected
      · Exact stacktrace if from Nightwatch
      · Conventional commit prefix

```

Requirements
------------

[](#requirements)

- PHP 8.2+
- [gh CLI](https://cli.github.com/) — for GitHub issues ingestion
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) — to run agents in worktrees (also used headlessly for DAG analysis)
- `ANTHROPIC_API_KEY` in your Laravel project's `.env` — only needed if Claude Code CLI is not installed

Installation
------------

[](#installation)

```
composer global require ultraviolettes/hive-cli-agent-for-laravel
```

Or clone and build locally:

```
git clone https://github.com/ultraviolettes/hive-cli-agent-for-laravel.git
cd hive-cli-agent-for-laravel
composer install
php hive app:build hive
# → builds/hive (standalone PHAR)
```

Quick start
-----------

[](#quick-start)

```
cd ~/your-laravel-project

# 1. Initialize Hive (detects your stack automatically)
hive init

# 2. Plan from GitHub issues
hive plan --github owner/repo
hive plan --github owner/repo --milestone "Sprint 4"

# 3. Or fix Nightwatch exceptions
hive fix --nightwatch

# 4. Or spawn a single agent manually
hive spawn feat/my-feature --context "Build the admin dashboard"

# 5. Check what's running
hive status

# 6. Commit, push and open a PR from a worktree
hive pr

# 7. Clean up after merge
hive harvest feat/my-feature
```

Commands
--------

[](#commands)

### `hive init`

[](#hive-init)

Detects your Laravel stack (Filament, Pest, Nightwatch, Vite, Livewire, Horizon, Inertia) and creates a `.hive.json` config file.

```
hive init
hive init --path /path/to/project
```

### `hive plan`

[](#hive-plan)

Reads a backlog (GitHub issues or raw text), builds a dependency graph, displays the execution plan, and spawns agents for all ready tasks.

```
hive plan --github owner/repo
hive plan --github owner/repo --milestone "Sprint 4"
hive plan --text "Fix the login bug, then add dark mode, then refactor auth"
hive plan --github owner/repo --dry-run   # preview without spawning
```

**The DAG in practice:**

\#BranchPriorityStatusDepends on1fix/composer-cve100🟡 ready—2fix/npm-audit100🟡 ready—3chore/laravel-update70🔒 blocked\#1, #24feat/filament-v530🔒 blocked\#3Tasks 1 and 2 spawn immediately in parallel. Tasks 3 and 4 wait.

### `hive fix --nightwatch`

[](#hive-fix---nightwatch)

Fetches unresolved exceptions from [Laravel Nightwatch](https://nightwatch.laravel.com), sorts by impact (occurrences), and spawns fix agents with the exact stacktrace injected as context.

```
hive fix --nightwatch
hive fix --nightwatch --limit 5
hive fix --nightwatch --dry-run
```

Requires `NIGHTWATCH_TOKEN` and `NIGHTWATCH_PROJECT_ID` in your `.env`.

### `hive spawn`

[](#hive-spawn)

Spawns a single agent in an isolated git worktree.

```
hive spawn feat/my-feature
hive spawn fix/login-bug --context "Users can't login when 2FA is enabled"
```

### `hive pr`

[](#hive-pr)

From inside a worktree — commits staged changes, pushes, and opens a PR via `gh`.

```
hive pr         # current worktree
hive pr --all   # all worktrees with unpushed commits
```

### `hive status`

[](#hive-status)

Lists all active Hive worktrees with branch, last commit, and whether an agent is running.

### `hive harvest`

[](#hive-harvest)

Removes a worktree after the branch has been merged.

Configuration
-------------

[](#configuration)

`.hive.json` created by `hive init` at your Laravel project root:

```
{
    "project": "my-app",
    "stack": ["laravel", "filament", "pest", "nightwatch", "vite"],
    "main_branch": "main",
    "worktrees_path": ".hive/worktrees"
}
```

Environment variables (in your Laravel project's `.env`):

VariableRequired forNotes`ANTHROPIC_API_KEY``plan`, `fix`Not needed if Claude Code CLI is installed`NIGHTWATCH_TOKEN``fix --nightwatch`Nightwatch API token`NIGHTWATCH_PROJECT_ID``fix --nightwatch`Nightwatch project IDArchitecture
------------

[](#architecture)

```
app/
├── Ai/Agents/
│   └── DagAnalyzerAgent.php        — laravel/ai structured output (fallback)
├── Commands/
│   ├── InitCommand.php             — hive init
│   ├── PlanCommand.php             — hive plan
│   ├── FixCommand.php              — hive fix
│   ├── SpawnCommand.php            — hive spawn
│   ├── HarvestCommand.php          — hive harvest
│   ├── StatusCommand.php           — hive status
│   └── PrCommand.php               — hive pr
├── Services/
│   ├── ClaudeCodeGateway.php       — runs `claude -p` headless, parses JSON output
│   ├── DagAnalyzer.php             — ClaudeCode first, laravel/ai fallback
│   ├── HiveDetector.php            — auto-detects Laravel stack
│   ├── WorktreeManager.php         — git worktree spawn/harvest/list
│   ├── WorktreeInspector.php       — reads worktree state
│   ├── ContextBuilder.php          — generates CLAUDE.md per task
│   ├── GithubIngester.php          — fetches issues via gh CLI
│   └── NightwatchIngester.php      — fetches exceptions via API
└── Support/
    └── HiveConfig.php              — reads/writes .hive.json

```

Testing
-------

[](#testing)

```
./vendor/bin/pest
```

Built with
----------

[](#built-with)

- [Laravel Zero](https://laravel-zero.com/) — CLI framework
- [Laravel AI SDK](https://laravel.com/docs/12.x/ai-sdk) — structured output agent
- [Laravel Prompts](https://laravel.com/docs/12.x/prompts) — terminal UX
- [Pest](https://pestphp.com/) — testing

Status
------

[](#status)

🚧 Early — looking for contributors and real-world testers.

See [CONTRIBUTING.md](CONTRIBUTING.md) for the roadmap and how to help.

License
-------

[](#license)

MIT

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance62

Regular maintenance activity

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4ed5d217c20a17da672cb04aaf87c033ff7e35af79e3c5a6e1ac818eb163a924?d=identicon)[croustibat](/maintainers/croustibat)

---

Top Contributors

[![croustibat](https://avatars.githubusercontent.com/u/1169456?v=4)](https://github.com/croustibat "croustibat (16 commits)")

### Embed Badge

![Health badge](/badges/ultraviolettes-hive-cli-agent-for-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/ultraviolettes-hive-cli-agent-for-laravel/health.svg)](https://phpackages.com/packages/ultraviolettes-hive-cli-agent-for-laravel)
```

###  Alternatives

[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24726.4M22](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

13045.3M6.2k](/packages/illuminate-console)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
