Olares/cli/cmd/ctl/os
Peng Peng 61d793e4c6
cli, daemon: add olares-cli status backed by olaresd /system/status (#2917)
* cli, daemon: add `olares-cli status` backed by olaresd /system/status

Adds a new top-level `olares-cli status` command that calls the local
olaresd daemon's `/system/status` HTTP endpoint and prints either a
grouped, annotated human-readable report or raw JSON.

To avoid duplicating the response schema, the daemon's `state` struct
and related enums are extracted into a new shared package
`cli/pkg/daemon/state`. The daemon now type-aliases those types so all
existing daemon call sites keep compiling unchanged.

Made-with: Cursor

* cli: drop unused state.APIResponse envelope type

The HTTP client in cli/pkg/daemon/api/client.go intentionally uses an
inline anonymous envelope with json.RawMessage for the data field so
that --json mode can passthrough the bytes verbatim, so the public
APIResponse{Data State} type defined here had zero references. Remove
it; if a strongly-typed consumer ever shows up, re-add then.

Addresses Cursor Bugbot feedback on PR #2917.

Made-with: Cursor
2026-04-21 00:29:50 +08:00
..
backup.go refactor: integrate CLI's code & CI into main repo (#1343) 2025-05-26 17:21:25 +08:00
changeip.go refactor(cli): unify config of command line options and envs (#2453) 2026-01-28 23:53:11 +08:00
download.go refactor(cli): unify config of command line options and envs (#2453) 2026-01-28 23:53:11 +08:00
info.go cli: change the module name of the cli (#1431) 2025-06-11 23:06:24 +08:00
install.go fix(cli): use new pattern to get legacy host ip config (#2797) 2026-04-01 21:20:44 +08:00
logs.go fix(cli): skip collecting envoy config if not ready (#2869) 2026-04-13 22:54:41 +08:00
precheck.go refactor(cli): unify config of command line options and envs (#2453) 2026-01-28 23:53:11 +08:00
prepare.go refactor(cli): unify config of command line options and envs (#2453) 2026-01-28 23:53:11 +08:00
release.go chore: bump version to 1.12.7 in workflows and scripts (#2849) 2026-04-10 13:25:42 +08:00
root.go cli, daemon: add olares-cli status backed by olaresd /system/status (#2917) 2026-04-21 00:29:50 +08:00
startstop.go cli: change the module name of the cli (#1431) 2025-06-11 23:06:24 +08:00
status.go cli, daemon: add olares-cli status backed by olaresd /system/status (#2917) 2026-04-21 00:29:50 +08:00
storage.go refactor(cli): unify config of command line options and envs (#2453) 2026-01-28 23:53:11 +08:00
uninstall.go refactor(cli): unify config of command line options and envs (#2453) 2026-01-28 23:53:11 +08:00
upgrade.go fix(cli): do not provide version option for upgrade commands (#2666) 2026-03-12 14:01:54 +08:00