Problem
The CLI (src/cli/mod.rs) has 14 subcommands but is missing support for features recently added to the REST API and engine:
| Feature |
REST API |
CLI? |
| TTL |
GET/PATCH /keys/{key}/ttl |
❌ |
| Transactions |
POST /txn + /commit /rollback |
❌ |
| Secondary Indexes |
POST /keys/{key}/index/{field}, GET /keys/by-index |
❌ |
| Value Search |
GET /keys/value-search |
❌ |
| Key Search Modes |
GET /keys/search?mode=contains|regex |
❌ |
| Batch Delete |
POST /keys/batch/delete |
❌ |
| Prefix Delete |
DELETE /keys?prefix= |
❌ |
| Notes CRUD |
Via API only |
❌ |
Request
Add the following CLI subcommands:
TTL
ttl set <key> <ttl_secs> — set or update TTL on existing key (calls PATCH /keys/{key}/ttl)
ttl get <key> — get remaining TTL (calls GET /keys/{key}/ttl)
set <key> <value> [--ttl <secs>] — extend existing set command with optional --ttl flag
Transactions
txn begin — begin transaction, prints txn_id
txn put <txn_id> <key> <value> — stage write
txn delete <txn_id> <key> — stage delete
txn commit <txn_id> — commit
txn rollback <txn_id> — rollback
Indexes
index create <field> — create secondary index on JSON field
index query <field> <value> — query by index
index list — list all indexes
Search
search <query> [--mode prefix|contains|regex] [--limit N] — extend existing search with mode flag
value-search <query> — search by value content
Batch/Prefix operations
batch-delete <key1> [<key2> ...] — delete specific keys
delete-prefix <prefix> — delete all keys matching prefix
Acceptance criteria
Problem
The CLI (
src/cli/mod.rs) has 14 subcommands but is missing support for features recently added to the REST API and engine:Request
Add the following CLI subcommands:
TTL
ttl set <key> <ttl_secs>— set or update TTL on existing key (callsPATCH /keys/{key}/ttl)ttl get <key>— get remaining TTL (callsGET /keys/{key}/ttl)set <key> <value> [--ttl <secs>]— extend existing set command with optional--ttlflagTransactions
txn begin— begin transaction, prints txn_idtxn put <txn_id> <key> <value>— stage writetxn delete <txn_id> <key>— stage deletetxn commit <txn_id>— committxn rollback <txn_id>— rollbackIndexes
index create <field>— create secondary index on JSON fieldindex query <field> <value>— query by indexindex list— list all indexesSearch
search <query> [--mode prefix|contains|regex] [--limit N]— extend existing search with mode flagvalue-search <query>— search by value contentBatch/Prefix operations
batch-delete <key1> [<key2> ...]— delete specific keysdelete-prefix <prefix>— delete all keys matching prefixAcceptance criteria
assert_cmdor similar CLI test frameworkreqwest(already a dependency) or call engine directly--help) is comprehensive and consistentclap(already a dependency) for argument parsing