Conversation
The HTTP API was curl-only from the shell. The binary now doubles as a client for a running server: search (with --json for fzf/rofi/jq pipelines), add, load (by ID or by a query that must match exactly one track, listing the candidates otherwise), players, playlists, and status. --addr / VYNULL_ADDR select the server; defaults to the default listen address. A bare vynull (or flags-only invocation) starts the server exactly as before - subcommands dispatch before any server flag parsing. Deliberately thin: no new server surface, every subcommand is a wrapper over an existing endpoint, and paths passed to add are resolved on the server's filesystem (documented same-host assumption). Errors land on stderr with exit 1; empty results are not errors. Covered by an e2e scenario driving the built binary's subcommands against a real server: add -> analyzed, search human + json, status, playlists, and load's error paths (bad deck, unknown query, no CDJ on the link). The load success path needs a deck to accept the command and stays a hardware check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The HTTP API was curl-only from the shell. The binary now doubles as a client for a running server:
vynull search(with--jsonfor fzf/rofi/jq pipelines),add,load,players,playlists, andstatus.--addr/VYNULL_ADDRselect the server, defaulting to the default listen address. A barevynull(or a flags-only invocation) starts the server exactly as before; subcommands dispatch before any server flag parsing.The point is scriptability without us writing more frontends:
search --jsonpiped through jq and fzf is how shell users build their own pickers, watch-folder cron jobs can calladd, and status-bar widgets can pollplayers --json. Deliberately thin by design: no new server surface at all, every subcommand wraps an existing endpoint, so the CLI can never drift from what the web UI does. No CLI framework either, just stdlib flag handling in one file.Two behaviours worth reviewing:
loadaccepts a track ID or a search query, and a query must match exactly one track (the candidates are listed on stderr otherwise), because loading the wrong track on a live deck is not a failure mode to leave open. And paths passed toaddare resolved on the server's filesystem, which the README documents as a same-host (or shared-mount) assumption rather than pretending to be an upload feature.Covered by a new e2e scenario driving the built binary's subcommands against a real server: add then analyzed then search finds the track with its exact BPM,
--jsonoutput parses, an empty search exits zero, and load's error paths fail cleanly (bad deck number, unknown query, no CDJ on the link). Errors go to stderr with exit 1.Hardware testing
loadsuccess path ends at the existing/api/loadendpoint, whose deck behaviour is unchanged; the CLI-specific paths around it (ID/query resolution, deck validation, no-deck error) are covered by the e2e scenario. Worth onevynull load <id> <deck>against a real CDJ when convenient, as a smoke of the plumbing end to end.Checklist
go build ./...,go vet ./..., andgo test ./...passgofmt -l .is cleanGPL-3.0-or-later)