Skip to content

Allow using uv venv with --format=json #5279

Open
@InSyncWithFoo

Description

@InSyncWithFoo

This is what uv venv currently outputs on Windows:

Using Python 3.12.4 interpreter at: ...\python.exe
Creating virtualenv at: .venv
Activate with: .venv\Scripts\activate

It is good for human consumption, but not so much for machines. I propose that uv venv outputs a JSON object in the following format when used with --format=json:

interface VenvOutput {
  python: string;
  venv: string;
  activateCommand: string;
}

Example output:

{
  "python": "...\\python.exe",
  "venv": ".venv",
  "activateCommand": ".venv\\Scripts\\activate"
}

This is a subtask of #3199.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliRelated to the command line interfaceenhancementNew feature or improvement to existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions