Repository navigation
Description
Overview
Build the nodespace CLI binary — a thin gRPC client that connects to nodespaced on localhost:50051 and exposes knowledge graph operations as shell commands. This gives developers and power users Ollama-style command-line access to NodeSpace without opening the desktop UI.
Problem Statement
NodeSpace currently has no command-line interface. All interaction requires the Tauri desktop application. Under ADR-031 the daemon runs independently of the UI, making a CLI both possible and natural. Developers need to script node operations, query the graph from terminal workflows, and verify daemon state without a GUI.
Proposed Solution
A standalone nodespace binary that initializes a tonic gRPC client and exposes subcommands for common node operations. The CLI is stateless — each invocation connects, executes, and disconnects. Output is human-readable by default with --json flag for scripting.
Acceptance Criteria
-
nodespacebinary builds and is installable alongsidenodespaced -
nodespace node get <id>retrieves and prints a node -
nodespace node create --type <type> --content <content> [--parent <id>]creates a node and prints the result -
nodespace node update <id> --content <content>updates a node -
nodespace node delete <id>deletes a node -
nodespace node children <id>lists child nodes -
nodespace search <query>runs a semantic search and prints results -
--jsonflag on all commands outputs raw JSON for scripting - Clear error message when
nodespacedis not running (connection refused) -
nodespace --helpandnodespace <subcommand> --helpprint useful usage text -
cargo build --bin nodespacesucceeds - Code passes
bun run quality:fix
Technical Specifications
Files to create
packages/cli/(NEW crate) — orpackages/daemon/src/bin/nodespace.rsif kept in the daemon cratepackages/cli/src/main.rs— CLI entry point, argument parsing, gRPC client initpackages/cli/src/commands/node.rs—get,create,update,delete,childrensubcommandspackages/cli/src/commands/search.rs— semantic search subcommandpackages/cli/src/output.rs— human-readable and JSON output formattersCargo.toml(workspace root) — add cli crate member
Argument parsing crate
clap with derive macros:
[dependencies]
clap = { version = "4", features = ["derive"] }
tonic = "0.12"
tokio = { version = "1", features = ["full"] }
serde_json = "1"Command structure
nodespace [--json] <subcommand>
nodespace node get <id>
nodespace node create --type <type> --content <content> [--parent <id>]
nodespace node update <id> --content <content>
nodespace node delete <id>
nodespace node children <id>
nodespace search <query> [--limit <n>]
gRPC client init
let channel = Channel::from_static("http://[::1]:50051")
.connect()
.await
.map_err(|_| "nodespaced is not running — start it with `nodespaced`")?;
let client = NodeServiceClient::new(channel);Output format
Human-readable: pretty-printed node fields. With --json: raw proto-to-JSON serialization via serde_json.
Reference files
packages/daemon/proto/node_service.proto— gRPC interface (from Define protobuf schema and set up tonic/prost build pipeline for nodespaced #1111)packages/daemon/src/main.rs— daemon binary for structural reference (from Implement nodespaced binary: gRPC server startup and NodeService registration #1112)
Dependencies
- Define protobuf schema and set up tonic/prost build pipeline for nodespaced #1111 (proto schema — CLI uses the same generated types)
- Implement nodespaced binary: gRPC server startup and NodeService registration #1112 (nodespaced must be running for integration testing)
Non-Goals
- PTY agent session commands (
launch,attach,sessions,kill) — covered by the PTY CLI issue - Interactive REPL or TUI mode (future)
- Authentication or multi-instance daemon selection (future)
Activity
malibio commentedon May 17, 2026
Baseline (frontend): 128 test files / 3918 tests passing in 39.3s on worktree branch worktree-issue-1116-nodespace-cli (off main @ 5e7ef28).
Implement nodespace CLI binary (closes #1116) (#1141)