config-forge 0.6.0

A CLI tool for converting, inspecting, and validating configuration files.
Documentation
# ConfigForge

ConfigForge is a Rust CLI tool for converting, inspecting, validating, querying, and safely editing configuration files.

Current format support:

- JSON
- JSON5 input
- TOML
- YAML
- `.env`
- INI
- Java `.properties`

## Install

```bash
cargo install config-forge
```

## Usage

```bash
config-forge --help
config-forge inspect Cargo.toml
config-forge convert app.toml -o app.yaml
config-forge convert app.yaml --to json
config-forge convert app.json5 --to json
config-forge convert .env --to json
config-forge convert app.ini --to yaml
config-forge convert app.properties --to json
config-forge convert app.toml --to yaml --check
config-forge validate app.yaml
config-forge validate app.yaml --schema schema.json
config-forge get app.toml server.port
config-forge get app.yaml items.0.name
config-forge get app.ini server.host
config-forge get app.toml server --to yaml
config-forge set app.yaml server.host prod -o app.updated.yaml
config-forge set app.ini server.host prod -o app.updated.ini
config-forge set app.json server.port 9090 --value-format json -o app.updated.json
config-forge delete app.yaml server.debug -o app.updated.yaml
config-forge merge base.yaml override.yaml -o merged.yaml
config-forge diff old.toml new.toml
```

When writing converted content to stdout, pass `--to` so the output format is explicit:

```bash
config-forge convert app.toml --to json
```

JSON5 is currently supported as an input format. Writing JSON5 is intentionally
not enabled yet because comments and relaxed syntax are not preserved by the
shared configuration value model.

ConfigForge does not overwrite existing output files by default. Pass `--overwrite` when replacing a file is intentional:

```bash
config-forge convert app.toml -o app.yaml --overwrite
```

`get` reads values by dot path. Numeric path segments index arrays:

```bash
config-forge get app.yaml server.port
config-forge get app.yaml items.0.name
```

`set` and `delete` update existing paths only and require an output file. They do not modify the input file in place:

```bash
config-forge set app.yaml server.host prod -o app.updated.yaml
config-forge set app.json server.port 9090 --value-format json -o app.updated.json
config-forge delete app.yaml items.0 -o app.updated.yaml
```

By default, `set` treats the replacement as a string. Pass `--value-format json` for numbers, booleans, arrays, objects, or null.

`merge` recursively combines object values. Override scalar values and arrays replace the base value:

```bash
config-forge merge base.yaml override.yaml -o merged.yaml
config-forge merge base.yaml override.json -o merged.toml --to toml
```

`diff` prints path-oriented changes:

```bash
config-forge diff old.yaml new.yaml
```

Example output:

```text
changed server.port
removed server.debug
added server.timeout
```

Key-value formats are intentionally conservative:

- `.env` reads top-level `KEY=value` pairs and writes only top-level string values.
- INI maps sections to objects, such as `[server]` to `server.*`.
- `.properties` expands and flattens dotted keys, such as `server.host`.
- Values read from `.env`, INI, and `.properties` remain strings; ConfigForge does not infer booleans or numbers for these formats.

Schema validation uses local JSON Schema files:

```bash
config-forge validate app.yaml --schema schema.json
config-forge validate app.json5 --schema schema.json
```

The schema file itself must be JSON. Remote and file reference resolution is not
enabled in this build, so validation does not fetch external `$ref` targets.

## Package Check

Before publishing a release build:

```bash
cargo publish -p config-forge --dry-run
```

Release tags use this format:

```bash
git tag config-forge-v0.6.0
git push <remote> config-forge-v0.6.0
```