Documentation

CLI Reference

Use the kura command to manage registry state, daemon lifecycle, and the local HTTP port.

Command summary

Command Syntax Effect
Start kura Launch the service as a detached daemon and print its endpoint
Add kura add <name> Register a database, create its inbox, and create a home-directory symlink
List kura list Print registered database names and UTC creation timestamps
Remove kura remove <name> Permanently delete a database after interactive confirmation
Edit kura edit <old> <new> Rename the directory, symlink, and registry entry
Stop kura stop Send SIGTERM, then escalate to SIGKILL after five seconds if needed
Set port kura port set <port> Persist a fixed port and restart the daemon
Clear port kura port clear Remove the fixed port for the next manual start
Help kura help Print command usage

kura -h and kura --help are aliases for kura help.

Start the daemon

kura

The launcher:

  1. Opens ~/.config/kuradb/daemon.log for daemon output.
  2. Starts the same executable with the internal --daemon argument in a new session.
  3. Polls ~/.config/kuradb/endpoint for up to 10 seconds.
  4. Prints the endpoint when ready, or exits with an error directing you to daemon.log.

--daemon is an internal lifecycle argument rather than a normal user command.

Add a database

kura add my_docs

The first argument is used as the name. Runs of whitespace are converted to underscores; an empty result is rejected. The command refuses duplicate registry entries or an existing target directory.

On success it creates:

~/.config/kuradb/my_docs/inbox/
~/Kura_my_docs -> ~/.config/kuradb/my_docs/inbox/

It then appends an entry to db.json. The running daemon does not hot-load the new database, so restart it before searching.

List databases

kura list

Each line contains a database name and its UTC RFC 3339 creation time. An empty registry prints (no registered db).

For the distinction between registry and runtime state, use GET /api/list, which returns both registered and loaded collections.

Rename a database

kura edit my_docs my_archive

The command validates both names, rejects a registered or existing target, renames the database directory, replaces the home symlink, and finally updates the registry. Identical old and new names print noop.

Because the daemon keeps its startup-time database map, stop or restart it around rename operations.

Remove a database

kura remove my_archive

Removal prints the database directory and symlink, then requires the exact response yes. Any other response aborts. Confirmation permanently removes the database directory, removes the home path only when it is a symlink, and deletes the registry entry.

This operation deletes the authoritative SQLite database. Back up required data before confirming.

Configure the port

kura port set 8080
kura port clear

set accepts an integer from 1 through 65535, writes config.json, stops a live daemon when present, and starts a replacement. clear removes the pin but deliberately does not restart the process.

Stop the daemon

kura stop

KuraDB reads the PID from runtime.uid, verifies it is alive, and sends SIGTERM. It polls for up to five seconds at 100 ms intervals, then sends SIGKILL if the process has not exited.

Makefile shortcuts

From a source checkout, equivalent development targets are available:

Target Example Behavior
build make build Build ./cmd/app to bin/kura
app make app Stop, build, install to /usr/local/bin/kura, and start
test make test Run go test -v -count=1 ./...
add make add my_docs Run the add subcommand through go run
list make list Run the list subcommand through go run
remove make remove my_docs Run interactive removal through go run
edit make edit old new Run rename through go run
port make port set 8080 Run port management through go run
stop make stop Stop the daemon through go run
中文