Feature: `--json` for Kiri's own commands (domains, k8s status, machine list, usb list, registry)

Aperta
#748 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cli, docker, json, kubernetes, linux, macos, rust
Ambito
cli, devtools

Direzione di ricerca

Start with the CLI argument parsing for kiri domains, kiri k8s status, kiri machine list, kiri usb list and kiri registry, and the daemon report functions the issue names: domains::report(), machine::list() and usb::list(). Add a --json flag that serializes those existing structures as one line of compact JSON, leaving exit codes unchanged. Done when each listed command prints valid JSON under --json and the existing kiri share --json behaviour still holds.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What I would like

kiri share already has --json. The rest of Kiri's own commands print only for a person, which makes them awkward in scripts:

  • kiri domains — parse the port and state out of padded columns
  • kiri k8s status — the context, port and LAN setting
  • kiri machine list — name, distro, state, IP
  • kiri usb list — device, id, tty, name
  • kiri registry insecure list / mirror list
$ kiri domains --json
{"http":{"port":80,"running":true,"serving":true},"https":{"port":443,"running":true,"serving":false}}

Why it is worth it

The window already asks the daemon for JSON (/kiri/domains, /kiri/k8s, …); every script that wants the same information today either scrapes columns or speaks the Docker API directly. CI and setup scripts (and kiri doctor above) would use the same output.

Shape

  • One flag, --json, on each of these; one line of compact JSON, exit code unchanged.
  • The daemon's own report shape is the natural body: domains::report(), machine::list(), usb::list() already return it.

Not implemented here — filing it as a proposal first.

Lingua principale
Rust
Stelle
7.5k
Fork
329
Merge medio
15h 49m
PR unite (30g)
241

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di libracoder/kiri

Tutte le issue di libracoder/kiri

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.