# @dotbox/cli

> A simple, easily readable configuration language.

Latest version **1.0.2** (published 2022-05-01) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @dotbox/cli
pnpm add @dotbox/cli
yarn add @dotbox/cli
bun add @dotbox/cli
```

Provides the command `dotbox`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-05-01 |
| First published | 2022-04-30 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 22.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Jake Hamilton |
| Maintainers | jakehamilton |
| Keywords | box, config, language, json, compiler |

## Links

- npm: https://www.npmjs.com/package/@dotbox/cli
- Repository: https://github.com/jakehamilton/dotbox
- Issues: https://github.com/jakehamilton/dotbox/issues
- npm.io page: https://npm.io/package/@dotbox/cli

## Dependencies (5)

- [arg](https://npm.io/package/arg.md) ^5.0.1
- [kleur](https://npm.io/package/kleur.md) ^4.1.4
- [@dotbox/format](https://npm.io/package/@dotbox/format.md) 1.0.2
- [@dotbox/compiler](https://npm.io/package/@dotbox/compiler.md) 1.0.2
- [@littlethings/log](https://npm.io/package/@littlethings/log.md) ^3.0.3

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.2 (latest) — 2022-05-01
- 1.0.1 — 2022-04-30
- 1.0.0 — 2022-04-30

## README

# @dotbox/cli

> A tool for compiling and formatting DotBox files.

## Installation

```bash
# Using npm.
npm install --global @dotbox/cli

# Using yarn.
yarn add --global @dotbox/cli

# Or run directly with npx.
npx @dotbox/cli
```

## Usage

```bash
# Print the help message
dotbox --help
```

```
DESCRIPTION

    A tool for compiling and formatting DotBox files.

USAGE

    $ dotbox <command> [options]

COMMANDS

    fmt, format               Format one or more files
    cmp, compile              Compile a file to JSON

OPTIONS

    --help, -h                Show this help message
    --verbose, -v             Set logging verbosity

EXAMPLE

    $ # Get help for commands.
    $ dotbox format --help
    $ dotbox compile --help

    $ # Run DotBox with verbose logging.
    $ dotbox -v
    $ dotbox -vv

    $ # Run DotBox with no logging.
    $ LOG_LEVEL=SILENT dotbox

    $ # Run DotBox with timestamps.
    $ LOG_TIMESTAMP=TRUE dotbox

    $ # Filter logs from DotBox (based on log prefix).
    $ DEBUG="^some-regex$" dotbox
```

## Logging

DotBox makes use of [@littlethings/log](https://npm.im/@littlethings/log)
to implement its logging functionality. `@littlethings/log`
which can be configured with environment variables like `DEBUG`
to modify how DotBox logs things.

## Formatting

DotBox comes with a formatter to keep your code easily readable.

```bash
# For help with the `format` command.
dotbox format --help
```

```
DESCRIPTION

    Format DotBox files.

USAGE

    $ dotbox format [options] <files>

OPTIONS

    --help, -h                Show this help message

EXAMPLE

    $ # Format a single file.
    $ dotbox format ./my.box

    $ # Format multiple files.
    $ dotbox format ./my.box ./my_other.box
```

## Compiling

DotBox can compile a `.box` file to `.json`.

```bash
# For help with the `compile` command.
dotbox compile --help
```

```
DESCRIPTION

    Compile DotBox files to JSON.

USAGE

    $ dotbox compile <file> [options]

OPTIONS

    --help, -h                Show this help message
    --output, -o              Write the resulting JSON to a file

EXAMPLE

    $ # Compile a file and print the resulting JSON.
    $ dotbox compile ./my.box

    $ # Compile a file and write the resulting JSON to a file.
    $ dotbox compile ./my.box --output ./my.json
```

---
_Source: https://npm.io/package/@dotbox/cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
