Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions autocomplete/fish_autocomplete
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,19 @@ complete -x -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subco
complete -x -c lk -n '__fish_seen_subcommand_from agent a; and not __fish_seen_subcommand_from init create dockerfile config deploy promote status update restart rollback logs tail delete destroy versions list secrets update-secrets private-link start dev console daemon simulate help h' -a 'create' -d 'Create a new LiveKit Cloud Agent'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from create' -f -l secrets -r -d 'KEY=VALUE comma separated secrets. These will be injected as environment variables into the agent. These take precedence over secrets-file.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from create' -l secrets-file -r -d '`FILE` containing secret KEY=VALUE pairs, one per line. These will be injected as environment variables into the agent.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from create' -f -l secret-mount -r -d 'Local path to a secret file to be mounted on agent environment'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from create' -f -l ignore-empty-secrets -d 'If set, will skip environment variables with empty values from secrets files instead of failing'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from create' -f -l secret-mount -r -d 'Local path to a secret file to be mounted on agent environment.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from create' -f -l ignore-empty-secrets -d 'If set, will skip environment variables with empty values from secrets files instead of failing.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from create' -f -l region -r -d 'Region to deploy the agent to. If unset, will deploy to the nearest region.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from create' -f -l deployment -s d -r -d 'Agent deployment'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from create' -f -l image -r -d 'Pre-built image from the local Docker daemon (e.g. myimage:latest). Requires Docker.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from create' -f -l image-tar -r -d 'Pre-built image from an OCI tar file (e.g. ./image.tar). No Docker daemon required.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from create' -f -l attribute -r -d '`KEY=VALUE` attribute pair, may be repeated. Merged with --attributes, taking precedence on conflicting keys.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from create' -f -l attributes -r -d '`JSON` literal or file path containing an object of string key-value pairs. Use "-" to read from stdin.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from create' -f -l no-default-attributes -d 'Omit default git attributes from deployment.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from create' -f -l help -s h -d 'show help'
complete -x -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from create; and not __fish_seen_subcommand_from help h' -a 'help' -d 'Shows a list of commands or help for one command'
complete -x -c lk -n '__fish_seen_subcommand_from agent a; and not __fish_seen_subcommand_from init create dockerfile config deploy promote status update restart rollback logs tail delete destroy versions list secrets update-secrets private-link start dev console daemon simulate help h' -a 'dockerfile' -d 'Generate Dockerfile and .dockerignore for your project'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from dockerfile' -f -l overwrite -d 'Overwrite existing Dockerfile and/or .dockerignore if they exist'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from dockerfile' -f -l overwrite -d 'Overwrite existing Dockerfile and/or .dockerignore if they exist.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from dockerfile' -f -l help -s h -d 'show help'
complete -x -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from dockerfile; and not __fish_seen_subcommand_from help h' -a 'help' -d 'Shows a list of commands or help for one command'
complete -x -c lk -n '__fish_seen_subcommand_from agent a; and not __fish_seen_subcommand_from init create dockerfile config deploy promote status update restart rollback logs tail delete destroy versions list secrets update-secrets private-link start dev console daemon simulate help h' -a 'config' -d 'Creates a livekit.toml in the working directory for an existing agent.'
Expand All @@ -85,12 +86,13 @@ complete -x -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subco
complete -x -c lk -n '__fish_seen_subcommand_from agent a; and not __fish_seen_subcommand_from init create dockerfile config deploy promote status update restart rollback logs tail delete destroy versions list secrets update-secrets private-link start dev console daemon simulate help h' -a 'deploy' -d 'Deploy a new version of the agent'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -f -l attributes -r -d '`JSON` literal or file path containing an object of string key-value pairs. Use "-" to read from stdin.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -f -l attribute -r -d '`KEY=VALUE` attribute pair, may be repeated. Merged with --attributes, taking precedence on conflicting keys.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -f -l no-default-attributes -d 'Omit default git attributes from deployment.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -f -l secrets -r -d 'KEY=VALUE comma separated secrets. These will be injected as environment variables into the agent. These take precedence over secrets-file.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -l secrets-file -r -d '`FILE` containing secret KEY=VALUE pairs, one per line. These will be injected as environment variables into the agent.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -f -l secret-mount -r -d 'Local path to a secret file to be mounted on agent environment'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -f -l secret-mount -r -d 'Local path to a secret file to be mounted on agent environment.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -f -l region -r -d 'Region to deploy the agent to. If unset, will deploy to the nearest region.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -f -l deployment -s d -r -d 'Agent deployment'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -f -l ignore-empty-secrets -d 'If set, will skip environment variables with empty values from secrets files instead of failing'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -f -l ignore-empty-secrets -d 'If set, will skip environment variables with empty values from secrets files instead of failing.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -f -l image -r -d 'Pre-built image from the local Docker daemon (e.g. myimage:latest). Requires Docker.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -f -l image-tar -r -d 'Pre-built image from an OCI tar file (e.g. ./image.tar). No Docker daemon required.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from deploy' -f -l help -s h -d 'show help'
Expand All @@ -108,8 +110,8 @@ complete -x -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subco
complete -x -c lk -n '__fish_seen_subcommand_from agent a; and not __fish_seen_subcommand_from init create dockerfile config deploy promote status update restart rollback logs tail delete destroy versions list secrets update-secrets private-link start dev console daemon simulate help h' -a 'update' -d 'Update an agent metadata and secrets. This will restart the agent.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from update' -f -l secrets -r -d 'KEY=VALUE comma separated secrets. These will be injected as environment variables into the agent. These take precedence over secrets-file.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from update' -l secrets-file -r -d '`FILE` containing secret KEY=VALUE pairs, one per line. These will be injected as environment variables into the agent.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from update' -f -l secret-mount -r -d 'Local path to a secret file to be mounted on agent environment'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from update' -f -l ignore-empty-secrets -d 'If set, will skip environment variables with empty values from secrets files instead of failing'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from update' -f -l secret-mount -r -d 'Local path to a secret file to be mounted on agent environment.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from update' -f -l ignore-empty-secrets -d 'If set, will skip environment variables with empty values from secrets files instead of failing.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from update' -f -l help -s h -d 'show help'
complete -x -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from update; and not __fish_seen_subcommand_from help h' -a 'help' -d 'Shows a list of commands or help for one command'
complete -x -c lk -n '__fish_seen_subcommand_from agent a; and not __fish_seen_subcommand_from init create dockerfile config deploy promote status update restart rollback logs tail delete destroy versions list secrets update-secrets private-link start dev console daemon simulate help h' -a 'restart' -d 'Restart an agent'
Expand All @@ -123,7 +125,7 @@ complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcomma
complete -x -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from rollback; and not __fish_seen_subcommand_from help h' -a 'help' -d 'Shows a list of commands or help for one command'
complete -x -c lk -n '__fish_seen_subcommand_from agent a; and not __fish_seen_subcommand_from init create dockerfile config deploy promote status update restart rollback logs tail delete destroy versions list secrets update-secrets private-link start dev console daemon simulate help h' -a 'logs' -d 'Tail logs from agent'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from logs tail' -f -l id -r -d '`ID` of the agent. If unset, and the livekit.toml file is present, will use the id found there.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from logs tail' -f -l log-type -r -d 'Type of logs to retrieve. Valid values are \'deploy\' and \'build\''
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from logs tail' -f -l log-type -r -d 'Type of logs to retrieve. Valid values are \'deploy\' and \'build\'.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from logs tail' -f -l deployment -s d -r -d 'Agent deployment'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from logs tail' -f -l help -s h -d 'show help'
complete -x -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from logs tail; and not __fish_seen_subcommand_from help h' -a 'help' -d 'Shows a list of commands or help for one command'
Expand Down Expand Up @@ -152,10 +154,10 @@ complete -x -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subco
complete -x -c lk -n '__fish_seen_subcommand_from agent a; and not __fish_seen_subcommand_from init create dockerfile config deploy promote status update restart rollback logs tail delete destroy versions list secrets update-secrets private-link start dev console daemon simulate help h' -a 'update-secrets' -d 'Update secrets for an agent, will cause a re-start of the agent.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from update-secrets' -f -l secrets -r -d 'KEY=VALUE comma separated secrets. These will be injected as environment variables into the agent. These take precedence over secrets-file.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from update-secrets' -l secrets-file -r -d '`FILE` containing secret KEY=VALUE pairs, one per line. These will be injected as environment variables into the agent.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from update-secrets' -f -l secret-mount -r -d 'Local path to a secret file to be mounted on agent environment'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from update-secrets' -f -l ignore-empty-secrets -d 'If set, will skip environment variables with empty values from secrets files instead of failing'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from update-secrets' -f -l secret-mount -r -d 'Local path to a secret file to be mounted on agent environment.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from update-secrets' -f -l ignore-empty-secrets -d 'If set, will skip environment variables with empty values from secrets files instead of failing.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from update-secrets' -f -l id -r -d '`ID` of the agent. If unset, and the livekit.toml file is present, will use the id found there.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from update-secrets' -f -l overwrite -d 'If set, will overwrite existing secrets'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from update-secrets' -f -l overwrite -d 'If set, will overwrite existing secrets.'
complete -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from update-secrets' -f -l help -s h -d 'show help'
complete -x -c lk -n '__fish_seen_subcommand_from agent a; and __fish_seen_subcommand_from update-secrets; and not __fish_seen_subcommand_from help h' -a 'help' -d 'Shows a list of commands or help for one command'
complete -x -c lk -n '__fish_seen_subcommand_from agent a; and not __fish_seen_subcommand_from init create dockerfile config deploy promote status update restart rollback logs tail delete destroy versions list secrets update-secrets private-link start dev console daemon simulate help h' -a 'private-link' -d 'Manage private links for agents'
Expand Down
23 changes: 15 additions & 8 deletions cmd/lk/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ var (
Required: false,
}

