videosdk-cli 0.2.0__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.
- videosdk_cli-0.2.0/.gitignore +216 -0
- videosdk_cli-0.2.0/PKG-INFO +15 -0
- videosdk_cli-0.2.0/README.md +103 -0
- videosdk_cli-0.2.0/pyproject.toml +32 -0
- videosdk_cli-0.2.0/videosdk_cli/__init__.py +0 -0
- videosdk_cli-0.2.0/videosdk_cli/auth.py +57 -0
- videosdk_cli-0.2.0/videosdk_cli/build.py +430 -0
- videosdk_cli-0.2.0/videosdk_cli/main.py +89 -0
- videosdk_cli-0.2.0/videosdk_cli/projects.py +117 -0
- videosdk_cli-0.2.0/videosdk_cli/run_agent.py +88 -0
- videosdk_cli-0.2.0/videosdk_cli/secret_set.py +82 -0
- videosdk_cli-0.2.0/videosdk_cli/templates.py +168 -0
- videosdk_cli-0.2.0/videosdk_cli/utils/__init__.py +0 -0
- videosdk_cli-0.2.0/videosdk_cli/utils/analytics.py +61 -0
- videosdk_cli-0.2.0/videosdk_cli/utils/api_client.py +107 -0
- videosdk_cli-0.2.0/videosdk_cli/utils/apis/deployment_client.py +172 -0
- videosdk_cli-0.2.0/videosdk_cli/utils/apis/error.py +10 -0
- videosdk_cli-0.2.0/videosdk_cli/utils/apis/videosdk_auth_api_client.py +58 -0
- videosdk_cli-0.2.0/videosdk_cli/utils/auth_api_client.py +49 -0
- videosdk_cli-0.2.0/videosdk_cli/utils/config_manager.py +66 -0
- videosdk_cli-0.2.0/videosdk_cli/utils/exceptions.py +3 -0
- videosdk_cli-0.2.0/videosdk_cli/utils/manager/agent_manager.py +381 -0
- videosdk_cli-0.2.0/videosdk_cli/utils/project_config.py +87 -0
- videosdk_cli-0.2.0/videosdk_cli/utils/template_helper.py +204 -0
- videosdk_cli-0.2.0/videosdk_cli/utils/template_options.py +51 -0
- videosdk_cli-0.2.0/videosdk_cli/utils/ui/kv_blocks.py +8 -0
- videosdk_cli-0.2.0/videosdk_cli/utils/ui/progress_runner.py +53 -0
- videosdk_cli-0.2.0/videosdk_cli/utils/videosdk_yaml_helper.py +75 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
# Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
# poetry.lock
|
|
109
|
+
# poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
# pdm.lock
|
|
116
|
+
# pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
# pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# Redis
|
|
135
|
+
*.rdb
|
|
136
|
+
*.aof
|
|
137
|
+
*.pid
|
|
138
|
+
|
|
139
|
+
# RabbitMQ
|
|
140
|
+
mnesia/
|
|
141
|
+
rabbitmq/
|
|
142
|
+
rabbitmq-data/
|
|
143
|
+
|
|
144
|
+
# ActiveMQ
|
|
145
|
+
activemq-data/
|
|
146
|
+
|
|
147
|
+
# SageMath parsed files
|
|
148
|
+
*.sage.py
|
|
149
|
+
|
|
150
|
+
# Environments
|
|
151
|
+
.env
|
|
152
|
+
.envrc
|
|
153
|
+
.venv
|
|
154
|
+
env/
|
|
155
|
+
venv/
|
|
156
|
+
ENV/
|
|
157
|
+
env.bak/
|
|
158
|
+
venv.bak/
|
|
159
|
+
|
|
160
|
+
# Spyder project settings
|
|
161
|
+
.spyderproject
|
|
162
|
+
.spyproject
|
|
163
|
+
|
|
164
|
+
# Rope project settings
|
|
165
|
+
.ropeproject
|
|
166
|
+
|
|
167
|
+
# mkdocs documentation
|
|
168
|
+
/site
|
|
169
|
+
|
|
170
|
+
# mypy
|
|
171
|
+
.mypy_cache/
|
|
172
|
+
.dmypy.json
|
|
173
|
+
dmypy.json
|
|
174
|
+
|
|
175
|
+
# Pyre type checker
|
|
176
|
+
.pyre/
|
|
177
|
+
|
|
178
|
+
# pytype static type analyzer
|
|
179
|
+
.pytype/
|
|
180
|
+
|
|
181
|
+
# Cython debug symbols
|
|
182
|
+
cython_debug/
|
|
183
|
+
|
|
184
|
+
# PyCharm
|
|
185
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
186
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
188
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
189
|
+
# .idea/
|
|
190
|
+
|
|
191
|
+
# Abstra
|
|
192
|
+
# Abstra is an AI-powered process automation framework.
|
|
193
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
194
|
+
# Learn more at https://abstra.io/docs
|
|
195
|
+
.abstra/
|
|
196
|
+
|
|
197
|
+
# Visual Studio Code
|
|
198
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
199
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
200
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
201
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
202
|
+
# .vscode/
|
|
203
|
+
|
|
204
|
+
# Ruff stuff:
|
|
205
|
+
.ruff_cache/
|
|
206
|
+
|
|
207
|
+
# PyPI configuration file
|
|
208
|
+
.pypirc
|
|
209
|
+
|
|
210
|
+
# Marimo
|
|
211
|
+
marimo/_static/
|
|
212
|
+
marimo/_lsp/
|
|
213
|
+
__marimo__/
|
|
214
|
+
|
|
215
|
+
# Streamlit
|
|
216
|
+
.streamlit/secrets.toml
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: videosdk-cli
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: VideoSDK CLI tool
|
|
5
|
+
Author-email: Krishna <krishna@videosdk.live>
|
|
6
|
+
Requires-Dist: aiohttp>=3.9.0
|
|
7
|
+
Requires-Dist: click>=8.1.0
|
|
8
|
+
Requires-Dist: docker-image-py>=0.1.13
|
|
9
|
+
Requires-Dist: fastapi>=0.111.0
|
|
10
|
+
Requires-Dist: inquirerpy>=0.3.1
|
|
11
|
+
Requires-Dist: nest-asyncio>=1.5
|
|
12
|
+
Requires-Dist: python-dotenv>=1.0
|
|
13
|
+
Requires-Dist: pyyaml>=6.0
|
|
14
|
+
Requires-Dist: rich>=13.0.0
|
|
15
|
+
Requires-Dist: uvicorn>=0.25.0
|
|
@@ -0,0 +1,103 @@
|
|
|
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 to your VideoSDK account:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
videosdk auth
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Project Management
|
|
24
|
+
|
|
25
|
+
### List Projects
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
videosdk projects
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Example output:
|
|
32
|
+
|
|
33
|
+
| No. | Project Name | Created At | API Key | Status |
|
|
34
|
+
|-----|----------------|-------------------------|-------------------------------------|---------|
|
|
35
|
+
| 1 | CLI test | 2025-10-10T09:43:55.693Z | 4818f6da-fdda-45b3-8121-**** | Active |
|
|
36
|
+
| 2 | New Project | 2025-10-03T12:15:11.586Z | 42706f4d-069c-4b47-b693-**** | Active |
|
|
37
|
+
| 3 | Auto Generated | 2025-09-23T06:53:50.625Z | ba04b195-c6fd-475d-b9cc-**** | Active |
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Select a Project
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
? Select a project: Use ↑ ↓ to navigate, Enter to select
|
|
44
|
+
CLI test (4818f6da-fdda-45b3-8121-****)
|
|
45
|
+
👉 New Project (42706f4d-069c-4b47-b693-****)
|
|
46
|
+
Auto Generated (ba04b195-c6fd-475d-b9cc-****)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### List all Templates
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
videosdk template list
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
| Template Name | File Name | Description |
|
|
56
|
+
|-------------------------------|---------------------------------|-------------------------------------------------------|
|
|
57
|
+
| ai-agent-cascading-pipeline | ai-agent-cascading-pipeline.py | AI Agent with a cascading, multi-provider pipeline. |
|
|
58
|
+
| ai-agent-real-time-pipeline | ai-agent-real-time-pipeline.py | AI Agent with a cascading, multi-provider pipeline. |
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Create and run your own agent
|
|
63
|
+
|
|
64
|
+
### Created Agent
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
videosdk template get -t ai-agent-cascading-pipeline my-app
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Here you will get templates that are preconfigured or custom. According to the template you will have to select providers and give API_KEYs
|
|
71
|
+
|
|
72
|
+
CLI will ask you if you have existing python environment that you want to use or if you want to make new one.
|
|
73
|
+
|
|
74
|
+
Once done you will need to be in parent directory of your agent folder ```../my-app```
|
|
75
|
+
|
|
76
|
+
### Run the agent
|
|
77
|
+
```sh
|
|
78
|
+
videosdk run my-app
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
It will download necessary requirements and will run the agent inside console.
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
videosdk@videosdks-MacBook-Air cli_test % videosdk run my-app
|
|
85
|
+
Running project 'my-app'...
|
|
86
|
+
[✓] model_quantized.onnx already downloaded.
|
|
87
|
+
[✓] model_quantized.onnx already downloaded.
|
|
88
|
+
====================================================================================================
|
|
89
|
+
Videosdk's AI Agent Console Mode
|
|
90
|
+
====================================================================================================
|
|
91
|
+
Session end callback configured
|
|
92
|
+
Waiting for participant...
|
|
93
|
+
Participant joined
|
|
94
|
+
2025-10-13 12:21:20,846 - INFO - agent output speech: Hello, how can I help you today?
|
|
95
|
+
Agent is running... (will exit automatically when participants leave)
|
|
96
|
+
[Audio] cBook Air Microphone [-41.31 dBFS] [############----------------------------]2025-10-13 12:21:28,109 - INFO - eou latency: 149.9921ms
|
|
97
|
+
2025-10-13 12:21:28,109 - INFO - user input speech: Hello?
|
|
98
|
+
2025-10-13 12:21:28,109 - INFO - stt latency: 2110.048ms
|
|
99
|
+
[Audio] cBook Air Microphone [-38.96 dBFS] [#####################-------------------]
|
|
100
|
+
2025-10-13 12:21:28,910 - INFO - llm latency: 798.5704ms
|
|
101
|
+
2025-10-13 12:21:29,114 - INFO - agent output speech: Hello! How can I assist you today?
|
|
102
|
+
2025-10-13 12:21:32,586 - INFO - agent output speech: Goodbye!
|
|
103
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# pyproject.toml
|
|
2
|
+
|
|
3
|
+
[build-system]
|
|
4
|
+
requires = ["hatchling"]
|
|
5
|
+
build-backend = "hatchling.build"
|
|
6
|
+
|
|
7
|
+
[project]
|
|
8
|
+
name = "videosdk-cli"
|
|
9
|
+
version = "0.2.0"
|
|
10
|
+
description = "VideoSDK CLI tool"
|
|
11
|
+
authors = [{name="Krishna", email="krishna@videosdk.live"}]
|
|
12
|
+
dependencies = [
|
|
13
|
+
"click>=8.1.0",
|
|
14
|
+
"aiohttp>=3.9.0",
|
|
15
|
+
"rich>=13.0.0",
|
|
16
|
+
"InquirerPy>=0.3.1",
|
|
17
|
+
"nest_asyncio>=1.5",
|
|
18
|
+
"python-dotenv>=1.0",
|
|
19
|
+
"fastapi>=0.111.0",
|
|
20
|
+
"uvicorn>=0.25.0",
|
|
21
|
+
"PyYAML>=6.0",
|
|
22
|
+
"docker-image-py>=0.1.13"
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[project.scripts]
|
|
26
|
+
# The command name is on the left, the entry point is on the right.
|
|
27
|
+
# The entry point MUST now point to the renamed package.
|
|
28
|
+
videosdk = "videosdk_cli.main:cli" # <-- CRITICAL CHANGE
|
|
29
|
+
|
|
30
|
+
[tool.hatch.build.targets.wheel]
|
|
31
|
+
# This must list the actual package folder name.
|
|
32
|
+
packages = ["videosdk_cli"] # <-- CRITICAL CHANGE
|
|
File without changes
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import click
|
|
3
|
+
from videosdk_cli.utils.config_manager import get_config_value, set_config_value
|
|
4
|
+
from videosdk_cli.utils.api_client import VideoSDKClient
|
|
5
|
+
from videosdk_cli.utils.auth_api_client import AuthAPIClient
|
|
6
|
+
import os
|
|
7
|
+
import webbrowser
|
|
8
|
+
|
|
9
|
+
async def handle_auth():
|
|
10
|
+
API_BASE_URL = os.environ.get("API_BASE_URL","http://localhost:8000")
|
|
11
|
+
client = AuthAPIClient(API_BASE_URL)
|
|
12
|
+
click.echo("ℹ Initiating browser authentication...")
|
|
13
|
+
|
|
14
|
+
data = await client.start_auth()
|
|
15
|
+
|
|
16
|
+
generated_url= os.environ.get("AUTH_DASHBOARD_URL","http://localhost:4949") + f"/cli/confirm-auth?requestId={data['requestId']}"
|
|
17
|
+
webbrowser.open(generated_url)
|
|
18
|
+
|
|
19
|
+
click.echo(f"✔ Opened <{generated_url}> in your default browser.\n")
|
|
20
|
+
|
|
21
|
+
requestId = data["requestId"]
|
|
22
|
+
expires_in = data["expiresIn"]
|
|
23
|
+
|
|
24
|
+
spinner = ["|", "/", "-", "\\"]
|
|
25
|
+
poll_interval = 3
|
|
26
|
+
attempts = expires_in // poll_interval
|
|
27
|
+
|
|
28
|
+
click.echo("Waiting for authentication... ", nl=False)
|
|
29
|
+
|
|
30
|
+
for i in range(attempts):
|
|
31
|
+
click.echo(spinner[i % len(spinner)], nl=False)
|
|
32
|
+
click.echo("\b", nl=False)
|
|
33
|
+
await asyncio.sleep(poll_interval)
|
|
34
|
+
|
|
35
|
+
status = await client.check_status(requestId)
|
|
36
|
+
|
|
37
|
+
if status["status"] == "approved":
|
|
38
|
+
set_config_value("VIDEOSDK_AUTH_TOKEN", status["token"])
|
|
39
|
+
|
|
40
|
+
click.echo(
|
|
41
|
+
f"\n✔ Successfully authenticated)"
|
|
42
|
+
)
|
|
43
|
+
return
|
|
44
|
+
|
|
45
|
+
if status["status"] == "expired":
|
|
46
|
+
raise click.ClickException(
|
|
47
|
+
"Authentication link expired. Please run `videosdk auth` again."
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
raise click.ClickException(
|
|
51
|
+
"Authentication timed out. Please try again."
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
async def handle_logout():
|
|
55
|
+
set_config_value("VIDEOSDK_AUTH_TOKEN", None)
|
|
56
|
+
click.echo("✔ Successfully logged out.")
|
|
57
|
+
|