PHPackages                             rutay/laravel-ccmd - 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. rutay/laravel-ccmd

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

rutay/laravel-ccmd
==================

ccmd is a Laravel package that provides a less verbose way to define and schedule commands.

22PHP

Since Apr 12Pushed 5y ago1 watchersCompare

[ Source](https://github.com/rutay/laravel-ccmd)[ Packagist](https://packagist.org/packages/rutay/laravel-ccmd)[ RSS](/packages/rutay-laravel-ccmd/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

laravel-ccmd
============

[](#laravel-ccmd)

The CCMD (Commented CoMmanD) package is a Laravel extension that permits you to write and schedule commands easier.

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

[](#installation)

`composer require rutay/laravel-ccmd`

Usage
-----

[](#usage)

#### Definition

[](#definition)

A CCMD (= a command defined through this package), can be defined like this:

```
// App\SomeClass.php

/**
 * @command
 *
 * @signature   your_app:greet {person}
 * @description A simple command that greets a person.
 *
 * @repeat      '*\5 * * * *'
 */
function helloWorld(Command $command) // The argument $person could even be injected through function parameters.
{
    $person = $command->argument('person');

    // ...
}
```

With the following rules:

- `@command` and `@signature` must be defined (the other fields are optional).
- `@repeat` could be any valid PHP string (it's resolved using `eval()`). If using a cron expression, remember to provide ''.
- In cron expressions, you can't use `*/` since it would close the comment. You can use `*\` instead.
- The command function can have any name.
- The parameters of the command function function are resolved with this sequence:
    - Type-hint is a `Illuminate\Console\Command`, then is fed with the current (auto-generated) Laravel command.
    - Type-hint could be resolved through the Laravel's ServiceContainer.
    - Parameter's name matches a Command's argument or option.
    - Invalid function prototype definition.

#### Subscription

[](#subscription)

Like you would do with any other Laravel command, you need to register CCMDs in `App\Console\Kernel.php`.

I suggest the following approach:

```
protected $ccmds = [ // Fill this array with classes that have CCMDs.
    SomeClass::class,
    // ...
];

protected function commands()
{
    (new CCMDLoader())->load($this->ccmds); // There it creates the Laravel's commands.
    // ...
}

protected function schedule(Schedule $schedule)
{
    (new CCMDLoader())->schedule($this->ccmds, $schedule); // There it creates the schedules that call the Laravel's commands.
    // ...
}
```

Why
---

[](#why)

The necessity of writing this package came up when I needed to develop a platform that had to handle multiple tasks. For each of these tasks, I wanted to create a command for it (that's useful also for testing) and a it also had to be schedule through cron.

So I found myself writing the same redundant code too many times:

```
// App\Platform.php

function executeTask1() { /* ... */ }
function executeTask2() { /* ... */ }
function executeTask3() { /* ... */ }

// App\Console\Kernel.php

Artisan::command("platform:task1", function (Platform $platform) {
    $platform->executeTask1();
})->purpose("desc1");

Artisan::command("platform:task2", function (Platform $platform) {
    $platform->executeTask2();
})->purpose("desc2");

Artisan::command("platform:task3", function (Platform $platform) {
    $platform->executeTask3();
})->purpose("desc3");

$schedule->command("platform:task1")->cron('*/5 * * * *');
$schedule->command("platform:task2")->cron('*/6 * * * *');
$schedule->command("platform:task3")->cron('*/7 * * * *');
```

Thanks to this system, now I'm able to solve this issue like this:

```
/**
 * @command
 *
 * @signature   platform:task1
 * @description desc1
 *
 * @repeat      '*\5 * * * *'
 */
function executeTask1() { /* ... */ }

/**
 * @command
 *
 * @signature   platform:task2
 * @description desc2
 *
 * @repeat      '*\6 * * * *'
 */
function executeTask2() { /* ... */ }

/**
 * @command
 *
 * @signature   platform:task3
 * @description desc3
 *
 * @repeat      '*\7 * * * *'
 */
function executeTask3() { /* ... */ }
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

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://avatars.githubusercontent.com/u/178413912?v=4)[rutay](/maintainers/rutay)[@Rutay](https://github.com/Rutay)

---

Top Contributors

[![loryruta](https://avatars.githubusercontent.com/u/24776968?v=4)](https://github.com/loryruta "loryruta (10 commits)")

---

Tags

laravellaravel-package

### Embed Badge

![Health badge](/badges/rutay-laravel-ccmd/health.svg)

```
[![Health](https://phpackages.com/badges/rutay-laravel-ccmd/health.svg)](https://phpackages.com/packages/rutay-laravel-ccmd)
```

###  Alternatives

[illuminate/console

The Illuminate Console package.

13046.0M6.5k](/packages/illuminate-console)[styleci/cli

The CLI tool for StyleCI

71470.5k9](/packages/styleci-cli)[winbox/args

Windows command-line formatter

20720.9k21](/packages/winbox-args)[tomatophp/filament-artisan

Simple but yet powerful library for running some artisan commands for FilamentPHP

3275.4k1](/packages/tomatophp-filament-artisan)

PHPackages © 2026

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