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.

21PHP

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 yesterday

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

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

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://www.gravatar.com/avatar/a3178f7a8af6158dc9ca3fd3b61b377cbf77f5ce63932953ecd11f4a65b5c505?d=identicon)[rutay](/maintainers/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

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

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

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

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