tavus-cli 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1,192 @@
1
+ Metadata-Version: 2.4
2
+ Name: tavus-cli
3
+ Version: 0.1.0
4
+ Summary: Tavus CLI and MCP server for agentic persona creation and editing.
5
+ Requires-Python: >=3.11
6
+ Requires-Dist: fastmcp>=2.0.0
7
+ Requires-Dist: httpx>=0.27.0
8
+ Requires-Dist: jsonpatch>=1.33
9
+ Requires-Dist: keyring>=25.0.0
10
+ Requires-Dist: pydantic>=2.7.0
11
+ Requires-Dist: python-dotenv>=1.0.0
12
+ Requires-Dist: rich>=13.7.0
13
+ Requires-Dist: typer>=0.12.0
14
+ Provides-Extra: dev
15
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
16
+ Requires-Dist: pytest>=8.2.0; extra == 'dev'
17
+ Requires-Dist: respx>=0.21.0; extra == 'dev'
18
+ Requires-Dist: ruff>=0.8.0; extra == 'dev'
19
+ Description-Content-Type: text/markdown
20
+
21
+ # tavus-cli
22
+
23
+ Agent-facing surfaces that let another agent (Claude, Codex, or any MCP-aware client) drive Tavus persona creation end-to-end — separate from the human-facing Conversational Persona Builder.
24
+
25
+ ## What's here
26
+
27
+ - **MCP server.** Persona CRUD plus mutations for tools, KB, guardrails, pronunciation dicts, layers, and objectives. Local stdio for IDE-embedded clients, remote (Cloudflare Worker) for hosted agents.
28
+ - **CLI.** Scripted persona authoring + publish. `tavus persona list / options / patch`, JSON round-tripping, OS-keychain auth.
29
+ - **Codex skill.** Publishable skill so an external agent can invoke the MCP server and CLI without reading the full Tavus API.
30
+
31
+ ## Why standalone (not under Conversational Persona Builder)
32
+
33
+ The CPB project is the **human** builder — replica-driven, in-product. This repo is for **agents driving the API** without that UI. Adjacent in code and concepts, but a different deliverable and audience.
34
+
35
+ ## Out of scope (for now)
36
+
37
+ - Replica/video preview surfaces (lives in CPB)
38
+ - Marketplace / sharing UX
39
+ - Multi-tenant auth beyond the existing dev-portal token model
40
+
41
+ ## Local Setup
42
+
43
+ ```bash
44
+ uv sync --extra dev
45
+ cp .env.example .env
46
+ ```
47
+
48
+ By default the CLI targets production (`PROD`). To switch to the test DB, either set
49
+ `TAVUS_ENV=TEST` in `.env` / your shell or pass `--env TEST` to the CLI. You can set
50
+ `TAVUS_API_KEY` directly for automation or run:
51
+
52
+ ```bash
53
+ uv run tavus auth login
54
+ ```
55
+
56
+ Examples:
57
+
58
+ ```bash
59
+ # Production defaults; only the API key is required.
60
+ TAVUS_API_KEY=... uv run tavus persona list
61
+
62
+ # Test DB without URL overrides.
63
+ TAVUS_ENV=TEST TAVUS_API_KEY=... uv run tavus persona list
64
+ uv run tavus --env TEST persona list
65
+ ```
66
+
67
+ The login flow opens the dev-portal at `/dev/cli-authorize` with a loopback callback URL and an
68
+ anti-CSRF state. The dev-portal mints an API key for your signed-in user (tagged `source: cli`) and
69
+ POSTs it back to the loopback receiver. The CLI stores that key in the OS keychain under the
70
+ selected environment. No Firebase config lives in the CLI — the browser side handles all of it.
71
+
72
+ ## CLI
73
+
74
+ Install the CLI from PyPI:
75
+
76
+ ```bash
77
+ uv tool install tavus-cli
78
+ ```
79
+
80
+ Or run it without installing:
81
+
82
+ ```bash
83
+ uvx --from tavus-cli tavus doctor
84
+ ```
85
+
86
+ Local development commands:
87
+
88
+ ```bash
89
+ uv run tavus doctor
90
+ uv run tavus persona list
91
+ uv run tavus persona options <persona_id>
92
+ uv run tavus persona patch <persona_id> --op replace --path /persona_name --value '"New Name"'
93
+ ```
94
+
95
+ ## MCP
96
+
97
+ ```json
98
+ {
99
+ "mcpServers": {
100
+ "tavus": {
101
+ "command": "uv",
102
+ "args": ["run", "--directory", "/absolute/path/to/tavus-mcp", "tavus-mcp"]
103
+ }
104
+ }
105
+ }
106
+ ```
107
+
108
+ MCP tools return data and file manifests. They do not write files.
109
+
110
+ ## Cloudflare Worker
111
+
112
+ The remote MCP server lives in `workers/tavus-mcp/` and uses Cloudflare's
113
+ stateless `createMcpHandler` transport at `/mcp`.
114
+
115
+ ```bash
116
+ cd workers/tavus-mcp
117
+ npm install
118
+ cp .dev.vars.example .dev.vars
119
+ npm run dev
120
+ ```
121
+
122
+ The local remote-MCP endpoint is `http://127.0.0.1:8787/mcp`.
123
+
124
+ ### Hosted remote MCP
125
+
126
+ Hosted remote MCP clients should point directly at the HTTPS `/mcp` URL. Do not
127
+ put a Tavus API key or shared bearer token in client config. The Worker exposes
128
+ standard OAuth metadata, dynamic client registration, authorize, and token
129
+ endpoints so MCP clients can authenticate through Tavus browser auth.
130
+
131
+ Claude Code example:
132
+
133
+ ```bash
134
+ claude mcp add -s user --transport http tavus https://mcp.tavus-preview.io/mcp
135
+ ```
136
+
137
+ The OAuth authorize step redirects to Tavus developer portal
138
+ `/dev/cli-authorize?mode=oauth`. After the user signs in, the portal mints a
139
+ per-user Tavus API key and redirects back to the MCP client's loopback callback.
140
+ The Worker exchanges that code for an MCP bearer token, then forwards the bearer
141
+ to RQH as `x-api-key`. This keeps Tavus API keys user-scoped and out of MCP
142
+ client configuration.
143
+
144
+ Developer portal must support the `mode=oauth` authorize flow for remote MCP
145
+ auth to complete. If a local portal is running on port 3000, test the full
146
+ browser-auth path against TEST with:
147
+
148
+ ```bash
149
+ cd workers/tavus-mcp
150
+ npm run dev -- --env test --var TAVUS_DEV_PORTAL_URL:http://localhost:3000
151
+
152
+ claude mcp add -s user --transport http tavus-dev http://127.0.0.1:8787/mcp
153
+ ```
154
+
155
+ Keep the Worker environment aligned with the portal environment that minted the
156
+ key. For example, a TEST key from a local or dev portal must hit a Worker running
157
+ with `--env test`, otherwise downstream Tavus API calls will return 401.
158
+
159
+ For Tavus deployment, configure these Cloudflare/GitHub environment secrets:
160
+
161
+ - `CLOUDFLARE_API_TOKEN`
162
+ - `CLOUDFLARE_ACCOUNT_ID`
163
+ - `TAVUS_API_KEY` and `MCP_BEARER_TOKEN` only if you need the legacy shared-token fallback
164
+
165
+ Then run the `Deploy Tavus MCP Worker` workflow for `test`, `stg`, or `prod`.
166
+ The `prod` Wrangler route is configured as a custom domain on `mcp.tavus.io`;
167
+ use `https://mcp.tavus-preview.io/mcp` as the Cloudflare-owned endpoint until
168
+ `mcp.tavus.io` DNS resolves.
169
+ For direct Wrangler usage, the default config targets production; use
170
+ `wrangler deploy --env test` or `wrangler dev --env test` to point at TEST.
171
+
172
+ Useful production checks:
173
+
174
+ ```bash
175
+ curl https://mcp.tavus-preview.io/.well-known/oauth-protected-resource/mcp
176
+ curl https://mcp.tavus-preview.io/.well-known/oauth-authorization-server
177
+ curl -i https://mcp.tavus-preview.io/mcp
178
+ ```
179
+
180
+ Unauthenticated `/mcp` should return `401` with a `WWW-Authenticate` header that
181
+ points at the protected-resource metadata URL. A `404 Not Found` at discovery
182
+ usually means the Worker version serving the custom domain does not include the
183
+ OAuth routes yet.
184
+
185
+ ## Codex Skill
186
+
187
+ A publishable Codex skill for this repo lives at `skills/tavus-agentic-personas/`.
188
+ It documents the CLI and MCP workflows, safe persona patching, environment setup,
189
+ and concrete examples for agents using this toolkit.
190
+
191
+ Install it by copying that folder into `${CODEX_HOME:-$HOME/.codex}/skills/`, or
192
+ publish the folder directly through whatever skill distribution flow you use.
@@ -0,0 +1,32 @@
1
+ tavus_mcp/__init__.py,sha256=Bf7n7dPjnq7c9WlpNZLme3c42IvUZ9-bb-E_vgqA-7I,89
2
+ tavus_mcp/server.py,sha256=an9P5iR-sj__HxUruUnTLvniP0qpTiZs8lt2vMOV5Kc,31264
3
+ tavus_mcp/cli/__init__.py,sha256=CPUhfWHPc8tnymQrvJrZhmoe_KjBRLLKLtWTyMAEMnI,25
4
+ tavus_mcp/cli/main.py,sha256=D8eACndt1a5A6X5wHY7V9mv_1vakUfv6rbiqGma2gvE,49021
5
+ tavus_mcp/sdk/__init__.py,sha256=X9ok70MA8F-64iVlbJVmAlWdx7cfP0NgYYsCFFfGF5U,266
6
+ tavus_mcp/sdk/env.py,sha256=zT8Szz-mJNmeViNcW9EUNJiFvGEP0L_f6l4YaaZ321k,3668
7
+ tavus_mcp/sdk/errors.py,sha256=yLOU2TaXvCoce8JExfIKbNlFJtKqsL3qe53bwDJgt7g,1121
8
+ tavus_mcp/sdk/patch.py,sha256=0aW1oKWGRJmm2wzUYjrn49fCJ4ipntKEnFneFtF02j8,2999
9
+ tavus_mcp/sdk/auth/__init__.py,sha256=nTCHxup2HMZy3-uT53uaNWzK2uE1TY5lNPoYcSSlC_w,20
10
+ tavus_mcp/sdk/auth/keyring_store.py,sha256=lNGVxHINa6Ehuq009VRNbLb1cZazc95i9yKNdzZnmMw,577
11
+ tavus_mcp/sdk/auth/oauth.py,sha256=m_gcVP1Et5kmr2pqFw54__m9sufeyFbQN7sM0K2mDVI,4401
12
+ tavus_mcp/sdk/auth/session.py,sha256=szXMvqbZ_PUb7f_WNq3wuOZfhC-JG1DwLK8tSN7FVDk,1316
13
+ tavus_mcp/sdk/client/__init__.py,sha256=Gb6QAvnRcWqgH7TlXr7q0lq1AKqwBP6GL5PeiEev-i8,77
14
+ tavus_mcp/sdk/client/http.py,sha256=zUK7bKCxjv4Ch9iZuNFUH9pOLeD2GObUEAWaDggIoHQ,17352
15
+ tavus_mcp/sdk/recipes/__init__.py,sha256=W01VrBmZdZ5JHT9weSdDmddtOCXTw5pFyMm3sNiPKnE,350
16
+ tavus_mcp/sdk/recipes/build_and_verify.py,sha256=-pW1ygLZ1UEkSbOkt2KwE_DXl9Lwdy4FzhOzG4o_o9M,22290
17
+ tavus_mcp/sdk/recipes/options.py,sha256=EbR1Grp8gNoqtxC45LrC-mkogCPXHHDkXS9cHAMaEnQ,2365
18
+ tavus_mcp/sdk/recipes/quickstart.py,sha256=aJBtjHDJAHp-BoMkhFAHp0epoL0LG8WC14LILNRnIiA,1604
19
+ tavus_mcp/sdk/recipes/scaffold_embed.py,sha256=GXYNFul4yt5i_Z4JeP3cl6c9II19sYJGd94GeDZkK_c,3366
20
+ tavus_mcp/sdk/recipes/templates.py,sha256=4G_aua4pw7bhef7JtByF2aiTJ_X0-P2BlN1l6EGx1io,2038
21
+ tavus_mcp/sdk/recipes/tool_reuse.py,sha256=S-MIQOxwTYVve7G0wtuDv81EeqnXusExpzSb3bdXJEY,5047
22
+ tavus_mcp/sdk/schemas/__init__.py,sha256=pbnhbdK1FDOlZbVRUuvcFeHFmGrLUXth92_i4ZewZ6I,354
23
+ tavus_mcp/sdk/schemas/file_manifest.py,sha256=B8wf28z_6LWZAuVyVkSYo88-b1RxKP-idthBjZLVlQs,507
24
+ tavus_mcp/sdk/schemas/guardrail.py,sha256=FecA71IaHSGNvPOZkDq_KZO20l81jiTFAqbFIhxiT1o,2932
25
+ tavus_mcp/sdk/schemas/objective.py,sha256=WQ93RhYBD2EWy6HmYkGSy9Yf-ujvL97WSiIEGUGFF6k,5060
26
+ tavus_mcp/sdk/schemas/persona.py,sha256=DYs2wUauvoH52FkNDArEIOF2LpAnlgG04sgsyauRQ1E,6048
27
+ tavus_mcp/sdk/schemas/pronunciation.py,sha256=Ym_5hANzo_6VlFUGnmUVq6Bp1sggOg9AEIScAuj1lRA,2649
28
+ tavus_mcp/sdk/schemas/tool.py,sha256=fC-GPwcPU-Dx1aBswE3ojHXAnOQajsRXyW13Mmak0v0,12546
29
+ tavus_cli-0.1.0.dist-info/METADATA,sha256=gop-inPMlolxVLjvdF3iFe4U3aaCFKl436ESFwIMG0k,6612
30
+ tavus_cli-0.1.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
31
+ tavus_cli-0.1.0.dist-info/entry_points.txt,sha256=nNdleVFT8Fgd60Nx3Ce8soJAbBnV7Hk6Hd0Jy3MEm_4,83
32
+ tavus_cli-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.30.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ tavus = tavus_mcp.cli.main:app
3
+ tavus-mcp = tavus_mcp.server:main
tavus_mcp/__init__.py ADDED
@@ -0,0 +1,4 @@
1
+ """Tavus CLI and MCP server package."""
2
+
3
+ __all__ = ["__version__"]
4
+ __version__ = "0.1.0"
@@ -0,0 +1 @@
1
+ """Typer CLI package."""