Files
tty7/crates/tty7-cli
l0ng-ai 768aca01f1 fix(cli): machine ls --json was missing the machine it runs on
The table synthesized the `local` row itself while `--json` serialized the
server's routes alone, and a route is a link to some *other* machine. So on a
machine with no remotes — which is every machine until someone connects one —
`tty7 machine ls` printed a row for itself and `tty7 machine ls --json`
answered `{"machines":[]}`. An agent enumerating machines read that as "there
are none", including the one it was running on.

The docs already said what it should be: "the local machine plus every link",
with `{"machines":[{"key","kind","connected"}]}`.

The list is now assembled once in `machine_ls` and handed to both renderings,
so the two cannot disagree again; `routes_table` renders what it is given
instead of adding a machine to it. Pinned by a test that asserts the table and
the JSON agree, with and without a link.

Found by running the command against a dev instance rather than by reading it —
the human output looked right, and it was the half nothing prints by default
that was wrong.

2934 tests pass.
2026-08-15 18:11:17 +08:00
..