Skip to content

CLI

The @config-bound/cli package provides the configbound command — a set of tools for working with ConfigBound configurations from the terminal.

Installation

bash
npm install --save-dev @config-bound/cli

After installation, npx configbound runs the CLI. For global use:

bash
npm install --global @config-bound/cli

Commands

CommandDescription
configbound listDiscover and display all ConfigBound configurations in a directory tree
configbound exportExport a configuration schema to JSON, YAML, or .env format
configbound generate bindScaffold a new bind — embedded class or publishable package

How discovery works

list and export both use config discovery — scanning source files for ConfigBound configurations. Discovery reads the actual exports from your TypeScript files. No separate manifest or registration step is required.

export auto-selects a config when only one is found. When multiple configs exist in the same project, it prompts for selection. Pass --config and --name explicitly to skip discovery entirely.

CLI vs. library

The CLI is a companion to the library, not a replacement for it. Schema definition, validation, and value resolution all happen in code. The CLI's job is to inspect what the library produces — listing what configs exist and exporting their schemas as artifacts.