Repository navigation
feat(cli): add JSON output for list and status - #77
Open
iloveitaly wants to merge 4 commits into
Open
iloveitaly wants to merge 4 commits into
iloveitaly wants to merge 4 commits into
Conversation
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.
Obviously, this was built with AI. I've been using it locally for a couple weeks locally and it works great.
Motivation
Projects using Localias need to check daemon state and saved alias ports during test preflight without parsing human-readable output.
Here's an example of where this is useful.
Description
Add
localias status --jsonandlocalias list --jsonwith typed output:{"running":true,"pid":98213}{"aliases":{"api-test.movie-tickets.localhost":14201,"embed.movie-tickets.localhost":14204}}A stopped daemon returns
{"running":false,"pid":null}successfully. Empty aliases return{"aliases":{}}. Each successful JSON command writes one document to stdout; errors exit nonzero with plain diagnostics on stderr.list --format jsonis equivalent to--json, and text remains the default output.Preserve PID-file and process-permission errors instead of reporting them as stopped. Reject invalid or conflicting output flags and propagate output write errors.
The README and command help explicitly distinguish saved configuration from active daemon configuration.
listreads the selected saved file; a live configuration query remains future work, so these commands alone cannot detect stale ports still running in the daemon.Test
go test ./...and golangci-lint 2.15.0.Links