Skip to content
Home

CLI & AI agents ​

The desktop app and CLI share one executable. With no arguments, khonsugraph opens the app; with a subcommand, it executes the command and exits. The title bar's Command line & AI button (the robot icon) installs khonsu on PATH and can install the skill for Claude Code.

The agent skill teaches agents the schema-first workflow and the supported Cypher subset.

Command reference ​

CommandPurpose
khonsu init DIRCreate an empty graph
khonsu schema --db DIRInspect labels, relationships, properties and tables
khonsu query --db DIR --cypher "…"Execute one read-only Cypher statement
khonsu query --db DIR --sql "…"Execute one read-only SQL statement
khonsu query --db DIR --file query.cypherRun a query file; .sql selects SQL
khonsu explain --db DIR --cypher "…"Explain a query
khonsu plugin listList plugins and permissions
khonsu plugin describe IDShow a plugin's configuration fields and output types
khonsu plugin install DIR --yesInstall a plugin directory or ZIP and approve its permissions
khonsu plugin sync --source IDSync a source; add --dry-run to preview or --incremental
khonsu source listList configured sources
khonsu source add --db DIR --plugin ID --name NAME -c key=valueConfigure a source; --test checks it first
khonsu source remove IDRemove a source
khonsu check FILE --db DIRValidate a dashboard against a graph
khonsu comments FILEList, reply to and resolve plot comments
khonsu presence FILE --doing editing --plot NAMEShow the window which plots you are editing
khonsu open DIROpen a graph in the desktop app
khonsu open FILE.dashOpen a dashboard
khonsu open --stateRead the running window's graph and tabs

--db defaults to KHONSU_DB, then the graph last opened in the app. Use an explicit path in automation. Query writes require --write.

Output and errors ​

Each command prints one JSON object on stdout; --pretty indents it. Sync progress goes to stderr as JSON lines. Query results contain columns, rows, row_count, truncated and elapsed_ms, plus graph when nodes or relationships are returned.

--max-rows defaults to 200 and truncates the displayed result. It does not reduce query execution work. Always inspect truncated and use bounded queries.

Failures have an error object with kind and message, and optional detail. Check the exit status before interpreting stdout: 1 indicates an execution error; 2 indicates a usage or dashboard specification error.

A review loop ​

sh
khonsu comments overview.dash
khonsu presence overview.dash --doing editing --plot dependencies
# Edit the .dash file, then validate it.
khonsu check overview.dash --db graphs/demo
# Use an actual comment ID returned by the first command.
khonsu comments overview.dash --reply c1 --text "Updated the graph panel" --resolve
khonsu presence overview.dash --doing idle

While the app holds a graph, read queries and check run through the window and return via_window: true. Do not remove locks to force a write. See troubleshooting.

Apache-2.0 · An independent project built on HawDB