PHPackages                             jeffersongoncalves/laravel-zero-support - 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. jeffersongoncalves/laravel-zero-support

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

jeffersongoncalves/laravel-zero-support
=======================================

Reusable base utilities for Laravel Zero CLIs: cross-OS home/config directory resolution, opening URLs in the default browser, and secure JSON writing.

v1.0.0(today)10MITPHPPHP ^8.2CI passing

Since Jun 23Pushed today1 watchersCompare

[ Source](https://github.com/jeffersongoncalves/laravel-zero-support)[ Packagist](https://packagist.org/packages/jeffersongoncalves/laravel-zero-support)[ Docs](https://github.com/jeffersongoncalves/laravel-zero-support)[ RSS](/packages/jeffersongoncalves-laravel-zero-support/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

[![laravel-zero-support](https://raw.githubusercontent.com/jeffersongoncalves/laravel-zero-support/main/art/jeffersongoncalves-laravel-zero-support.png)](https://raw.githubusercontent.com/jeffersongoncalves/laravel-zero-support/main/art/jeffersongoncalves-laravel-zero-support.png)

laravel-zero-support
====================

[](#laravel-zero-support)

Reusable base utilities shared by [Laravel Zero](https://laravel-zero.com) CLI tools. It provides cross-OS home/config directory resolution, opening URLs in the default browser, and secure JSON file writing - the small pieces of glue every CLI ends up reimplementing.

Why
---

[](#why)

CLIs repeatedly need to: find where to store config across Windows/macOS/Linux, open a browser for an OAuth flow, and persist credentials to a JSON file with safe permissions. This package centralizes those concerns as tiny, dependency-free static helpers (only requires `php: ^8.2`).

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

[](#installation)

```
composer require jeffersongoncalves/laravel-zero-support
```

Usage
-----

[](#usage)

```
use JeffersonGoncalves\LaravelZero\Support\Os;
use JeffersonGoncalves\LaravelZero\Support\Browser;
use JeffersonGoncalves\LaravelZero\Support\Filesystem;

// Resolve directories (cross-OS)
$home   = Os::homeDir();          // e.g. /home/jeff or C:\Users\jeff
$config = Os::configDir();        // XDG_CONFIG_HOME or {home}/.config
$win    = Os::isWindows();        // bool

// Open a URL in the default browser
Browser::open('https://example.com'); // returns bool (true on success)

// Persist and read JSON safely
$path = $home.'/.my-cli/config.json';
Filesystem::writeJsonSecure($path, ['token' => 'secret']); // dir 0700, file 0600
$data = Filesystem::readJson($path);                       // array|null
```

Public classes
--------------

[](#public-classes)

ClassMethodDescription`Os``homeDir(): string`Home directory: `HOME` -&gt; `USERPROFILE` -&gt; `HOMEDRIVE`+`HOMEPATH` -&gt; `getcwd()`, trailing slashes trimmed.`Os``configDir(): string``XDG_CONFIG_HOME` if set, otherwise `homeDir().'/.config'`.`Os``isWindows(): bool`Whether `PHP_OS_FAMILY === 'Windows'`.`Browser``open(string $url): bool`Open URL in default browser (`start`/`open`/`xdg-open`).`Filesystem``writeJsonSecure(string $path, array $data): void`Create parent dir (0700), write pretty JSON, chmod 0600.`Filesystem``readJson(string $path): ?array`Decode JSON file to array, `null` if missing/invalid.License
-------

[](#license)

MIT

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance100

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/411493?v=4)[Jefferson Gonçalves](/maintainers/jeffersongoncalves)[@jeffersongoncalves](https://github.com/jeffersongoncalves)

---

Top Contributors

[![jeffersongoncalves](https://avatars.githubusercontent.com/u/411493?v=4)](https://github.com/jeffersongoncalves "jeffersongoncalves (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

clicomposerfilesystemhelpersjeffersongoncalveslaravel-zerophpsupportclifilesystembrowserlaravel-zerosupportos

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/jeffersongoncalves-laravel-zero-support/health.svg)

```
[![Health](https://phpackages.com/badges/jeffersongoncalves-laravel-zero-support/health.svg)](https://phpackages.com/packages/jeffersongoncalves-laravel-zero-support)
```

###  Alternatives

[nunomaduro/collision

Cli error handling for console/command-line PHP applications.

4.6k348.7M10.4k](/packages/nunomaduro-collision)[nunomaduro/laravel-console-menu

Laravel Console Menu is an output method for your Laravel/Laravel Zero commands.

815424.6k52](/packages/nunomaduro-laravel-console-menu)[nunomaduro/laravel-console-task

Laravel Console Task is a output method for your Laravel/Laravel Zero commands.

2592.3M13](/packages/nunomaduro-laravel-console-task)[nunomaduro/laravel-console-summary

A Beautiful Laravel Console Summary for your Laravel/Laravel Zero commands.

672.2M4](/packages/nunomaduro-laravel-console-summary)[nunomaduro/laravel-console-dusk

Laravel Console Dusk allows the usage of Laravel Dusk in Laravel/Laravel Zero artisan commands.

16357.3k8](/packages/nunomaduro-laravel-console-dusk)[mehrancodes/laravel-harbor

A CLI tool to Quickly create On-Demand preview environment for your apps.

10095.6k](/packages/mehrancodes-laravel-harbor)

PHPackages © 2026

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