PHPackages                             learningbird/lbconf - 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. learningbird/lbconf

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

learningbird/lbconf
===================

Command line utility for reading and writing JSON configuration files

2.0.1(9y ago)09.9k1MITPHP

Since Oct 13Pushed 9y ago4 watchersCompare

[ Source](https://github.com/learningbird/lbconf)[ Packagist](https://packagist.org/packages/learningbird/lbconf)[ RSS](/packages/learningbird-lbconf/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

lbconf
======

[](#lbconf)

Command line utility for reading and writing JSON configuration files

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

[](#installation)

Install using composer:

```
$ composer require learningbird/lbconf
```

Setup
-----

[](#setup)

Create an `.lbconf` meta-configuration file in your project root:

Example:

```
{
    "read": [
        "configurations/default.json"
    ],
    "write": "configurations/override.json"
}
```

File paths are relative to the location of the meta-config file.

The files in BOTH the `read` and `write` sections are read and merged, and the file in the `write` section is written to when using the `set` command.

### Dynamic Configuration

[](#dynamic-configuration)

For more dynamic configurations, an `.lbconf.php` file can be used. This file must return an array that has the same format as the `.lbconf` JSON file.

```
return [
    'read'  => glob('configurations/default/*.json),
    'write' => 'configurations/override.json',
];
```

Usage
-----

[](#usage)

The general usage pattern is:

```
lbconf   [value]
```

Where `` is one of: `-g|--get`, `-s|--set`, `-d|--del`, `-k|--keys`. If only a key is provided, the action is assumed to be `--get`, and can be omitted. If both a key and a value are provided, the action is assumed to be `--set`, and can be omitted.

Example:

```
$ lbconf --get database.host # Outputs "localhost"
$ lbconf database.host # Identical to above

$ lbconf --set database.host 127.0.0.1 # Sets database.host to  "127.0.0.1"
$ lbconf database.host 127.0.0.1 # Identical to above
```

### `-g|--get`

[](#-g--get)

Retrieve configuration values.

```
$ lbconf --get database
$ lbconf -g database # Short form
$ lbconf database # Implicit "--get" form

# Output:
# {
#     "host": "localhost,
#     "port": 3306,
#     "username": "prod-user"
# }
```

Traverse objects by passing dot-separated keys:

```
$ lbconf --get database.host # Outputs "localhost"
```

### `-s|--set`

[](#-s--set)

Set configuration values. Values will be written to the file specified by the `write` key in the `.lbconf` meta-configuration file.

```
$ lbconf --set database.username dev-user
$ lbconf -s database.username dev-user # Short form
$ lbconf database.username dev-user # Implicit "--set" form
```

Types will be inferred, unless explicitly specified:

```
$ lbconf --set database.port 3306 # Value is cast to int
$ lbconf --set database.port 3306 --type string # Value remains as string
```

### `-d|--del`

[](#-d--del)

Delete overriding configuration values:

```
$ lbconf --del database.username
$ lbconf -d database.username # Short form
```

Note that the key must exist in the `write` file for the deletion to be permitted. There is no way to delete a key that only exists in the `read` file. The only alternative is to set it to null, or some such value.

### `-k|--keys`

[](#-k--keys)

Retrieve configuration value keys:

```
$ lbconf --keys database
$ lbconf -k database # Short form

# Output:
# [
#     "host",
#     "port",
#     "username"
# ]
```

Misc
----

[](#misc)

### Keys beginning with dashes

[](#keys-beginning-with-dashes)

By default, a command argument that begins with a `-` is interpreted as an option. To avoid this behaviour, if a configuration key begins with a `-`, you can use `--` to separate the command options from the arguments:

```
$ lbconf --get -- --get # Outputs value for key "--get"
$ lbconf --set -- --key value # Sets the value for "--key" to "value"
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

3495d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/92ea9f981470ed2ad39a435ad0e5c4d7eda17484d58cd452fb727a82f50ebfcb?d=identicon)[darwish](/maintainers/darwish)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/learningbird-lbconf/health.svg)

```
[![Health](https://phpackages.com/badges/learningbird-lbconf/health.svg)](https://phpackages.com/packages/learningbird-lbconf)
```

###  Alternatives

[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[crazywhalecc/static-php-cli

Build single static PHP binary, with PHP project together, with popular extensions included.

1.8k13.9k](/packages/crazywhalecc-static-php-cli)[matthiasnoback/symfony-console-form

Use Symfony forms for Console command input

368264.8k8](/packages/matthiasnoback-symfony-console-form)[phpcr/phpcr-shell

Shell for PHPCR

721.3M8](/packages/phpcr-phpcr-shell)[madewithlove/license-checker

CLI tool to verify allowed licenses for composer dependencies

54449.8k21](/packages/madewithlove-license-checker)[statamic/cli

Statamic CLI Tool

7587.7k](/packages/statamic-cli)

PHPackages © 2026

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