# obj-cli
> Command-line inspector and operator tools for the `obj` database.
[](https://crates.io/crates/obj-cli)
Part of [`obj`](https://github.com/uname-n/obj) — the embedded document
database. A thin, read-only wrapper over the public `obj-db` API for
inspecting and operating `.obj` files from a terminal.
Crate name `obj-cli`; installs the `obj` binary.
---
## Install
```bash
cargo install obj-cli
```
---
## Commands
```bash
obj check <file> # full bidirectional integrity check
obj stat <file> # header info, page counts, per-collection stats
obj dump <file> --collection <name> # walk a collection's primary tree, one record per line
obj backup <src> <dest> # hot backup; writers continue uninterrupted
```
| `check` | Run the full integrity check and report success / failure. |
| `stat` | Print a structured summary: header, page counts, per-collection stats. |
| `dump` | Print records from a collection's primary B-tree (no schema decode). |
| `backup` | Take a hot backup to a new file while writers continue against the source. |
`dump` accepts `--limit <n>` (`0` = unbounded, default `20`) and
`--format header|hex` (`hex` appends the raw payload bytes). The dump is
type-erased — it prints the per-document header and raw payload, not
schema-aware decoded values, since the CLI has no knowledge of
user-defined `Document` types.
Exit codes: `0` success · `1` operation failure · `3` argument error.
---
## License
Dual-licensed under [MIT](https://github.com/uname-n/obj/blob/master/LICENSE-MIT)
or [Apache 2.0](https://github.com/uname-n/obj/blob/master/LICENSE-APACHE),
at your option.