videosdkagent-cli 0.0.1__tar.gz → 0.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/.gitignore +3 -1
  2. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/PKG-INFO +2 -2
  3. videosdkagent_cli-0.0.2/README.md +249 -0
  4. videosdkagent_cli-0.0.2/cli/.gitignore +2 -0
  5. videosdkagent_cli-0.0.2/cli/bin/Activate.ps1 +248 -0
  6. videosdkagent_cli-0.0.2/cli/bin/activate +76 -0
  7. videosdkagent_cli-0.0.2/cli/bin/activate.csh +27 -0
  8. videosdkagent_cli-0.0.2/cli/bin/activate.fish +69 -0
  9. videosdkagent_cli-0.0.2/cli/bin/docutils +7 -0
  10. videosdkagent_cli-0.0.2/cli/bin/keyring +7 -0
  11. videosdkagent_cli-0.0.2/cli/bin/markdown-it +7 -0
  12. videosdkagent_cli-0.0.2/cli/bin/normalizer +7 -0
  13. videosdkagent_cli-0.0.2/cli/bin/pip +7 -0
  14. videosdkagent_cli-0.0.2/cli/bin/pip3 +7 -0
  15. videosdkagent_cli-0.0.2/cli/bin/pip3.13 +7 -0
  16. videosdkagent_cli-0.0.2/cli/bin/pygmentize +7 -0
  17. videosdkagent_cli-0.0.2/cli/bin/pyproject-build +7 -0
  18. videosdkagent_cli-0.0.2/cli/bin/python +1 -0
  19. videosdkagent_cli-0.0.2/cli/bin/python3 +1 -0
  20. videosdkagent_cli-0.0.2/cli/bin/python3.13 +1 -0
  21. videosdkagent_cli-0.0.2/cli/bin/rst2html +7 -0
  22. videosdkagent_cli-0.0.2/cli/bin/rst2html4 +7 -0
  23. videosdkagent_cli-0.0.2/cli/bin/rst2html5 +7 -0
  24. videosdkagent_cli-0.0.2/cli/bin/rst2latex +7 -0
  25. videosdkagent_cli-0.0.2/cli/bin/rst2man +7 -0
  26. videosdkagent_cli-0.0.2/cli/bin/rst2odt +7 -0
  27. videosdkagent_cli-0.0.2/cli/bin/rst2pseudoxml +7 -0
  28. videosdkagent_cli-0.0.2/cli/bin/rst2s5 +7 -0
  29. videosdkagent_cli-0.0.2/cli/bin/rst2xetex +7 -0
  30. videosdkagent_cli-0.0.2/cli/bin/rst2xml +7 -0
  31. videosdkagent_cli-0.0.2/cli/bin/twine +7 -0
  32. videosdkagent_cli-0.0.2/cli/bin/wheel +7 -0
  33. videosdkagent_cli-0.0.2/cli/pyvenv.cfg +5 -0
  34. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/pyproject.toml +2 -2
  35. videosdkagent_cli-0.0.2/videosdk_cli/auth.py +122 -0
  36. videosdkagent_cli-0.0.2/videosdk_cli/build.py +1530 -0
  37. videosdkagent_cli-0.0.2/videosdk_cli/main.py +122 -0
  38. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/videosdk_cli/projects.py +36 -19
  39. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/videosdk_cli/templates.py +87 -32
  40. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/videosdk_cli/utils/analytics.py +4 -3
  41. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/videosdk_cli/utils/api_client.py +26 -24
  42. videosdkagent_cli-0.0.2/videosdk_cli/utils/apis/deployment_client.py +333 -0
  43. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/videosdk_cli/utils/apis/videosdk_auth_api_client.py +5 -6
  44. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/videosdk_cli/utils/auth_api_client.py +2 -2
  45. videosdkagent_cli-0.0.2/videosdk_cli/utils/manager/agent_manager.py +549 -0
  46. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/videosdk_cli/utils/template_helper.py +102 -28
  47. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/videosdk_cli/utils/ui/progress_runner.py +15 -7
  48. videosdkagent_cli-0.0.2/videosdk_cli/utils/ui/theme.py +144 -0
  49. videosdkagent_cli-0.0.2/videosdk_cli/utils/videosdk_yaml_helper.py +225 -0
  50. videosdkagent_cli-0.0.1/README.md +0 -103
  51. videosdkagent_cli-0.0.1/videosdk_cli/auth.py +0 -57
  52. videosdkagent_cli-0.0.1/videosdk_cli/build.py +0 -430
  53. videosdkagent_cli-0.0.1/videosdk_cli/main.py +0 -89
  54. videosdkagent_cli-0.0.1/videosdk_cli/secret_set.py +0 -82
  55. videosdkagent_cli-0.0.1/videosdk_cli/utils/apis/deployment_client.py +0 -172
  56. videosdkagent_cli-0.0.1/videosdk_cli/utils/manager/agent_manager.py +0 -381
  57. videosdkagent_cli-0.0.1/videosdk_cli/utils/videosdk_yaml_helper.py +0 -75
  58. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/videosdk_cli/__init__.py +0 -0
  59. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/videosdk_cli/run_agent.py +0 -0
  60. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/videosdk_cli/utils/__init__.py +0 -0
  61. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/videosdk_cli/utils/apis/error.py +0 -0
  62. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/videosdk_cli/utils/config_manager.py +0 -0
  63. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/videosdk_cli/utils/exceptions.py +0 -0
  64. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/videosdk_cli/utils/project_config.py +0 -0
  65. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/videosdk_cli/utils/template_options.py +0 -0
  66. {videosdkagent_cli-0.0.1 → videosdkagent_cli-0.0.2}/videosdk_cli/utils/ui/kv_blocks.py +0 -0
