consulx โ Consul KV CLI + Rust Client Library

consulx is a modern Rust toolkit for working with Consul KV, providing:
- ๐ง Interactive REPL (like redis-cli, but for Consul)
- ๐๏ธ Tree view, watch, prefix watch, edit, get-json, put-json
- โ๏ธ Lightweight HTTP-only Consul client (no SDKs)
- ๐ Integrations for Actix and Axum
- ๐ First-class support for dynamic config & feature flags
- ๐งฉ Typed JSON prefix loading (
kv_list_json)
Everything is implemented from scratch using reqwest.
โจ Features
๐งต REPL Interface
- Auto-completion (reedline)
- Commands: get, put, del, list, tree, get-json, put-json, edit, watch, watch-prefix
๐๏ธ JSON-aware KV APIs
- kv_get_json โ load typed JSON config
- kv_put_json โ write typed JSON
- kv_list_json โ load multiple JSON configs under a prefix
๐ Watches
- Watch individual keys
- Watch entire prefixes
- Efficient blocking queries (index + wait)
๐ Actix & Axum Integrations
Drop ConsulXClient into your application state.
โก Pure HTTP client
No consulrs. No SDK. No hidden magic.
๐ Installation
[]
= "0.1.0"
= { = "1", = ["full"] }
= { = "0.12", = ["rustls-tls", "json"] }
= { = "1", = ["derive"] }
= "1"
๐ง CLI Usage
Specify endpoint:
CONSUL_HTTP_ADDR=http://127.0.0.1:8500
๐ฅ๏ธ REPL Commands
| Command | Description |
|---|---|
| get | Fetch raw value |
| put | Store value |
| del | Delete key |
| list | List keys |
| tree | ASCII tree |
| get-json | Pretty JSON |
| put-json | Validate + store |
| edit | Edit in $EDITOR |
| watch | Watch key |
| watch-prefix | Watch prefix |
| help | Help |
| exit | Quit |
๐งฉ JSON Prefix Loading (kv_list_json)
let flags = consul..await?;
for in flags
๐ฆ Library API Summary
new
from_env
kv_get_raw
kv_put
kv_delete
kv_list
kv_watch
kv_watch_prefix
Made with โค๏ธ by the [Srotas Space] (https://srotas.space/open-source)
๐ฅ Contributors
- Snm Maurya - Creator & Lead Developer LinkedIn
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.