mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add coder exp sync list command (#26443)
Add a new subcommand to list all registered sync units and their current
statuses. This provides a quick overview of the dependency coordination
state in a workspace without needing to query each unit individually.
The command supports both table (default) and JSON output formats.
```
$ coder exp sync list
UNIT STATUS READY
unit-a started true
unit-b completed true
unit-c pending false
$ coder exp sync list --output json
[
{
"unit_name": "my-unit",
"status": "started",
"is_ready": true
}
]
```
When no units are registered, the command prints `No units registered`.
<details><summary>Changes across layers</summary>
- `agent/unit`: add `Manager.ListUnits()` method
- `agent/agentsocket/proto`: add `SyncList` RPC, bump API to v1.2
- `agent/agentsocket`: add service and client implementations
- `cli`: add `sync_list.go` command, register in `sync.go`
- Tests: three golden-file test cases (empty list, multiple units, JSON)
</details>
> Generated by Coder Agents on behalf of @SasSwart
---------
Co-authored-by: Cian Johnston <cian@coder.com>
This commit is contained in:
co-authored by
Cian Johnston
parent
74a7ad0929
commit
7d95153bf4
@@ -0,0 +1,7 @@
|
||||
[
|
||||
{
|
||||
"unit_name": "my-unit",
|
||||
"status": "started",
|
||||
"is_ready": true
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1 @@
|
||||
No units registered
|
||||
@@ -0,0 +1,4 @@
|
||||
UNIT STATUS READY
|
||||
unit-a started true
|
||||
unit-b completed true
|
||||
unit-c pending false
|
||||
+1
@@ -13,6 +13,7 @@ USAGE:
|
||||
|
||||
SUBCOMMANDS:
|
||||
complete Mark a unit as complete
|
||||
list List all registered units and their statuses
|
||||
ping Test agent socket connectivity and health
|
||||
start Wait until all unit dependencies are satisfied
|
||||
status Show unit status and dependency state
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
coder v0.0.0-devel
|
||||
|
||||
USAGE:
|
||||
coder exp sync list [flags]
|
||||
|
||||
List all registered units and their statuses
|
||||
|
||||
List all units currently registered with the workspace agent. Shows each
|
||||
unit's name, status, and whether it is ready to start.
|
||||
|
||||
OPTIONS:
|
||||
-c, --column [unit|status|ready] (default: unit,status,ready)
|
||||
Columns to display in table output.
|
||||
|
||||
-o, --output table|json (default: table)
|
||||
Output format.
|
||||
|
||||
———
|
||||
Run `coder --help` for a list of global options.
|
||||
+1
-1
@@ -7,7 +7,7 @@ USAGE:
|
||||
|
||||
Show the current status of a unit, whether it is ready to start, and lists its
|
||||
dependencies. Shows which dependencies are satisfied and which are still
|
||||
pending. Supports multiple output formats.
|
||||
pending.
|
||||
|
||||
OPTIONS:
|
||||
-c, --column [depends on|required status|current status|satisfied] (default: depends on,required status,current status,satisfied)
|
||||
|
||||
Reference in New Issue
Block a user