MCPcopy Create free account
hub / github.com/compozy/agh / newWorkspaceListCommand

Function newWorkspaceListCommand

internal/cli/workspace.go:97–119  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

95}
96
97func newWorkspaceListCommand(deps commandDeps) *cobra.Command {
98 return &cobra.Command{
99 Use: workspaceListKey,
100 Short: "List registered workspaces",
101 Example: ` # Show every registered workspace
102 agh workspace list
103
104 # Return workspace records as JSON
105 agh workspace list --output json`,
106 RunE: func(cmd *cobra.Command, _ []string) error {
107 client, err := clientFromDeps(deps)
108 if err != nil {
109 return err
110 }
111
112 workspaces, err := client.ListWorkspaces(cmd.Context())
113 if err != nil {
114 return err
115 }
116 return writeCommandOutput(cmd, workspaceListBundle(workspaces))
117 },
118 }
119}
120
121func newWorkspaceInfoCommand(deps commandDeps) *cobra.Command {
122 var workspaceRef string

Callers 1

newWorkspaceCommandFunction · 0.85

Calls 4

clientFromDepsFunction · 0.85
writeCommandOutputFunction · 0.85
workspaceListBundleFunction · 0.85
ListWorkspacesMethod · 0.65

Tested by

no test coverage detected