Skip to content

Add explicit language selector in lk agent CLI #744

@dimasimonowich

Description

@dimasimonowich

Hi,
At the moment, I'm working on a project that is orchestrated by the pnpm, so I have a package.json in all services.

However, the agent-related service is written in Python, so it has a pyproject.toml (uv) as well. However, when I try to run

lk agent create

or

lk agent deploy

it sees the package.json and assumes it's a Node.js service. Then failing since:

package @livekit/agents not found in any project files

If I simply delete/rename package.json, everything works fine. However, this isn't an option for me due to the existing project architecture.

The CLI does not provide an option to manually select the project type; instead, it defines it on its own.

livekit-cli/cmd/lk/agent.go

Lines 543 to 547 in c18eb7a

projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir))
if err != nil {
return fmt.Errorf("unable to determine agent language: %w, please navigate to a directory containing an agent written in a supported language", err)
}
fmt.Printf("Detected agent language [%s]\n", util.Accented(string(projectType)))

func DetectProjectType(dir fs.FS) (ProjectType, error) {

It would be very helpful if anyone could add at least --language flag to the deploy command with python or node options.

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions