Skip to content

Commit fd8ce89

Browse files
committed
chore: add readme
1 parent 3f1ae97 commit fd8ce89

File tree

1 file changed

+32
-8
lines changed

1 file changed

+32
-8
lines changed

README.md

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ The Python Environments and Package Manager extension for VS Code helps you mana
1212

1313
<img src=https://raw.githubusercontent.com/microsoft/vscode-python-environments/main/images/python-envs-overview.gif width=734 height=413>
1414

15-
1615
### Environment Management
1716

1817
This extension provides an Environments view, which can be accessed via the VS Code Activity Bar, where you can manage your Python environments. Here, you can create, delete, and switch between environments, as well as install and uninstall packages within the selected environment. It also provides APIs for extension developers to contribute their own environment managers.
@@ -54,19 +53,44 @@ See [api.ts](https://github.com/microsoft/vscode-python-environments/blob/main/s
5453
To consume these APIs you can look at the example here:
5554
https://github.com/microsoft/vscode-python-environments/blob/main/examples/README.md
5655

56+
### Callable Commands
57+
58+
The extension provides a set of callable commands that can be used to interact with the environment and package managers. These commands can be invoked from other extensions or from the command palette.
59+
60+
#### `python-envs.createAny`
61+
62+
Create a new environment using any of the available environment managers. This command will prompt the user to select the environment manager to use. Following options are available on this command:
63+
64+
```typescript
65+
{
66+
/**
67+
* Default `false`. If `true` the creation provider should show back button when showing QuickPick or QuickInput.
68+
*/
69+
showBackButton?: boolean;
70+
71+
/**
72+
* Default `true`. If `true`, the environment after creation will be selected.
73+
*/
74+
selectEnvironment?: boolean;
75+
}
76+
```
77+
78+
usage: `await vscode.commands.executeCommand('python-envs.createAny', options);`
5779

5880
## Extension Dependency
5981

60-
This section provides an overview of how the Python extension interacts with the Python Environments extension and other tool-specific extensions. The Python Environments extension allows users to create, manage, and remove Python environments and packages. It also provides an API that other extensions can use to support environment management or consume it for running Python tools or projects.
82+
This section provides an overview of how the Python extension interacts with the Python Environments extension and other tool-specific extensions. The Python Environments extension allows users to create, manage, and remove Python environments and packages. It also provides an API that other extensions can use to support environment management or consume it for running Python tools or projects.
6183

6284
Tools that may rely on these APIs in their own extensions include:
63-
- **Debuggers** (e.g., `debugpy`)
64-
- **Linters** (e.g., Pylint, Flake8, Mypy)
65-
- **Formatters** (e.g., Black, autopep8)
66-
- **Language Server extensions** (e.g., Pylance, Jedi)
67-
- **Environment and Package Manager extensions** (e.g., Pixi, Conda, Hatch)
85+
86+
- **Debuggers** (e.g., `debugpy`)
87+
- **Linters** (e.g., Pylint, Flake8, Mypy)
88+
- **Formatters** (e.g., Black, autopep8)
89+
- **Language Server extensions** (e.g., Pylance, Jedi)
90+
- **Environment and Package Manager extensions** (e.g., Pixi, Conda, Hatch)
6891

6992
### API Dependency
93+
7094
The relationship between these extensions can be represented as follows:
7195

7296
<img src=https://raw.githubusercontent.com/microsoft/vscode-python-environments/refs/heads/main/images/extension_relationships.png width=734 height=413>
@@ -75,7 +99,7 @@ Users who do not need to execute code or work in **Virtual Workspaces** can use
7599

76100
### Trust Relationship Between Python and Python Environments Extensions
77101

78-
VS Code supports trust management, allowing extensions to function in either **trusted** or **untrusted** scenarios. Code execution and tools that can modify the user’s environment are typically unavailable in untrusted scenarios.
102+
VS Code supports trust management, allowing extensions to function in either **trusted** or **untrusted** scenarios. Code execution and tools that can modify the user’s environment are typically unavailable in untrusted scenarios.
79103

80104
The relationship is illustrated below:
81105

0 commit comments

Comments
 (0)