noDefaultAttributesFlag = &cli.BoolFlag{
Name: "no-default-attributes",
Usage: `Omit default git attributes from deployment.`,
}

secretsFileFlag = &cli.StringFlag{
Name: "secrets-file",
Usage: "`FILE` containing secret KEY=VALUE pairs, one per line. These will be injected as environment variables into the agent.",
Expand All @@ -91,20 +96,20 @@ var (

secretsMountFlag = &cli.StringSliceFlag{
Name: "secret-mount",
Usage: "Local path to a secret file to be mounted on agent environment",
Usage: "Local path to a secret file to be mounted on agent environment.",
Required: false,
}

ignoreEmptySecretsFlag = &cli.BoolFlag{
Name: "ignore-empty-secrets",
Usage: "If set, will skip environment variables with empty values from secrets files instead of failing",
Usage: "If set, will skip environment variables with empty values from secrets files instead of failing.",
Required: false,
Value: false,
}

logTypeFlag = &cli.StringFlag{
Name: "log-type",
Usage: "Type of logs to retrieve. Valid values are 'deploy' and 'build'",
Usage: "Type of logs to retrieve. Valid values are 'deploy' and 'build'.",
Value: "deploy",
Required: false,
}
Expand Down Expand Up @@ -155,7 +160,7 @@ var (
Flags: [][]cli.Flag{{
&cli.StringFlag{
Name: "lang",
Usage: "`LANGUAGE` of the project, one of \"node\", \"python\"",
Usage: "`LANGUAGE` of the project, one of \"node\", \"python\".",
Action: func(ctx context.Context, cmd *cli.Command, l string) error {
if l == "" {
return nil
Expand All @@ -178,7 +183,7 @@ var (
sandboxFlag,
&cli.BoolFlag{
Name: "no-sandbox",
Usage: "If set, will not create a sandbox for the project. ",
Usage: "If set, will not create a sandbox for the project.",
Value: true,
Hidden: true,
},
Expand Down Expand Up @@ -208,6 +213,7 @@ var (
agentPrebuiltImageTarFlag,
attributeFlag,
attributesFlag,
noDefaultAttributesFlag,
},
// NOTE: since secrets may contain commas, or indeed any special character we might want to treat as a flag separator,
// we disable it entirely here and require multiple --secrets flags to be used.
Expand All @@ -222,7 +228,7 @@ var (
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "overwrite",
Usage: "Overwrite existing Dockerfile and/or .dockerignore if they exist",
Usage: "Overwrite existing Dockerfile and/or .dockerignore if they exist.",
Required: false,
Value: false,
},
Expand All @@ -247,6 +253,7 @@ var (
Flags: []cli.Flag{
attributesFlag,
attributeFlag,
noDefaultAttributesFlag,
secretsFlag,
secretsFileFlag,
secretsMountFlag,
Expand Down Expand Up @@ -398,7 +405,7 @@ var (
idFlag(false),
&cli.BoolFlag{
Name: "overwrite",
Usage: "If set, will overwrite existing secrets",
Usage: "If set, will overwrite existing secrets.",
Required: false,
Value: false,
},
Expand Down Expand Up @@ -1257,7 +1264,7 @@ func resolveDeployAttributes(ctx context.Context, cmd *cli.Command) (map[string]
return nil, err
}

if !util.IsGitRepository(ctx, workingDir) {
if cmd.Bool("no-default-attributes") || !util.IsGitRepository(ctx, workingDir) {
return attrs, nil
}

Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
package livekitcli

const (
Version = "2.18.0"
Version = "2.18.1"
)
Loading