fjall-cli 1.0.1

CLI for Fjall database
Documentation
<!-- DO NOT EDIT -->
<!-- This file is automatically generated by README.ts. -->
<!-- Edit README.ts if you want to make changes. -->

# CLI for Fjall database

[![Build](https://github.com/DenisGorbachev/fjall-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/DenisGorbachev/fjall-cli)
[![Documentation](https://docs.rs/fjall-cli/badge.svg)](https://docs.rs/fjall-cli)

<!-- crate documentation start -->
## Command

The command requires `--db <PATH>` or `FJALL_DB`.

## Subcommands

* `keyspace <KEYSPACE> <SUBCOMMAND>` runs keyspace-scoped operations:
  `iter`, `get`, `insert`, `contains`, `len`, `clear`, `delete`.
* `list-keyspace-names` lists keyspace names (one per line).
* `keyspace-count` prints the number of keyspaces.

Exit codes for `keyspace <KEYSPACE> contains <KEY>`:

* `0` - key exists
* `1` - error occurred
* `127` - key does not exist

## Byte encodings

Commands that accept key/value bytes support `--*-encoding` with:

* `string` (default)
* `hex`
* `path`
* `empty` (argument must be exactly `-`)

## Example

```bash
DB_DIR="$(mktemp -d)"
export FJALL_DB="$DB_DIR"

fjall keyspace items insert key value
fjall keyspace items len
# 1

fjall keyspace-count
# 1

fjall keyspace items contains key
# exit code: 0
fjall keyspace items contains missing
# exit code: 127

fjall keyspace items get key
# value

fjall keyspace items iter --key-suffix ":" --value-suffix $'\n'
# key:value

fjall list-keyspace-names
# items

fjall keyspace items clear
fjall keyspace items len
# 0

fjall keyspace items delete
fjall keyspace-count
# 0
```
<!-- crate documentation end -->

## Installation

Install as executable:

```shell
cargo install --locked fjall-cli
```

Install as library dependency in your package:

```shell
cargo add fjall-cli
```

## Usage

```shell
CLI for Fjall database

Usage: fjall --db <DB> <COMMAND>

Commands:
  keyspace             
  list-keyspace-names  
  keyspace-count       
  help                 Print this message or the help of the given subcommand(s)

Options:
      --db <DB>  [env: FJALL_DB=]
  -h, --help     Print help
  -V, --version  Print version
```

## Gratitude

Like the project? [⭐ Star this repo](https://github.com/DenisGorbachev/fjall-cli) on GitHub!

## License

[Apache-2.0](LICENSE-APACHE) or [MIT](LICENSE-MIT).

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, shall be licensed as above, without any additional terms or conditions.