cli: redesign proposal - #3375
Conversation
5ceb01c to
ddaa04f
Compare
| headscale nodes disable-expiry 12 | ||
| ``` | ||
|
|
||
| An alternative shape is a top-level `expire` group instead of `nodes set-expiry`. We want reviewer input on which to pick: |
There was a problem hiding this comment.
I currently like this, where we split out the very much used node ones, but expiry is a bit weird because it also exist in different scopes.
Maybe only routes and tags?
Authentication of nodes and also SSH check.
An approve subcommand with an empty last target argument is confusing to some users. Because its unclear whether the user forgot the last argument or all routes should really be disapproved. We also have this now when using Maybe add a pair of subcommands to solve this in general?
I like the "optional fields as flags". Its flexible and can be extended as needed.
Do we even need json-line? If not, we could only provide json as universal machine readable output format and combine it with jsonpath somehow? Otherwise we'd have four formats:
I like the "nodes expire" form better. Adding one more word to the argument list does not really matter but it imho
Other questions:
|
|
How should we do the formatting of the text output? Some columns are single valued (node name, user name) and some are lists (ip addresses, routes)? Should we keep it fixed (without stability guarantees) and direct users to The text version should favor human readability and allow for some flexibility for upcoming changes (add, remove, reorder default columns). While its nice to use grep and friends to work with the CLI, there's json and jsonpath which is better suited for scripting. The "one line per list entry" output is good for variable long lists such as routes. For the node's IP addresses its a bit hard to read as its almost always two lines which produces alternating rows and make it visually harder to read. |
2359183 to
eabe49f
Compare
Perhaps we could omit the |
Route/tag verbs become set; drop json-line; keep expire/routes/tags under nodes; document global flags and env behaviour.
Replace the stub structure with every leaf command; keys use revoke, nodes use expire. api examples gain key CRUD and oauth2 naming.
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
Drop jsonpath for jq, client-side filter only, note preauth prefix exists, backfill server cleanup, --list-columns, tags/users list mockups. Abandoned text struck through, not deleted.
15a9b72 to
24ebbb5
Compare
COUNT + NODES columns, terminal-width truncation, no --expand. Full data via --output json | jq, encouraged in every command's help.
This pr is not to be merged, its end result is to serve as a "design doc" for how we organise our cli. Breaking changes allowed.
Comments, suggestions and proposals from humans in the community encouraged.