PHPackages                             phel-lang/cli-skeleton - 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. phel-lang/cli-skeleton

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

phel-lang/cli-skeleton
======================

A minimalistic skeleton to build your cli-app using Phel Lang.

4853ShellCI passing

Since Jun 22Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/phel-lang/cli-skeleton)[ Packagist](https://packagist.org/packages/phel-lang/cli-skeleton)[ RSS](/packages/phel-lang-cli-skeleton/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (9)Used By (0)

Phel CLI Skeleton
=================

[](#phel-cli-skeleton)

[Phel](https://phel-lang.org/) is a functional Lisp that compiles to PHP. This is a minimal, opinionated starting point for a real **CLI application** with Phel.

It ships:

- A data-driven dispatcher on [`phel\cli`](https://phel-lang.org/) (a `symfony/console` wrapper) with sample `greet` + `add` subcommands.
- A pure **`core/` ÷ IO `commands/`** layering that stays testable as it grows ([docs/architecture.md](docs/architecture.md)).
- A pure function exported to PHP via an auto-generated wrapper.
- Fast inner loop: pre-commit gate, command scaffolder, and watch mode.

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

[](#requirements)

- PHP **&gt;= 8.4** ([phpbrew](https://github.com/phpbrew/phpbrew) on Linux, [shivammathur/homebrew-php](https://github.com/shivammathur/homebrew-php) on macOS) and [Composer](https://getcomposer.org/) — or use the bundled `build/Dockerfile` + `docker-compose.yml`.

> Tracks Phel's **`dev-main`** branch to showcase the latest idioms. Pin `phel-lang/phel-lang` to a tagged release for a production app.

Getting started
---------------

[](#getting-started)

```
composer install      # also installs the .githooks pre-commit gate
make help             # list every dev task
```

Commands
--------

[](#commands)

Every task is both a `make ` (with short aliases) and a `composer `:

TaskCommandRun from sources`composer dev [args]`Build standalone PHP`composer build` → `out/main.php`Run tests`composer test`Format`composer format`Watch (reload on save)`composer watch`REPL`composer repl`Local gate (format+lint+test)`composer check`Scaffold a command`make new-command NAME=foo````
composer dev greet alice              # positional args forward as-is
composer dev -- greet alice --loud    # put -- before flags (composer convention)
php out/main.php add 1 2 3             # run the built binary
```

Project layout
--------------

[](#project-layout)

```
src/
├── main.phel        ; wires the Application + dispatches
├── core/            ; PURE logic — no IO (greeting, adder; adder exported to PHP)
├── commands/        ; IO boundary: parse args, print, exit (greet, add)
└── PhelGenerated/   ; auto-generated PHP wrappers
tests/
├── core/            ; pure unit tests (no CLI harness)
└── commands/        ; CLI handler smoke tests
docs/                ; architecture.md (layering), conventions.md (idioms)
bin/new-command      ; scaffold a command across both layers
example/             ; call an exported Phel fn from PHP
phel-config.php      ; build / export / format config
.githooks/pre-commit ; auto-installed gate (composer check)

```

Adding a command
----------------

[](#adding-a-command)

```
make new-command NAME=foo     # generates core + command + both tests
```

Then fill in the logic and **register it in `src/main.phel`** — add the `:require` and put `foo-command` in the `:commands` vector (the scaffolder prints the exact lines). Keep commands thin; put real logic in `core/`. See [docs/architecture.md](docs/architecture.md).

Exporting Phel to PHP
---------------------

[](#exporting-phel-to-php)

Mark a `core/` function `{:export true}` (see `src/core/adder.phel`), then:

```
composer export    # regenerates src/PhelGenerated/**
php example/using-exported-phel-function.php
```

AI agent config (optional)
--------------------------

[](#ai-agent-config-optional)

Conventions are authored once as agnostic specs under `.agnostic-ai/rules/` and transpiled per tool with [agnostic-ai](https://github.com/chemaclass/agnostic-ai)(`agnostic-ai sync`). The emitted `.claude/`, `AGENTS.md` are git-ignored — edit the specs, not the output. `vendor/bin/phel agent-install --auto` adds Phel's built-in idiom skills.

Docker
------

[](#docker)

```
docker compose up -d --build
docker exec -ti -u dev phel_cli_skeleton bash
composer install
```

More
----

[](#more)

- [docs/architecture.md](docs/architecture.md) — the core/commands layering rule
- [docs/conventions.md](docs/conventions.md) — Phel idioms, naming, gotchas
- Phel docs:
- `phel\cli` guide: `vendor/phel-lang/phel-lang/docs/cli-guide.md`

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance61

Regular maintenance activity

Popularity17

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 88.5% 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/3d166420c6770c5941e10bd68b2d26501eabb432e280d8e6eba0a344bcc1e5ae?d=identicon)[Chemaclass](/maintainers/Chemaclass)

![](https://www.gravatar.com/avatar/95f5516d8a75725d151587359acd6914d0d35fc1b874334347ee80d726b291de?d=identicon)[jenshaase](/maintainers/jenshaase)

---

Top Contributors

[![Chemaclass](https://avatars.githubusercontent.com/u/5256287?v=4)](https://github.com/Chemaclass "Chemaclass (54 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![geoffreyvanwyk](https://avatars.githubusercontent.com/u/194185?v=4)](https://github.com/geoffreyvanwyk "geoffreyvanwyk (2 commits)")[![JesusValeraDev](https://avatars.githubusercontent.com/u/6381924?v=4)](https://github.com/JesusValeraDev "JesusValeraDev (1 commits)")[![WilsonSant](https://avatars.githubusercontent.com/u/87999151?v=4)](https://github.com/WilsonSant "WilsonSant (1 commits)")

---

Tags

cli-scaffoldingfunctional-programmingphelphel-langphp

### Embed Badge

![Health badge](/badges/phel-lang-cli-skeleton/health.svg)

```
[![Health](https://phpackages.com/badges/phel-lang-cli-skeleton/health.svg)](https://phpackages.com/packages/phel-lang-cli-skeleton)
```

###  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)
