Files
vdm/cli/CMakeLists.txt
T
samiandClaude Sonnet 5 0c7ce1437c cli: velox — add / ls / pause / resume / rm, with --json (build step 8, pulled forward)
The scriptable client, built now rather than last: it is how the daemon
gets exercised before the GUI is pointed at it (AGENT-DAEMON.md).

- src/client — synchronous blocking RPC over the Unix socket: resolve
  $XDG_RUNTIME_DIR/velox/velox.sock, connect, session.hello, one framed
  request/reply per call. Distinguishes transport failure (exit 3) from
  a daemon-returned error (exit 1).
- src/main — subcommands add/ls/pause/resume/rm; --json prints the raw
  JSON-RPC result or error; --dir/--out/--segments on add;
  --delete-file on rm. Usage errors exit 2.

ls works end to end against veloxd today (empty table). add and the
bulk verbs reach the daemon and surface its "not implemented" (-32603)
cleanly until the store lands — the plumbing is done, the commands
light up as handlers do.

Test velox.client: the real Client against an in-process UdsServer —
no-daemon path, session.hello, download.list, and a not-implemented
method surfacing as an RPC error rather than a transport error.
ASan+UBSan clean; full tree (21 tests, incl. conformance) green.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Upd9WhG9oppieig5nRDLig
2026-09-10 15:27:20 +04:00

24 lines
902 B
CMake

# cli/ produces the `velox` binary — the scriptable RPC client. Owned by lane DAEMON.
# Built early (AGENT-DAEMON.md build step 8, pulled forward): it is how the daemon is
# tested before the GUI exists.
#
# Links velox::proto for the wire types and error codes. It speaks the same NDJSON Unix
# socket veloxd listens on; no daemon code is linked.
if(NOT TARGET nlohmann_json::nlohmann_json)
find_package(nlohmann_json 3.11 REQUIRED)
endif()
add_executable(velox
src/main.cpp
src/client.cpp
)
target_include_directories(velox PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
target_compile_features(velox PRIVATE cxx_std_23)
target_compile_options(velox PRIVATE -Wall -Wextra -Wpedantic -Werror)
target_link_libraries(velox PRIVATE velox::proto nlohmann_json::nlohmann_json)
if(VELOX_BUILD_TESTS AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt)
add_subdirectory(tests)
endif()