-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.go
More file actions
105 lines (97 loc) · 3.26 KB
/
Copy pathcli.go
File metadata and controls
105 lines (97 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// Package main implements the AgentPane CLI entry point and command registration.
package main
import (
"os"
"github.com/agentdevsl/agentpane/cli/internal/command"
"github.com/agentdevsl/agentpane/cli/version"
"github.com/mitchellh/cli"
)
// newCliRunner creates a cli.CLI instance with all commands registered.
func newCliRunner(meta *command.Meta) *cli.CLI {
c := &cli.CLI{
Name: "agentpane",
Version: version.Version,
Args: os.Args[1:],
Commands: map[string]cli.CommandFactory{
// Health
"health": func() (cli.Command, error) {
return &command.HealthCommand{Meta: meta}, nil
},
// Project commands (project folders)
"project list": func() (cli.Command, error) {
return &command.ProjectListCommand{Meta: meta}, nil
},
"project show": func() (cli.Command, error) {
return &command.ProjectShowCommand{Meta: meta}, nil
},
"project create": func() (cli.Command, error) {
return &command.ProjectCreateCommand{Meta: meta}, nil
},
"project delete": func() (cli.Command, error) {
return &command.ProjectDeleteCommand{Meta: meta}, nil
},
// Codespace commands
"codespace list": func() (cli.Command, error) {
return &command.CodespaceListCommand{Meta: meta}, nil
},
"codespace show": func() (cli.Command, error) {
return &command.CodespaceShowCommand{Meta: meta}, nil
},
"codespace create": func() (cli.Command, error) {
return &command.CodespaceCreateCommand{Meta: meta}, nil
},
"codespace update": func() (cli.Command, error) {
return &command.CodespaceUpdateCommand{Meta: meta}, nil
},
"codespace delete": func() (cli.Command, error) {
return &command.CodespaceDeleteCommand{Meta: meta}, nil
},
// Task commands
"task list": func() (cli.Command, error) {
return &command.TaskListCommand{Meta: meta}, nil
},
"task create": func() (cli.Command, error) {
return &command.TaskCreateCommand{Meta: meta}, nil
},
"task show": func() (cli.Command, error) {
return &command.TaskShowCommand{Meta: meta}, nil
},
"task move": func() (cli.Command, error) {
return &command.TaskMoveCommand{Meta: meta}, nil
},
"task run": func() (cli.Command, error) {
return &command.TaskRunCommand{Meta: meta}, nil
},
"task approve": func() (cli.Command, error) {
return &command.TaskApproveCommand{Meta: meta}, nil
},
"task reject": func() (cli.Command, error) {
return &command.TaskRejectCommand{Meta: meta}, nil
},
// Env commands (sandbox environment variables)
"env list": func() (cli.Command, error) {
return &command.EnvListCommand{Meta: meta}, nil
},
"env set": func() (cli.Command, error) {
return &command.EnvSetCommand{Meta: meta}, nil
},
"env delete": func() (cli.Command, error) {
return &command.EnvDeleteCommand{Meta: meta}, nil
},
"env clear": func() (cli.Command, error) {
return &command.EnvClearCommand{Meta: meta}, nil
},
// Session commands
"session list": func() (cli.Command, error) {
return &command.SessionListCommand{Meta: meta}, nil
},
"session show": func() (cli.Command, error) {
return &command.SessionShowCommand{Meta: meta}, nil
},
"session events": func() (cli.Command, error) {
return &command.SessionEventsCommand{Meta: meta}, nil
},
},
}
return c
}