@@ -213,4 +213,6 @@ marimo/_lsp/
213
213
  __marimo__/
214
214
 
215
215
  # Streamlit
216
- .streamlit/secrets.toml
216
+ .streamlit/secrets.toml
217
+
218
+ .DS_Store
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: videosdkagent-cli
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Summary: VideoSDK CLI tool
5
- Author-email: Krishna <krishna@videosdk.live>
5
+ Author-email: VIDEOSDK <sdk@videosdk.live>
6
6
  Requires-Dist: aiohttp>=3.9.0
7
7
  Requires-Dist: click>=8.1.0
8
8
  Requires-Dist: docker-image-py>=0.1.13
@@ -0,0 +1,249 @@
1
+ # VideoSDK CLI
2
+
3
+ Install the VideoSDK CLI using Python:
4
+
5
+ ```sh
6
+ pip install videosdk-cli
7
+ ```
8
+
9
+ ---
10
+
11
+ ## Authentication
12
+
13
+ ### Login
14
+
15
+ ```sh
16
+ videosdk auth login
17
+ ```
18
+
19
+ ### Logout
20
+
21
+ ```sh
22
+ videosdk auth logout
23
+ ```
24
+
25
+ ---
26
+
27
+ ## Agent Management
28
+
29
+ ### Initialize Agent
30
+
31
+ ```sh
32
+ videosdk agent init --name my-agent
33
+ ```
34
+
35
+ ### Build Docker Image
36
+
37
+ ```sh
38
+ videosdk agent build --image myrepo/myagent:latest --file Dockerfile
39
+ ```
40
+
41
+ ### Push to Registry
42
+
43
+ ```sh
44
+ videosdk agent push --image myrepo/myagent:latest --server docker.io --username user --password pass
45
+ ```
46
+
47
+ ### Deploy Agent
48
+
49
+ ```sh
50
+ videosdk agent deploy [name] --image myrepo/myagent:latest --min-replica 1 --max-replica 5 --profile cpu-small --agent-id <agent-id> --env-secret my-secrets --image-pull-secret my-pull-secret --region us-east
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Version Management
56
+
57
+ ### List Versions
58
+
59
+ ```sh
60
+ videosdk agent version list --agent-id <agent-id>
61
+ ```
62
+
63
+ ### Update Version
64
+
65
+ ```sh
66
+ videosdk agent version update --version-id <version-id> --min-replica 2 --max-replica 10 --profile cpu-medium --image-pull-secret my-secret
67
+ ```
68
+
69
+ ### Activate Version
70
+
71
+ ```sh
72
+ videosdk agent version activate --version-id <version-id> --agent-id <agent-id>
73
+ ```
74
+
75
+ ### Deactivate Version
76
+
77
+ ```sh
78
+ videosdk agent version deactivate --version-id <version-id> --force --agent-id <agent-id>
79
+ ```
80
+
81
+ ### Get Version Status
82
+
83
+ ```sh
84
+ videosdk agent version status --version-id <version-id>
85
+ ```
86
+
87
+ ### Describe Version
88
+
89
+ ```sh
90
+ videosdk agent version describe --version-id <version-id>
91
+ ```
92
+
93
+ ---
94
+
95
+ ## Secret Management
96
+
97
+ ### Create Secret Set
98
+
99
+ ```sh
100
+ videosdk agent secrets create my-secrets --file .env --region us-east
101
+ ```
102
+
103
+ Or interactively:
104
+
105
+ ```sh
106
+ videosdk agent secrets create my-secrets
107
+ ```
108
+
109
+ ### Add Keys to Secret
110
+
111
+ ```sh
112
+ videosdk agent secrets add my-secrets
113
+ ```
114
+
115
+ ### Remove Keys from Secret
116
+
117
+ ```sh
118
+ videosdk agent secrets remove my-secrets
119
+ ```
120
+
121
+ ### Describe Secret
122
+
123
+ ```sh
124
+ videosdk agent secrets describe my-secrets
125
+ ```
126
+
127
+ ### Delete Secret Set
128
+
129
+ ```sh
130
+ videosdk agent secrets delete my-secrets
131
+ ```
132
+
133
+ ### List All Secrets
134
+
135
+ ```sh
136
+ videosdk agent secrets list
137
+ ```
138
+
139
+ ### Create Image Pull Secret
140
+
141
+ ```sh
142
+ videosdk agent image-pull-secret my-registry-secret --region us-east
143
+ ```
144
+
145
+ ---
146
+
147
+ ## Session Management
148
+
149
+ ### Start Session
150
+
151
+ ```sh
152
+ videosdk agent session start --version-id <version-id> --room-id <room-id>
153
+ ```
154
+
155
+ ### Stop Session
156
+
157
+ ```sh
158
+ videosdk agent session stop --room-id <room-id> --session-id <session-id> --end-session
159
+ ```
160
+
161
+ ### List Sessions
162
+
163
+ ```sh
164
+ videosdk agent sessions --version-id <version-id> --agent-id <agent-id> --active --region us-east
165
+ ```
166
+
167
+ ---
168
+
169
+ ## Templates
170
+
171
+ ### List Templates
172
+
173
+ ```sh
174
+ videosdk template list
175
+ ```
176
+
177
+ Example output:
178
+
179
+ | Template id | File Name | Description |
180
+ | --------------------------- | ------------------------------ | --------------------------------------------------- |
181
+ | ai-agent-cascading-pipeline | ai-agent-cascading-pipeline.py | AI Agent with a cascading, multi-provider pipeline. |
182
+ | ai-agent-real-time-pipeline | ai-agent-real-time-pipeline.py | AI Agent with a real-time pipeline. |
183
+
184
+ ### Create Project from Template
185
+
186
+ ```sh
187
+ videosdk template get -t ai-agent-cascading-pipeline my-app
188
+ ```
189
+
190
+ ---
191
+
192
+ ## Run Local Agent
193
+
194
+ ```sh
195
+ videosdk run my-app
196
+ ```
197
+
198
+ This will:
199
+
200
+ 1. Create/use a virtual environment
201
+ 2. Install requirements
202
+ 3. Run the agent in console mode
203
+
204
+ Example output:
205
+
206
+ ```sh
207
+ Running project 'my-app'...
208
+ [✓] model_quantized.onnx already downloaded.
209
+ ====================================================================================================
210
+ Videosdk's AI Agent Console Mode
211
+ ====================================================================================================
212
+ Session end callback configured
213
+ Waiting for participant...
214
+ Participant joined
215
+ 2025-10-13 12:21:20,846 - INFO - agent output speech: Hello, how can I help you today?
216
+ Agent is running... (will exit automatically when participants leave)
217
+ ```
218
+
219
+ ---
220
+
221
+ ## Command Reference
222
+
223
+ | Command | Description |
224
+ | ---------------------------------------- | ------------------------ |
225
+ | `videosdk auth login` | Login to VideoSDK |
226
+ | `videosdk auth logout` | Logout from VideoSDK |
227
+ | `videosdk agent init` | Initialize agent |
228
+ | `videosdk agent build` | Build Docker image |
229
+ | `videosdk agent push` | Push image to registry |
230
+ | `videosdk agent deploy` | Deploy new version |
231
+ | `videosdk agent version list` | List versions |
232
+ | `videosdk agent version update` | Update version |
233
+ | `videosdk agent version activate` | Activate version |
234
+ | `videosdk agent version deactivate` | Deactivate version |
235
+ | `videosdk agent version status` | Get version status |
236
+ | `videosdk agent version describe` | Describe version |
237
+ | `videosdk agent secrets create <name>` | Create secret set |
238
+ | `videosdk agent secrets add <name>` | Add keys to secret |
239
+ | `videosdk agent secrets remove <name>` | Remove keys from secret |
240
+ | `videosdk agent secrets describe <name>` | Describe secret |
241
+ | `videosdk agent secrets delete <name>` | Delete secret set |
242
+ | `videosdk agent secrets list` | List all secrets |
243
+ | `videosdk agent image-pull-secret` | Create image pull secret |
244
+ | `videosdk agent session start` | Start agent session |
245
+ | `videosdk agent session stop` | Stop agent session |
246
+ | `videosdk agent sessions` | List sessions |
247
+ | `videosdk template list` | List templates |
248
+ | `videosdk template get` | Create from template |
249
+ | `videosdk run` | Run local agent |
@@ -0,0 +1,2 @@
1
+ # Created by venv; see https://docs.python.org/3/library/venv.html
2
+ *
@@ -0,0 +1,248 @@
1
+ <#
2
+ .Synopsis
3
+ Activate a Python virtual environment for the current PowerShell session.
4
+
5
+ .Description
6
+ Pushes the python executable for a virtual environment to the front of the
7
+ $Env:PATH environment variable and sets the prompt to signify that you are
8
+ in a Python virtual environment. Makes use of the command line switches as
9
+ well as the `pyvenv.cfg` file values present in the virtual environment.
10
+
11
+ .Parameter VenvDir
12
+ Path to the directory that contains the virtual environment to activate. The
13
+ default value for this is the parent of the directory that the Activate.ps1
14
+ script is located within.
15
+
16
+ .Parameter Prompt
17
+ The prompt prefix to display when this virtual environment is activated. By
18
+ default, this prompt is the name of the virtual environment folder (VenvDir)
19
+ surrounded by parentheses and followed by a single space (ie. '(.venv) ').
20
+
21
+ .Example
22
+ Activate.ps1
23
+ Activates the Python virtual environment that contains the Activate.ps1 script.
24
+
25
+ .Example
26
+ Activate.ps1 -Verbose
27
+ Activates the Python virtual environment that contains the Activate.ps1 script,
28
+ and shows extra information about the activation as it executes.
29
+
30
+ .Example
31
+ Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv
32
+ Activates the Python virtual environment located in the specified location.
33
+
34
+ .Example
35
+ Activate.ps1 -Prompt "MyPython"
36
+ Activates the Python virtual environment that contains the Activate.ps1 script,
37
+ and prefixes the current prompt with the specified string (surrounded in
38
+ parentheses) while the virtual environment is active.
39
+
40
+ .Notes
41
+ On Windows, it may be required to enable this Activate.ps1 script by setting the
42
+ execution policy for the user. You can do this by issuing the following PowerShell
43
+ command:
44
+
45
+ PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
46
+
47
+ For more information on Execution Policies:
48
+ https://go.microsoft.com/fwlink/?LinkID=135170
49
+
50
+ #>
51
+ Param(
52
+ [Parameter(Mandatory = $false)]
53
+ [String]
54
+ $VenvDir,
55
+ [Parameter(Mandatory = $false)]
56
+ [String]
57
+ $Prompt
58
+ )
59
+
60
+ <# Function declarations --------------------------------------------------- #>
61
+
62
+ <#
63
+ .Synopsis
64
+ Remove all shell session elements added by the Activate script, including the
65
+ addition of the virtual environment's Python executable from the beginning of
66
+ the PATH variable.
67
+
68
+ .Parameter NonDestructive
69
+ If present, do not remove this function from the global namespace for the
70
+ session.
71
+
72
+ #>
73
+ function global:deactivate ([switch]$NonDestructive) {
74
+ # Revert to original values
75
+
76
+ # The prior prompt:
77
+ if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) {
78
+ Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt
79
+ Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT
80
+ }
81
+
82
+ # The prior PYTHONHOME:
83
+ if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) {
84
+ Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME
85
+ Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME
86
+ }
87
+
88
+ # The prior PATH:
89
+ if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) {
90
+ Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH
91
+ Remove-Item -Path Env:_OLD_VIRTUAL_PATH
92
+ }
93
+
94
+ # Just remove the VIRTUAL_ENV altogether:
95
+ if (Test-Path -Path Env:VIRTUAL_ENV) {
96
+ Remove-Item -Path env:VIRTUAL_ENV
97
+ }
98
+
99
+ # Just remove VIRTUAL_ENV_PROMPT altogether.
100
+ if (Test-Path -Path Env:VIRTUAL_ENV_PROMPT) {
101
+ Remove-Item -Path env:VIRTUAL_ENV_PROMPT
102
+ }
103
+
104
+ # Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether:
105
+ if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) {
106
+ Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force
107
+ }
108
+
109
+ # Leave deactivate function in the global namespace if requested:
110
+ if (-not $NonDestructive) {
111
+ Remove-Item -Path function:deactivate
112
+ }
113
+ }
114
+
115
+ <#
116
+ .Description
117
+ Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the
118
+ given folder, and returns them in a map.
119
+
120
+ For each line in the pyvenv.cfg file, if that line can be parsed into exactly
121
+ two strings separated by `=` (with any amount of whitespace surrounding the =)
122
+ then it is considered a `key = value` line. The left hand string is the key,
123
+ the right hand is the value.
124
+
125
+ If the value starts with a `'` or a `"` then the first and last character is
126
+ stripped from the value before being captured.
127
+
128
+ .Parameter ConfigDir
129
+ Path to the directory that contains the `pyvenv.cfg` file.
130
+ #>
131
+ function Get-PyVenvConfig(
132
+ [String]
133
+ $ConfigDir
134
+ ) {
135
+ Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg"
136
+
137
+ # Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue).
138
+ $pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue
139
+
140
+ # An empty map will be returned if no config file is found.
141
+ $pyvenvConfig = @{ }
142
+
143
+ if ($pyvenvConfigPath) {
144
+
145
+ Write-Verbose "File exists, parse `key = value` lines"
146
+ $pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath
147
+
148
+ $pyvenvConfigContent | ForEach-Object {
149
+ $keyval = $PSItem -split "\s*=\s*", 2
150
+ if ($keyval[0] -and $keyval[1]) {
151
+ $val = $keyval[1]
152
+
153
+ # Remove extraneous quotations around a string value.
154
+ if ("'""".Contains($val.Substring(0, 1))) {
155
+ $val = $val.Substring(1, $val.Length - 2)
156
+ }
157
+
158
+ $pyvenvConfig[$keyval[0]] = $val
159
+ Write-Verbose "Adding Key: '$($keyval[0])'='$val'"
160
+ }
161
+ }
162
+ }
163
+ return $pyvenvConfig
164
+ }
165
+
166
+
167
+ <# Begin Activate script --------------------------------------------------- #>
168
+
169
+ # Determine the containing directory of this script
170
+ $VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
171
+ $VenvExecDir = Get-Item -Path $VenvExecPath
172
+
173
+ Write-Verbose "Activation script is located in path: '$VenvExecPath'"
174
+ Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)"
175
+ Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)"
176
+
177
+ # Set values required in priority: CmdLine, ConfigFile, Default
178
+ # First, get the location of the virtual environment, it might not be
179
+ # VenvExecDir if specified on the command line.
180
+ if ($VenvDir) {
181
+ Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values"
182
+ }
183
+ else {
184
+ Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir."
185
+ $VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/")
186
+ Write-Verbose "VenvDir=$VenvDir"
187
+ }
188
+
189
+ # Next, read the `pyvenv.cfg` file to determine any required value such
190
+ # as `prompt`.
191
+ $pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir
192
+
193
+ # Next, set the prompt from the command line, or the config file, or
194
+ # just use the name of the virtual environment folder.
195
+ if ($Prompt) {
196
+ Write-Verbose "Prompt specified as argument, using '$Prompt'"
197
+ }
198
+ else {
199
+ Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value"
200
+ if ($pyvenvCfg -and $pyvenvCfg['prompt']) {
201
+ Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'"
202
+ $Prompt = $pyvenvCfg['prompt'];
203
+ }
204
+ else {
205
+ Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)"
206
+ Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'"
207
+ $Prompt = Split-Path -Path $venvDir -Leaf
208
+ }
209
+ }
210
+
211
+ Write-Verbose "Prompt = '$Prompt'"
212
+ Write-Verbose "VenvDir='$VenvDir'"
213
+
214
+ # Deactivate any currently active virtual environment, but leave the
215
+ # deactivate function in place.
216
+ deactivate -nondestructive
217
+
218
+ # Now set the environment variable VIRTUAL_ENV, used by many tools to determine
219
+ # that there is an activated venv.
220
+ $env:VIRTUAL_ENV = $VenvDir
221
+
222
+ $env:VIRTUAL_ENV_PROMPT = $Prompt
223
+
224
+ if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) {
225
+
226
+ Write-Verbose "Setting prompt to '$Prompt'"
227
+
228
+ # Set the prompt to include the env name
229
+ # Make sure _OLD_VIRTUAL_PROMPT is global
230
+ function global:_OLD_VIRTUAL_PROMPT { "" }
231
+ Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT
232
+ New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt
233
+
234
+ function global:prompt {
235
+ Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) "
236
+ _OLD_VIRTUAL_PROMPT
237
+ }
238
+ }
239
+
240
+ # Clear PYTHONHOME
241
+ if (Test-Path -Path Env:PYTHONHOME) {
242
+ Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME
243
+ Remove-Item -Path Env:PYTHONHOME
244
+ }
245
+
246
+ # Add the venv to the PATH
247
+ Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH
248
+ $Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH"
@@ -0,0 +1,76 @@
1
+ # This file must be used with "source bin/activate" *from bash*
2
+ # You cannot run it directly
3
+
4
+ deactivate () {
5
+ # reset old environment variables
6
+ if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
7
+ PATH="${_OLD_VIRTUAL_PATH:-}"
8
+ export PATH
9
+ unset _OLD_VIRTUAL_PATH
10
+ fi
11
+ if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
12
+ PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
13
+ export PYTHONHOME
14
+ unset _OLD_VIRTUAL_PYTHONHOME
15
+ fi
16
+
17
+ # Call hash to forget past locations. Without forgetting
18
+ # past locations the $PATH changes we made may not be respected.
19
+ # See "man bash" for more details. hash is usually a builtin of your shell
20
+ hash -r 2> /dev/null
21
+
22
+ if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
23
+ PS1="${_OLD_VIRTUAL_PS1:-}"
24
+ export PS1
25
+ unset _OLD_VIRTUAL_PS1
26
+ fi
27
+
28
+ unset VIRTUAL_ENV
29
+ unset VIRTUAL_ENV_PROMPT
30
+ if [ ! "${1:-}" = "nondestructive" ] ; then
31
+ # Self destruct!
32
+ unset -f deactivate
33
+ fi
34
+ }
35
+
36
+ # unset irrelevant variables
37
+ deactivate nondestructive
38
+
39
+ # on Windows, a path can contain colons and backslashes and has to be converted:
40
+ case "$(uname)" in
41
+ CYGWIN*|MSYS*|MINGW*)
42
+ # transform D:\path\to\venv to /d/path/to/venv on MSYS and MINGW
43
+ # and to /cygdrive/d/path/to/venv on Cygwin
44
+ VIRTUAL_ENV=$(cygpath /Users/parth/test_cli/agent-cli/agents-cli/cli)
45
+ export VIRTUAL_ENV
46
+ ;;
47
+ *)
48
+ # use the path as-is
49
+ export VIRTUAL_ENV=/Users/parth/test_cli/agent-cli/agents-cli/cli
50
+ ;;
51
+ esac
52
+
53
+ _OLD_VIRTUAL_PATH="$PATH"
54
+ PATH="$VIRTUAL_ENV/"bin":$PATH"
55
+ export PATH
56
+
57
+ VIRTUAL_ENV_PROMPT=cli
58
+ export VIRTUAL_ENV_PROMPT
59
+
60
+ # unset PYTHONHOME if set
61
+ # this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
62
+ # could use `if (set -u; : $PYTHONHOME) ;` in bash
63
+ if [ -n "${PYTHONHOME:-}" ] ; then
64
+ _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
65
+ unset PYTHONHOME
66
+ fi
67
+
68
+ if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
69
+ _OLD_VIRTUAL_PS1="${PS1:-}"
70
+ PS1="("cli") ${PS1:-}"
71
+ export PS1
72
+ fi
73
+
74
+ # Call hash to forget past commands. Without forgetting
75
+ # past commands the $PATH changes we made may not be respected
76
+ hash -r 2> /dev/null
@@ -0,0 +1,27 @@
1
+ # This file must be used with "source bin/activate.csh" *from csh*.
2
+ # You cannot run it directly.
3
+
4
+ # Created by Davide Di Blasi <davidedb@gmail.com>.
5
+ # Ported to Python 3.3 venv by Andrew Svetlov <andrew.svetlov@gmail.com>
6
+
7
+ alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate'
8
+
9
+ # Unset irrelevant variables.
10
+ deactivate nondestructive
11
+
12
+ setenv VIRTUAL_ENV /Users/parth/test_cli/agent-cli/agents-cli/cli
13
+
14
+ set _OLD_VIRTUAL_PATH="$PATH"
15
+ setenv PATH "$VIRTUAL_ENV/"bin":$PATH"
16
+ setenv VIRTUAL_ENV_PROMPT cli
17
+
18
+
19
+ set _OLD_VIRTUAL_PROMPT="$prompt"
20
+
21
+ if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
22
+ set prompt = "("cli") $prompt:q"
23
+ endif
24
+
25
+ alias pydoc python -m pydoc
26
+
27
+ rehash
@@ -0,0 +1,69 @@
1
+ # This file must be used with "source <venv>/bin/activate.fish" *from fish*
2
+ # (https://fishshell.com/). You cannot run it directly.
3
+
4
+ function deactivate -d "Exit virtual environment and return to normal shell environment"
5
+ # reset old environment variables
6
+ if test -n "$_OLD_VIRTUAL_PATH"
7
+ set -gx PATH $_OLD_VIRTUAL_PATH
8
+ set -e _OLD_VIRTUAL_PATH
9
+ end
10
+ if test -n "$_OLD_VIRTUAL_PYTHONHOME"
11
+ set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
12
+ set -e _OLD_VIRTUAL_PYTHONHOME
13
+ end
14
+
15
+ if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
16
+ set -e _OLD_FISH_PROMPT_OVERRIDE
17
+ # prevents error when using nested fish instances (Issue #93858)
18
+ if functions -q _old_fish_prompt
19
+ functions -e fish_prompt
20
+ functions -c _old_fish_prompt fish_prompt
21
+ functions -e _old_fish_prompt
22
+ end
23
+ end
24
+
25
+ set -e VIRTUAL_ENV
26
+ set -e VIRTUAL_ENV_PROMPT
27
+ if test "$argv[1]" != "nondestructive"
28
+ # Self-destruct!
29
+ functions -e deactivate
30
+ end
31
+ end
32
+
33
+ # Unset irrelevant variables.
34
+ deactivate nondestructive
35
+
36
+ set -gx VIRTUAL_ENV /Users/parth/test_cli/agent-cli/agents-cli/cli
37
+
38
+ set -gx _OLD_VIRTUAL_PATH $PATH
39
+ set -gx PATH "$VIRTUAL_ENV/"bin $PATH
40
+ set -gx VIRTUAL_ENV_PROMPT cli
41
+
42
+ # Unset PYTHONHOME if set.
43
+ if set -q PYTHONHOME
44
+ set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
45
+ set -e PYTHONHOME
46
+ end
47
+
48
+ if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
49
+ # fish uses a function instead of an env var to generate the prompt.
50
+
51
+ # Save the current fish_prompt function as the function _old_fish_prompt.
52
+ functions -c fish_prompt _old_fish_prompt
53
+
54
+ # With the original prompt function renamed, we can override with our own.
55
+ function fish_prompt
56
+ # Save the return status of the last command.
57
+ set -l old_status $status
58
+
59
+ # Output the venv prompt; color taken from the blue of the Python logo.
60
+ printf "%s(%s)%s " (set_color 4B8BBE) cli (set_color normal)
61
+
62
+ # Restore the return status of the previous command.
63
+ echo "exit $old_status" | .
64
+ # Output the original/"old" prompt.
65
+ _old_fish_prompt
66
+ end
67
+
68
+ set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
69
+ end
@@ -0,0 +1,7 @@
1
+ #!/Users/parth/test_cli/agent-cli/agents-cli/cli/bin/python3
2
+ import sys
3
+ from docutils.__main__ import main
4
+ if __name__ == '__main__':
5
+ if sys.argv[0].endswith('.exe'):
6
+ sys.argv[0] = sys.argv[0][:-4]
7
+ sys.exit(main())