Skip to content

Commit e02c84f

Browse files
committed
fix tab completion
1 parent 3c617de commit e02c84f

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

cmd/lk/agent_run.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ var startCommand = &cli.Command{
8989
ArgsUsage: "[entrypoint] [-- node/python-args...]",
9090
Flags: agentRunFlags,
9191
Action: runAgentStart,
92+
// Leaf command whose positional arg is an entrypoint file. Drop the implicit
93+
// `help` subcommand so shell completion returns nothing for the positional,
94+
// letting the shell fall back to native filename completion (--help kept).
95+
HideHelpCommand: true,
9296
}
9397

9498
var devCommand = &cli.Command{
@@ -100,6 +104,8 @@ var devCommand = &cli.Command{
100104
Usage: "Disable auto-reload on file changes",
101105
}),
102106
Action: runAgentDev,
107+
// See startCommand: hide `help` so filenames complete for the entrypoint arg.
108+
HideHelpCommand: true,
103109
}
104110

105111
// agentCredentials holds the connection details forwarded to the agent subprocess.

cmd/lk/console.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ var consoleCommand = &cli.Command{
4343
Usage: "Voice chat with an agent via mic/speakers",
4444
ArgsUsage: "[entrypoint] [-- node/python-args...]",
4545
Category: "Core",
46+
// Hide the implicit `help` subcommand so shell completion falls back to
47+
// native filename completion for the entrypoint arg (see startCommand).
48+
HideHelpCommand: true,
4649
Flags: []cli.Flag{
4750
&cli.IntFlag{
4851
Name: "port",

cmd/lk/simulate.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ var simulateCommand = &cli.Command{
5757
Name: "simulate",
5858
Usage: "Run agent simulations against LiveKit Cloud",
5959
ArgsUsage: "[entrypoint]",
60+
// Hide the implicit `help` subcommand so shell completion falls back to
61+
// native filename completion for the entrypoint arg (see startCommand).
62+
HideHelpCommand: true,
6063
Before: func(ctx context.Context, cmd *cli.Command) (context.Context, error) {
6164
pc, err := loadProjectDetails(cmd)
6265
if err != nil {

0 commit comments

Comments
 (0)