Skip to content

Commit e43e371

Browse files
authored
chore(cmd): remove categories from command usage (#481)
1 parent b18f90e commit e43e371

File tree

13 files changed

+100
-131
lines changed

13 files changed

+100
-131
lines changed

cmd/lk/app.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ var (
4040
project *config.ProjectConfig
4141
AppCommands = []*cli.Command{
4242
{
43-
Name: "app",
44-
Category: "Core",
43+
Name: "app",
44+
Usage: "Initialize and manage applications",
4545
Commands: []*cli.Command{
4646
{
4747
Name: "create",
@@ -292,7 +292,10 @@ func setupTemplate(ctx context.Context, cmd *cli.Command) error {
292292
}
293293

294294
fmt.Println("Instantiating environment...")
295-
addlEnv := &map[string]string{"LIVEKIT_SANDBOX_ID": sandboxID}
295+
addlEnv := &map[string]string{
296+
"LIVEKIT_SANDBOX_ID": sandboxID,
297+
"NEXT_PUBLIC_LIVEKIT_SANDBOX_ID": sandboxID,
298+
}
296299
env, err := instantiateEnv(ctx, cmd, appName, addlEnv)
297300
if err != nil {
298301
return err
@@ -368,9 +371,10 @@ func manageEnv(ctx context.Context, cmd *cli.Command) error {
368371

369372
func instantiateEnv(ctx context.Context, cmd *cli.Command, rootPath string, addlEnv *map[string]string) (map[string]string, error) {
370373
env := map[string]string{
371-
"LIVEKIT_API_KEY": project.APIKey,
372-
"LIVEKIT_API_SECRET": project.APISecret,
373-
"LIVEKIT_URL": project.URL,
374+
"LIVEKIT_API_KEY": project.APIKey,
375+
"LIVEKIT_API_SECRET": project.APISecret,
376+
"LIVEKIT_URL": project.URL,
377+
"NEXT_PUBLIC_LIVEKIT_URL": project.URL,
374378
}
375379
if addlEnv != nil {
376380
for k, v := range *addlEnv {

cmd/lk/cloud.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,16 @@ const (
5353
)
5454

5555
var (
56-
revoke bool
57-
timeout int64 = 60 * 15
58-
interval int64 = 4
59-
serverURL string = cloudAPIServerURL
60-
dashboardURL string = cloudDashboardURL
61-
authClient AuthClient
62-
AuthCommands = []*cli.Command{
56+
revoke bool
57+
timeout int64 = 60 * 15
58+
interval int64 = 4
59+
serverURL string = cloudAPIServerURL
60+
dashboardURL string = cloudDashboardURL
61+
authClient AuthClient
62+
CloudCommands = []*cli.Command{
6363
{
64-
Name: "cloud",
65-
Usage: "Interacting with LiveKit Cloud",
66-
Category: "Cloud",
64+
Name: "cloud",
65+
Usage: "Interact with LiveKit Cloud services",
6766
Commands: []*cli.Command{
6867
{
6968
Name: "auth",

cmd/lk/dispatch.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ import (
1515
var (
1616
DispatchCommands = []*cli.Command{
1717
{
18-
Name: "dispatch",
19-
Usage: "Create, list, and delete agent dispatches",
20-
Category: "Agent",
21-
18+
Name: "dispatch",
19+
Usage: "Create, list, and delete agent dispatches",
2220
Commands: []*cli.Command{
2321
{
2422
Name: "list",

cmd/lk/egress.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,8 @@ See cmd/livekit-cli/examples`
6969
var (
7070
EgressCommands = []*cli.Command{
7171
{
72-
Name: "egress",
73-
Usage: "Record or stream media from LiveKit to elsewhere",
74-
Category: "I/O",
72+
Name: "egress",
73+
Usage: "Record or stream media from LiveKit to elsewhere",
7574
Commands: []*cli.Command{
7675
{
7776
Name: "start",

cmd/lk/ingress.go

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,11 @@ import (
2424
lksdk "github.com/livekit/server-sdk-go/v2"
2525
)
2626

27-
const ingressCategory = "Ingress"
28-
2927
var (
3028
IngressCommands = []*cli.Command{
3129
{
32-
Name: "ingress",
33-
Usage: "Import outside media sources into a LiveKit room",
34-
Category: "I/O",
30+
Name: "ingress",
31+
Usage: "Import outside media sources into a LiveKit room",
3532
Commands: []*cli.Command{
3633
{
3734
Name: "create",
@@ -98,12 +95,11 @@ var (
9895

9996
// Deprecated commands kept for compatibility
10097
{
101-
Hidden: true, // deprecated: use `ingress create`
102-
Name: "create-ingress",
103-
Usage: "Create an ingress",
104-
Before: createIngressClient,
105-
Action: createIngress,
106-
Category: ingressCategory,
98+
Hidden: true, // deprecated: use `ingress create`
99+
Name: "create-ingress",
100+
Usage: "Create an ingress",
101+
Before: createIngressClient,
102+
Action: createIngress,
107103
Flags: []cli.Flag{
108104
&cli.StringFlag{
109105
Name: "request",
@@ -113,12 +109,11 @@ var (
113109
},
114110
},
115111
{
116-
Hidden: true, // deprecated: use `ingress update`
117-
Name: "update-ingress",
118-
Usage: "Update an ingress",
119-
Before: createIngressClient,
120-
Action: updateIngress,
121-
Category: ingressCategory,
112+
Hidden: true, // deprecated: use `ingress update`
113+
Name: "update-ingress",
114+
Usage: "Update an ingress",
115+
Before: createIngressClient,
116+
Action: updateIngress,
122117
Flags: []cli.Flag{
123118
&cli.StringFlag{
124119
Name: "request",
@@ -128,12 +123,11 @@ var (
128123
},
129124
},
130125
{
131-
Hidden: true, // deprecated: use `ingress list`
132-
Name: "list-ingress",
133-
Usage: "List all active ingress",
134-
Before: createIngressClient,
135-
Action: listIngress,
136-
Category: ingressCategory,
126+
Hidden: true, // deprecated: use `ingress list`
127+
Name: "list-ingress",
128+
Usage: "List all active ingress",
129+
Before: createIngressClient,
130+
Action: listIngress,
137131
Flags: []cli.Flag{
138132
&cli.StringFlag{
139133
Name: "room",
@@ -148,12 +142,11 @@ var (
148142
},
149143
},
150144
{
151-
Hidden: true, // deprecated: use `ingress delete`
152-
Name: "delete-ingress",
153-
Usage: "Delete ingress",
154-
Before: createIngressClient,
155-
Action: deleteIngress,
156-
Category: ingressCategory,
145+
Hidden: true, // deprecated: use `ingress delete`
146+
Name: "delete-ingress",
147+
Usage: "Delete ingress",
148+
Before: createIngressClient,
149+
Action: deleteIngress,
157150
Flags: []cli.Flag{
158151
&cli.StringFlag{
159152
Name: "id",

cmd/lk/join.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ import (
4040
var (
4141
JoinCommands = []*cli.Command{
4242
{
43-
Hidden: true, // deprecated: use `lk room join`
44-
Name: "join-room",
45-
Usage: "Joins a room as a participant",
46-
Action: _deprecatedJoinRoom,
47-
Category: "Simulate",
43+
Hidden: true, // deprecated: use `lk room join`
44+
Name: "join-room",
45+
Usage: "Joins a room as a participant",
46+
Action: _deprecatedJoinRoom,
4847
Flags: []cli.Flag{
4948
roomFlag,
5049
identityFlag,

cmd/lk/loadtest.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ import (
2828

2929
var LoadTestCommands = []*cli.Command{
3030
{
31-
Name: "load-test",
32-
Usage: "Run load tests against LiveKit with simulated publishers & subscribers",
33-
Category: "Simulate",
34-
Action: loadTest,
31+
Name: "load-test",
32+
Usage: "Run load tests against LiveKit with simulated publishers & subscribers",
33+
Action: loadTest,
3534
Flags: []cli.Flag{
3635
&cli.StringFlag{
3736
Name: "room",

cmd/lk/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,18 @@ func main() {
6767
},
6868
}
6969

70-
app.Commands = append(app.Commands, AuthCommands...)
7170
app.Commands = append(app.Commands, AppCommands...)
72-
app.Commands = append(app.Commands, TokenCommands...)
71+
app.Commands = append(app.Commands, CloudCommands...)
72+
app.Commands = append(app.Commands, ProjectCommands...)
7373
app.Commands = append(app.Commands, RoomCommands...)
74+
app.Commands = append(app.Commands, TokenCommands...)
7475
app.Commands = append(app.Commands, JoinCommands...)
76+
app.Commands = append(app.Commands, DispatchCommands...)
7577
app.Commands = append(app.Commands, EgressCommands...)
7678
app.Commands = append(app.Commands, IngressCommands...)
79+
app.Commands = append(app.Commands, SIPCommands...)
7780
app.Commands = append(app.Commands, ReplayCommands...)
7881
app.Commands = append(app.Commands, LoadTestCommands...)
79-
app.Commands = append(app.Commands, ProjectCommands...)
80-
app.Commands = append(app.Commands, SIPCommands...)
81-
app.Commands = append(app.Commands, DispatchCommands...)
8282

8383
// Register cleanup hook for SIGINT, SIGTERM, SIGQUIT
8484
ctx, stop := signal.NotifyContext(

cmd/lk/project.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ import (
3232
var (
3333
ProjectCommands = []*cli.Command{
3434
{
35-
Name: "project",
36-
Usage: "Add or remove projects and view existing project properties",
37-
Category: "Core",
38-
Before: loadProjectConfig,
35+
Name: "project",
36+
Usage: "Add or remove projects and view existing project properties",
37+
Before: loadProjectConfig,
3938
Commands: []*cli.Command{
4039
{
4140
Name: "add",

cmd/lk/replay.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ var (
1919
{
2020
Name: "replay",
2121
Usage: "experimental (not yet available)",
22-
Category: "I/O",
2322
Hidden: true,
2423
HideHelpCommand: true,
2524
Commands: []*cli.Command{

0 commit comments

Comments
 (0)