deepctl 0.1.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.
- deepctl-0.1.0/PKG-INFO +243 -0
- deepctl-0.1.0/README.md +181 -0
- deepctl-0.1.0/pyproject.toml +392 -0
- deepctl-0.1.0/setup.cfg +4 -0
- deepctl-0.1.0/src/deepctl/__init__.py +11 -0
- deepctl-0.1.0/src/deepctl/main.py +178 -0
- deepctl-0.1.0/src/deepctl.egg-info/PKG-INFO +243 -0
- deepctl-0.1.0/src/deepctl.egg-info/SOURCES.txt +10 -0
- deepctl-0.1.0/src/deepctl.egg-info/dependency_links.txt +1 -0
- deepctl-0.1.0/src/deepctl.egg-info/entry_points.txt +4 -0
- deepctl-0.1.0/src/deepctl.egg-info/requires.txt +38 -0
- deepctl-0.1.0/src/deepctl.egg-info/top_level.txt +1 -0
deepctl-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: deepctl
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Official Deepgram CLI for speech recognition and audio intelligence
|
|
5
|
+
Author-email: Deepgram <devrel@deepgram.com>
|
|
6
|
+
Maintainer-email: Deepgram <devrel@deepgram.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/deepgram/cli
|
|
9
|
+
Project-URL: Documentation, https://developers.deepgram.com/docs/cli
|
|
10
|
+
Project-URL: Repository, https://github.com/deepgram/cli
|
|
11
|
+
Project-URL: Bug Tracker, https://github.com/deepgram/cli/issues
|
|
12
|
+
Project-URL: Community, https://discord.gg/deepgram
|
|
13
|
+
Keywords: deepgram,speech,recognition,transcription,audio,cli
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
Requires-Dist: click>=8.0.0
|
|
26
|
+
Requires-Dist: deepgram-sdk>=3.0.0
|
|
27
|
+
Requires-Dist: deepctl-core>=0.1.0
|
|
28
|
+
Requires-Dist: deepctl-cmd-login>=0.1.0
|
|
29
|
+
Requires-Dist: deepctl-cmd-projects>=0.1.0
|
|
30
|
+
Requires-Dist: deepctl-cmd-transcribe>=0.1.0
|
|
31
|
+
Requires-Dist: deepctl-cmd-usage>=0.1.0
|
|
32
|
+
Requires-Dist: deepctl-cmd-mcp>=0.1.0
|
|
33
|
+
Requires-Dist: deepctl-cmd-debug>=0.1.0
|
|
34
|
+
Requires-Dist: deepctl-cmd-debug-browser>=0.1.0
|
|
35
|
+
Requires-Dist: deepctl-cmd-debug-network>=0.1.0
|
|
36
|
+
Requires-Dist: deepctl-cmd-debug-audio>=0.1.0
|
|
37
|
+
Requires-Dist: deepctl-shared-utils>=0.1.0
|
|
38
|
+
Requires-Dist: pydantic>=2.0.0
|
|
39
|
+
Requires-Dist: rich>=13.0.0
|
|
40
|
+
Requires-Dist: httpx>=0.24.0
|
|
41
|
+
Requires-Dist: requests<3.0,>=2.31
|
|
42
|
+
Requires-Dist: pyjwt>=2.8.0
|
|
43
|
+
Requires-Dist: keyring>=24.0.0
|
|
44
|
+
Requires-Dist: pyyaml>=6.0.0
|
|
45
|
+
Requires-Dist: typer>=0.9.0
|
|
46
|
+
Requires-Dist: platformdirs>=3.0.0
|
|
47
|
+
Provides-Extra: dev
|
|
48
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
49
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
50
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
51
|
+
Requires-Dist: pytest-mock>=3.10.0; extra == "dev"
|
|
52
|
+
Requires-Dist: responses>=0.23.0; extra == "dev"
|
|
53
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
54
|
+
Requires-Dist: ruff>=0.8.0; extra == "dev"
|
|
55
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
56
|
+
Requires-Dist: types-PyYAML>=6.0.0; extra == "dev"
|
|
57
|
+
Requires-Dist: types-requests>=2.31.0; extra == "dev"
|
|
58
|
+
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
|
|
59
|
+
Requires-Dist: tox>=4.0.0; extra == "dev"
|
|
60
|
+
Requires-Dist: twine>=4.0.0; extra == "dev"
|
|
61
|
+
Requires-Dist: build>=0.10.0; extra == "dev"
|
|
62
|
+
|
|
63
|
+
# deepctl
|
|
64
|
+
|
|
65
|
+
The official Deepgram CLI.
|
|
66
|
+
|
|
67
|
+
## Quick Start
|
|
68
|
+
|
|
69
|
+
### Try it without installing (like `npx`)
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Using pipx (traditional)
|
|
73
|
+
pipx run deepctl --help
|
|
74
|
+
pipx run deepctl transcribe audio.wav
|
|
75
|
+
|
|
76
|
+
# Using uv (recommended - much faster!)
|
|
77
|
+
uvx deepctl --help
|
|
78
|
+
uvx deepctl transcribe audio.wav
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Install permanently
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Recommended: Using pipx (supports plugins!)
|
|
85
|
+
pipx install deepctl
|
|
86
|
+
|
|
87
|
+
# Alternative: Using uv tool (plugins require manual workarounds)
|
|
88
|
+
uv tool install deepctl
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Usage
|
|
92
|
+
|
|
93
|
+
The CLI provides multiple command aliases for flexibility:
|
|
94
|
+
|
|
95
|
+
- `deepctl` - Primary command
|
|
96
|
+
- `deepgram` - Alternative command
|
|
97
|
+
- `dg` - Short alias
|
|
98
|
+
|
|
99
|
+
### Basic Commands
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Authentication
|
|
103
|
+
deepctl login
|
|
104
|
+
|
|
105
|
+
# Transcribe audio
|
|
106
|
+
deepctl transcribe audio.wav
|
|
107
|
+
deepctl transcribe https://example.com/audio.mp3
|
|
108
|
+
|
|
109
|
+
# Manage projects
|
|
110
|
+
deepctl projects list
|
|
111
|
+
deepctl projects create "My Project"
|
|
112
|
+
|
|
113
|
+
# View usage statistics
|
|
114
|
+
deepctl usage --month 2024-01
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Configuration
|
|
118
|
+
|
|
119
|
+
The CLI supports multiple configuration methods:
|
|
120
|
+
|
|
121
|
+
1. Command-line arguments (highest priority)
|
|
122
|
+
2. Environment variables
|
|
123
|
+
3. User config file (`~/.deepgram/config.yaml`)
|
|
124
|
+
4. Project config file (`./deepgram.yaml`)
|
|
125
|
+
|
|
126
|
+
### Output Formats
|
|
127
|
+
|
|
128
|
+
Choose your preferred output format:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
deepctl transcribe audio.wav --output json
|
|
132
|
+
deepctl transcribe audio.wav --output yaml
|
|
133
|
+
deepctl transcribe audio.wav --output table
|
|
134
|
+
deepctl transcribe audio.wav --output csv
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Development
|
|
138
|
+
|
|
139
|
+
This CLI is built with Python and uses a modular plugin architecture. **Cross-platform compatibility** is a core requirement - the CLI must work identically on Linux, Windows, macOS (Intel), and macOS (Apple Silicon).
|
|
140
|
+
|
|
141
|
+
### Requirements
|
|
142
|
+
|
|
143
|
+
- Python 3.10+
|
|
144
|
+
- `uv`
|
|
145
|
+
- Works on all major platforms:
|
|
146
|
+
- Linux (x86_64, arm64)
|
|
147
|
+
- Windows (x86_64)
|
|
148
|
+
- macOS (Intel x86_64, Apple Silicon arm64)
|
|
149
|
+
|
|
150
|
+
### Install uv
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# macOS/Linux
|
|
154
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
155
|
+
|
|
156
|
+
# Windows
|
|
157
|
+
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Installation for Development
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
git clone https://github.com/deepgram/cli
|
|
164
|
+
cd cli
|
|
165
|
+
|
|
166
|
+
# Create virtual environment and install dependencies
|
|
167
|
+
uv venv
|
|
168
|
+
uv pip install -e ".[dev]"
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Dependencies
|
|
172
|
+
|
|
173
|
+
All dependencies are managed in `pyproject.toml`. Install them with:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
uv pip install -e . # Runtime dependencies
|
|
177
|
+
uv pip install -e ".[dev]" # Development dependencies
|
|
178
|
+
uv pip install -e ".[test]" # Test dependencies
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Workspace Structure
|
|
182
|
+
|
|
183
|
+
This repository is organized as a uv workspace (monorepo) to support multiple related packages:
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
cli/ # Workspace root
|
|
187
|
+
├── src/ # Main CLI package (deepctl)
|
|
188
|
+
│ └── deepgram_cli/
|
|
189
|
+
├── packages/ # Additional workspace packages
|
|
190
|
+
│ └── (future packages)
|
|
191
|
+
└── docs/ # Shared documentation
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
See [Workspace and Monorepo Architecture](docs/Workspace%20and%20Monorepo%20Architecture.md) for detailed information about the workspace structure and how to add new packages.
|
|
195
|
+
|
|
196
|
+
### Running Tests
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
uv run pytest
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Plugin Support
|
|
203
|
+
|
|
204
|
+
### Installing Plugins
|
|
205
|
+
|
|
206
|
+
Deepctl supports external plugins that add custom commands:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
# First, install deepctl globally with pipx
|
|
210
|
+
pipx install deepctl
|
|
211
|
+
|
|
212
|
+
# Then inject plugins into the same environment
|
|
213
|
+
pipx inject deepctl deepctl-plugin-example
|
|
214
|
+
pipx inject deepctl your-custom-plugin
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Creating Plugins
|
|
218
|
+
|
|
219
|
+
Create custom commands by extending the `BaseCommand` class:
|
|
220
|
+
|
|
221
|
+
```python
|
|
222
|
+
from deepctl_core.base_command import BaseCommand
|
|
223
|
+
|
|
224
|
+
class MyCommand(BaseCommand):
|
|
225
|
+
name = "mycommand"
|
|
226
|
+
help = "Description of my command"
|
|
227
|
+
|
|
228
|
+
def handle(self, config, auth_manager, client, **kwargs):
|
|
229
|
+
# Command implementation
|
|
230
|
+
pass
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
See [packages/deepctl-plugin-example](packages/deepctl-plugin-example) for a complete example.
|
|
234
|
+
|
|
235
|
+
## Support
|
|
236
|
+
|
|
237
|
+
- [Documentation](https://developers.deepgram.com/docs/cli)
|
|
238
|
+
- [Community Discord](https://discord.gg/deepgram)
|
|
239
|
+
- [Bug Reports](https://github.com/deepgram/cli/issues)
|
|
240
|
+
|
|
241
|
+
## License
|
|
242
|
+
|
|
243
|
+
MIT License - see LICENSE file for details.
|
deepctl-0.1.0/README.md
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# deepctl
|
|
2
|
+
|
|
3
|
+
The official Deepgram CLI.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
### Try it without installing (like `npx`)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Using pipx (traditional)
|
|
11
|
+
pipx run deepctl --help
|
|
12
|
+
pipx run deepctl transcribe audio.wav
|
|
13
|
+
|
|
14
|
+
# Using uv (recommended - much faster!)
|
|
15
|
+
uvx deepctl --help
|
|
16
|
+
uvx deepctl transcribe audio.wav
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Install permanently
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Recommended: Using pipx (supports plugins!)
|
|
23
|
+
pipx install deepctl
|
|
24
|
+
|
|
25
|
+
# Alternative: Using uv tool (plugins require manual workarounds)
|
|
26
|
+
uv tool install deepctl
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
The CLI provides multiple command aliases for flexibility:
|
|
32
|
+
|
|
33
|
+
- `deepctl` - Primary command
|
|
34
|
+
- `deepgram` - Alternative command
|
|
35
|
+
- `dg` - Short alias
|
|
36
|
+
|
|
37
|
+
### Basic Commands
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Authentication
|
|
41
|
+
deepctl login
|
|
42
|
+
|
|
43
|
+
# Transcribe audio
|
|
44
|
+
deepctl transcribe audio.wav
|
|
45
|
+
deepctl transcribe https://example.com/audio.mp3
|
|
46
|
+
|
|
47
|
+
# Manage projects
|
|
48
|
+
deepctl projects list
|
|
49
|
+
deepctl projects create "My Project"
|
|
50
|
+
|
|
51
|
+
# View usage statistics
|
|
52
|
+
deepctl usage --month 2024-01
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Configuration
|
|
56
|
+
|
|
57
|
+
The CLI supports multiple configuration methods:
|
|
58
|
+
|
|
59
|
+
1. Command-line arguments (highest priority)
|
|
60
|
+
2. Environment variables
|
|
61
|
+
3. User config file (`~/.deepgram/config.yaml`)
|
|
62
|
+
4. Project config file (`./deepgram.yaml`)
|
|
63
|
+
|
|
64
|
+
### Output Formats
|
|
65
|
+
|
|
66
|
+
Choose your preferred output format:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
deepctl transcribe audio.wav --output json
|
|
70
|
+
deepctl transcribe audio.wav --output yaml
|
|
71
|
+
deepctl transcribe audio.wav --output table
|
|
72
|
+
deepctl transcribe audio.wav --output csv
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Development
|
|
76
|
+
|
|
77
|
+
This CLI is built with Python and uses a modular plugin architecture. **Cross-platform compatibility** is a core requirement - the CLI must work identically on Linux, Windows, macOS (Intel), and macOS (Apple Silicon).
|
|
78
|
+
|
|
79
|
+
### Requirements
|
|
80
|
+
|
|
81
|
+
- Python 3.10+
|
|
82
|
+
- `uv`
|
|
83
|
+
- Works on all major platforms:
|
|
84
|
+
- Linux (x86_64, arm64)
|
|
85
|
+
- Windows (x86_64)
|
|
86
|
+
- macOS (Intel x86_64, Apple Silicon arm64)
|
|
87
|
+
|
|
88
|
+
### Install uv
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# macOS/Linux
|
|
92
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
93
|
+
|
|
94
|
+
# Windows
|
|
95
|
+
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Installation for Development
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
git clone https://github.com/deepgram/cli
|
|
102
|
+
cd cli
|
|
103
|
+
|
|
104
|
+
# Create virtual environment and install dependencies
|
|
105
|
+
uv venv
|
|
106
|
+
uv pip install -e ".[dev]"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Dependencies
|
|
110
|
+
|
|
111
|
+
All dependencies are managed in `pyproject.toml`. Install them with:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
uv pip install -e . # Runtime dependencies
|
|
115
|
+
uv pip install -e ".[dev]" # Development dependencies
|
|
116
|
+
uv pip install -e ".[test]" # Test dependencies
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Workspace Structure
|
|
120
|
+
|
|
121
|
+
This repository is organized as a uv workspace (monorepo) to support multiple related packages:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
cli/ # Workspace root
|
|
125
|
+
├── src/ # Main CLI package (deepctl)
|
|
126
|
+
│ └── deepgram_cli/
|
|
127
|
+
├── packages/ # Additional workspace packages
|
|
128
|
+
│ └── (future packages)
|
|
129
|
+
└── docs/ # Shared documentation
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
See [Workspace and Monorepo Architecture](docs/Workspace%20and%20Monorepo%20Architecture.md) for detailed information about the workspace structure and how to add new packages.
|
|
133
|
+
|
|
134
|
+
### Running Tests
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
uv run pytest
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Plugin Support
|
|
141
|
+
|
|
142
|
+
### Installing Plugins
|
|
143
|
+
|
|
144
|
+
Deepctl supports external plugins that add custom commands:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# First, install deepctl globally with pipx
|
|
148
|
+
pipx install deepctl
|
|
149
|
+
|
|
150
|
+
# Then inject plugins into the same environment
|
|
151
|
+
pipx inject deepctl deepctl-plugin-example
|
|
152
|
+
pipx inject deepctl your-custom-plugin
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Creating Plugins
|
|
156
|
+
|
|
157
|
+
Create custom commands by extending the `BaseCommand` class:
|
|
158
|
+
|
|
159
|
+
```python
|
|
160
|
+
from deepctl_core.base_command import BaseCommand
|
|
161
|
+
|
|
162
|
+
class MyCommand(BaseCommand):
|
|
163
|
+
name = "mycommand"
|
|
164
|
+
help = "Description of my command"
|
|
165
|
+
|
|
166
|
+
def handle(self, config, auth_manager, client, **kwargs):
|
|
167
|
+
# Command implementation
|
|
168
|
+
pass
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
See [packages/deepctl-plugin-example](packages/deepctl-plugin-example) for a complete example.
|
|
172
|
+
|
|
173
|
+
## Support
|
|
174
|
+
|
|
175
|
+
- [Documentation](https://developers.deepgram.com/docs/cli)
|
|
176
|
+
- [Community Discord](https://discord.gg/deepgram)
|
|
177
|
+
- [Bug Reports](https://github.com/deepgram/cli/issues)
|
|
178
|
+
|
|
179
|
+
## License
|
|
180
|
+
|
|
181
|
+
MIT License - see LICENSE file for details.
|
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "deepctl"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Official Deepgram CLI for speech recognition and audio intelligence"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
authors = [{ name = "Deepgram", email = "devrel@deepgram.com" }]
|
|
12
|
+
maintainers = [{ name = "Deepgram", email = "devrel@deepgram.com" }]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 3 - Alpha",
|
|
15
|
+
"Intended Audience :: Developers",
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Programming Language :: Python :: 3.10",
|
|
18
|
+
"Programming Language :: Python :: 3.11",
|
|
19
|
+
"Programming Language :: Python :: 3.12",
|
|
20
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
21
|
+
"Topic :: Multimedia :: Sound/Audio :: Speech",
|
|
22
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
23
|
+
]
|
|
24
|
+
keywords = [
|
|
25
|
+
"deepgram",
|
|
26
|
+
"speech",
|
|
27
|
+
"recognition",
|
|
28
|
+
"transcription",
|
|
29
|
+
"audio",
|
|
30
|
+
"cli",
|
|
31
|
+
]
|
|
32
|
+
requires-python = ">=3.10"
|
|
33
|
+
dependencies = [
|
|
34
|
+
"click>=8.0.0",
|
|
35
|
+
"deepgram-sdk>=3.0.0",
|
|
36
|
+
"deepctl-core>=0.1.0", # Core components moved to separate package
|
|
37
|
+
"deepctl-cmd-login>=0.1.0", # Login command package
|
|
38
|
+
"deepctl-cmd-projects>=0.1.0", # Projects command package
|
|
39
|
+
"deepctl-cmd-transcribe>=0.1.0", # Transcribe command package
|
|
40
|
+
"deepctl-cmd-usage>=0.1.0", # Usage command package
|
|
41
|
+
"deepctl-cmd-mcp>=0.1.0", # MCP server command package
|
|
42
|
+
"deepctl-cmd-debug>=0.1.0", # Debug command group package
|
|
43
|
+
"deepctl-cmd-debug-browser>=0.1.0", # Browser debug subcommand
|
|
44
|
+
"deepctl-cmd-debug-network>=0.1.0", # Network debug subcommand
|
|
45
|
+
"deepctl-cmd-debug-audio>=0.1.0", # Audio debug subcommand
|
|
46
|
+
"deepctl-shared-utils>=0.1.0", # Shared utilities
|
|
47
|
+
"pydantic>=2.0.0",
|
|
48
|
+
"rich>=13.0.0",
|
|
49
|
+
"httpx>=0.24.0",
|
|
50
|
+
"requests>=2.31,<3.0",
|
|
51
|
+
"pyjwt>=2.8.0",
|
|
52
|
+
"keyring>=24.0.0",
|
|
53
|
+
"pyyaml>=6.0.0",
|
|
54
|
+
"typer>=0.9.0",
|
|
55
|
+
"platformdirs>=3.0.0",
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
[project.optional-dependencies]
|
|
59
|
+
dev = [
|
|
60
|
+
# Testing
|
|
61
|
+
"pytest>=7.0.0",
|
|
62
|
+
"pytest-asyncio>=0.21.0",
|
|
63
|
+
"pytest-cov>=4.0.0",
|
|
64
|
+
"pytest-mock>=3.10.0",
|
|
65
|
+
"responses>=0.23.0",
|
|
66
|
+
# Code Quality
|
|
67
|
+
"black>=23.0.0",
|
|
68
|
+
"ruff>=0.8.0",
|
|
69
|
+
"mypy>=1.0.0",
|
|
70
|
+
# Type Stubs
|
|
71
|
+
"types-PyYAML>=6.0.0",
|
|
72
|
+
"types-requests>=2.31.0",
|
|
73
|
+
# Development Tools
|
|
74
|
+
"pre-commit>=3.0.0",
|
|
75
|
+
"tox>=4.0.0",
|
|
76
|
+
# Publishing
|
|
77
|
+
"twine>=4.0.0",
|
|
78
|
+
"build>=0.10.0",
|
|
79
|
+
]
|
|
80
|
+
|
|
81
|
+
[project.urls]
|
|
82
|
+
Homepage = "https://github.com/deepgram/cli"
|
|
83
|
+
Documentation = "https://developers.deepgram.com/docs/cli"
|
|
84
|
+
Repository = "https://github.com/deepgram/cli"
|
|
85
|
+
"Bug Tracker" = "https://github.com/deepgram/cli/issues"
|
|
86
|
+
"Community" = "https://discord.gg/deepgram"
|
|
87
|
+
|
|
88
|
+
[project.scripts]
|
|
89
|
+
deepctl = "deepctl.main:main"
|
|
90
|
+
deepgram = "deepctl.main:main"
|
|
91
|
+
dg = "deepctl.main:main"
|
|
92
|
+
|
|
93
|
+
# Entry points are now provided by individual command packages
|
|
94
|
+
# [project.entry-points."deepctl.commands"]
|
|
95
|
+
# transcribe = "deepctl.commands.transcribe:TranscribeCommand"
|
|
96
|
+
# projects = "deepctl.commands.projects:ProjectsCommand"
|
|
97
|
+
# usage = "deepctl.commands.usage:UsageCommand"
|
|
98
|
+
# login = "deepctl.commands.login:LoginCommand"
|
|
99
|
+
|
|
100
|
+
[tool.setuptools]
|
|
101
|
+
package-dir = { "" = "src" }
|
|
102
|
+
|
|
103
|
+
[tool.setuptools.packages.find]
|
|
104
|
+
where = ["src"]
|
|
105
|
+
include = ["deepctl*"]
|
|
106
|
+
|
|
107
|
+
[tool.black]
|
|
108
|
+
line-length = 79
|
|
109
|
+
target-version = ['py310']
|
|
110
|
+
include = '\.pyi?$'
|
|
111
|
+
|
|
112
|
+
[tool.mypy]
|
|
113
|
+
python_version = "3.10"
|
|
114
|
+
strict = true
|
|
115
|
+
files = "src/,packages/*/src"
|
|
116
|
+
|
|
117
|
+
[tool.pytest.ini_options]
|
|
118
|
+
testpaths = ["tests", "packages/*/tests"]
|
|
119
|
+
python_files = ["test_*.py", "*_test.py"]
|
|
120
|
+
python_classes = ["Test*"]
|
|
121
|
+
python_functions = ["test_*"]
|
|
122
|
+
# pythonpath is the correct option name (not python_path)
|
|
123
|
+
pythonpath = ["."]
|
|
124
|
+
# Add package directories to sys.path
|
|
125
|
+
addopts = "--strict-markers --import-mode=importlib"
|
|
126
|
+
markers = [
|
|
127
|
+
"unit: Unit tests",
|
|
128
|
+
"integration: Integration tests",
|
|
129
|
+
"slow: Slow running tests",
|
|
130
|
+
"requires_auth: Tests that require authentication",
|
|
131
|
+
"requires_network: Tests that require network access",
|
|
132
|
+
"benchmark: Benchmark tests",
|
|
133
|
+
]
|
|
134
|
+
|
|
135
|
+
[tool.tox]
|
|
136
|
+
requires = ["tox>=4.19"]
|
|
137
|
+
env_list = ["py310", "py311", "py312", "lint"]
|
|
138
|
+
skip_missing_interpreters = true
|
|
139
|
+
|
|
140
|
+
[tool.tox.env_run_base]
|
|
141
|
+
package = "skip"
|
|
142
|
+
deps = [
|
|
143
|
+
"uv",
|
|
144
|
+
"pytest>=7.0.0",
|
|
145
|
+
"pytest-asyncio>=0.21.0",
|
|
146
|
+
"pytest-cov>=4.0.0",
|
|
147
|
+
"pytest-mock>=3.10.0",
|
|
148
|
+
]
|
|
149
|
+
set_env = { PYTHONDONTWRITEBYTECODE = "1", PYTHONPATH = "{tox_root}" }
|
|
150
|
+
allowlist_externals = ["uv"]
|
|
151
|
+
commands_pre = [
|
|
152
|
+
[
|
|
153
|
+
"uv",
|
|
154
|
+
"pip",
|
|
155
|
+
"install",
|
|
156
|
+
"-e",
|
|
157
|
+
".",
|
|
158
|
+
"-e",
|
|
159
|
+
"packages/deepctl-core",
|
|
160
|
+
"-e",
|
|
161
|
+
"packages/deepctl-shared-utils",
|
|
162
|
+
"-e",
|
|
163
|
+
"packages/deepctl-cmd-login",
|
|
164
|
+
"-e",
|
|
165
|
+
"packages/deepctl-cmd-projects",
|
|
166
|
+
"-e",
|
|
167
|
+
"packages/deepctl-cmd-transcribe",
|
|
168
|
+
"-e",
|
|
169
|
+
"packages/deepctl-cmd-usage",
|
|
170
|
+
"-e",
|
|
171
|
+
"packages/deepctl-cmd-debug",
|
|
172
|
+
"-e",
|
|
173
|
+
"packages/deepctl-cmd-debug-audio",
|
|
174
|
+
"-e",
|
|
175
|
+
"packages/deepctl-cmd-debug-browser",
|
|
176
|
+
"-e",
|
|
177
|
+
"packages/deepctl-cmd-debug-network",
|
|
178
|
+
"-e",
|
|
179
|
+
"packages/deepctl-cmd-mcp",
|
|
180
|
+
],
|
|
181
|
+
]
|
|
182
|
+
change_dir = "{tox_root}"
|
|
183
|
+
commands = [
|
|
184
|
+
[
|
|
185
|
+
"pytest",
|
|
186
|
+
"tests",
|
|
187
|
+
"packages/deepctl-core/tests",
|
|
188
|
+
"packages/deepctl-shared-utils/tests",
|
|
189
|
+
"packages/deepctl-cmd-login/tests",
|
|
190
|
+
"packages/deepctl-cmd-projects/tests",
|
|
191
|
+
"packages/deepctl-cmd-transcribe/tests",
|
|
192
|
+
"packages/deepctl-cmd-usage/tests",
|
|
193
|
+
"packages/deepctl-cmd-debug/tests",
|
|
194
|
+
"packages/deepctl-cmd-debug-audio/tests",
|
|
195
|
+
"packages/deepctl-cmd-debug-browser/tests",
|
|
196
|
+
"packages/deepctl-cmd-debug-network/tests",
|
|
197
|
+
"packages/deepctl-cmd-mcp/tests",
|
|
198
|
+
"--cov=deepctl",
|
|
199
|
+
"--cov=deepctl_core",
|
|
200
|
+
"--cov=deepctl_cmd_login",
|
|
201
|
+
"--cov=deepctl_cmd_projects",
|
|
202
|
+
"--cov=deepctl_cmd_transcribe",
|
|
203
|
+
"--cov=deepctl_cmd_usage",
|
|
204
|
+
"--cov=deepctl_shared_utils",
|
|
205
|
+
"--cov=deepctl_cmd_debug",
|
|
206
|
+
"--cov=deepctl_cmd_debug_audio",
|
|
207
|
+
"--cov=deepctl_cmd_debug_browser",
|
|
208
|
+
"--cov=deepctl_cmd_debug_network",
|
|
209
|
+
"--cov=deepctl_cmd_mcp",
|
|
210
|
+
"--cov-report=term-missing",
|
|
211
|
+
"--cov-report=html",
|
|
212
|
+
"-v",
|
|
213
|
+
],
|
|
214
|
+
]
|
|
215
|
+
|
|
216
|
+
# py310, py311, py312 environments will inherit from env_run_base
|
|
217
|
+
# No need to specify base_python - tox will infer it from the environment name
|
|
218
|
+
|
|
219
|
+
[tool.tox.env.lint]
|
|
220
|
+
# base_python will default to python3.11 as per the env name
|
|
221
|
+
deps = [
|
|
222
|
+
"uv",
|
|
223
|
+
"mypy>=1.0.0",
|
|
224
|
+
"ruff>=0.8.0",
|
|
225
|
+
"black>=23.0.0",
|
|
226
|
+
"types-PyYAML>=6.0.0",
|
|
227
|
+
"types-requests>=2.31.0",
|
|
228
|
+
]
|
|
229
|
+
allowlist_externals = ["uv"]
|
|
230
|
+
commands_pre = [
|
|
231
|
+
[
|
|
232
|
+
"uv",
|
|
233
|
+
"pip",
|
|
234
|
+
"install",
|
|
235
|
+
"-e",
|
|
236
|
+
".",
|
|
237
|
+
"-e",
|
|
238
|
+
"packages/deepctl-core",
|
|
239
|
+
"-e",
|
|
240
|
+
"packages/deepctl-shared-utils",
|
|
241
|
+
],
|
|
242
|
+
]
|
|
243
|
+
commands = [
|
|
244
|
+
[
|
|
245
|
+
"black",
|
|
246
|
+
"--check",
|
|
247
|
+
"src/",
|
|
248
|
+
"packages/deepctl-core/src",
|
|
249
|
+
"packages/deepctl-shared-utils/src",
|
|
250
|
+
"packages/deepctl-cmd-login/src",
|
|
251
|
+
"packages/deepctl-cmd-projects/src",
|
|
252
|
+
"packages/deepctl-cmd-transcribe/src",
|
|
253
|
+
"packages/deepctl-cmd-usage/src",
|
|
254
|
+
"packages/deepctl-cmd-debug/src",
|
|
255
|
+
"packages/deepctl-cmd-debug-audio/src",
|
|
256
|
+
"packages/deepctl-cmd-debug-browser/src",
|
|
257
|
+
"packages/deepctl-cmd-debug-network/src",
|
|
258
|
+
"packages/deepctl-cmd-mcp/src",
|
|
259
|
+
],
|
|
260
|
+
[
|
|
261
|
+
"ruff",
|
|
262
|
+
"check",
|
|
263
|
+
"src/",
|
|
264
|
+
"packages/deepctl-core/src",
|
|
265
|
+
"packages/deepctl-shared-utils/src",
|
|
266
|
+
"packages/deepctl-cmd-login/src",
|
|
267
|
+
"packages/deepctl-cmd-projects/src",
|
|
268
|
+
"packages/deepctl-cmd-transcribe/src",
|
|
269
|
+
"packages/deepctl-cmd-usage/src",
|
|
270
|
+
"packages/deepctl-cmd-debug/src",
|
|
271
|
+
"packages/deepctl-cmd-debug-audio/src",
|
|
272
|
+
"packages/deepctl-cmd-debug-browser/src",
|
|
273
|
+
"packages/deepctl-cmd-debug-network/src",
|
|
274
|
+
"packages/deepctl-cmd-mcp/src",
|
|
275
|
+
],
|
|
276
|
+
[
|
|
277
|
+
"mypy",
|
|
278
|
+
"src/",
|
|
279
|
+
"packages/deepctl-core/src",
|
|
280
|
+
"packages/deepctl-shared-utils/src",
|
|
281
|
+
"packages/deepctl-cmd-login/src",
|
|
282
|
+
"packages/deepctl-cmd-projects/src",
|
|
283
|
+
"packages/deepctl-cmd-transcribe/src",
|
|
284
|
+
"packages/deepctl-cmd-usage/src",
|
|
285
|
+
"packages/deepctl-cmd-debug/src",
|
|
286
|
+
"packages/deepctl-cmd-debug-audio/src",
|
|
287
|
+
"packages/deepctl-cmd-debug-browser/src",
|
|
288
|
+
"packages/deepctl-cmd-debug-network/src",
|
|
289
|
+
"packages/deepctl-cmd-mcp/src",
|
|
290
|
+
],
|
|
291
|
+
]
|
|
292
|
+
|
|
293
|
+
[tool.uv]
|
|
294
|
+
# Optional: uv-specific configuration
|
|
295
|
+
# Uncomment and configure as needed
|
|
296
|
+
|
|
297
|
+
# Set the Python version constraint
|
|
298
|
+
# python = ">=3.10"
|
|
299
|
+
|
|
300
|
+
# Package index configuration
|
|
301
|
+
# index-url = "https://pypi.org/simple"
|
|
302
|
+
# extra-index-url = []
|
|
303
|
+
|
|
304
|
+
# Virtual environment configuration
|
|
305
|
+
# venv = ".venv"
|
|
306
|
+
|
|
307
|
+
# Development dependencies (can also be specified here)
|
|
308
|
+
# dev-dependencies = [
|
|
309
|
+
# "pytest>=7.0.0",
|
|
310
|
+
# "black>=23.0.0",
|
|
311
|
+
# "mypy>=1.0.0",
|
|
312
|
+
# ]
|
|
313
|
+
|
|
314
|
+
[tool.uv.sources]
|
|
315
|
+
# Workspace dependencies
|
|
316
|
+
deepctl-core = { workspace = true }
|
|
317
|
+
deepctl-cmd-login = { workspace = true }
|
|
318
|
+
deepctl-cmd-projects = { workspace = true }
|
|
319
|
+
deepctl-cmd-transcribe = { workspace = true }
|
|
320
|
+
deepctl-cmd-usage = { workspace = true }
|
|
321
|
+
deepctl-cmd-mcp = { workspace = true }
|
|
322
|
+
deepctl-cmd-debug = { workspace = true }
|
|
323
|
+
deepctl-cmd-debug-browser = { workspace = true }
|
|
324
|
+
deepctl-cmd-debug-network = { workspace = true }
|
|
325
|
+
deepctl-cmd-debug-audio = { workspace = true }
|
|
326
|
+
deepctl-shared-utils = { workspace = true }
|
|
327
|
+
|
|
328
|
+
[tool.uv.workspace]
|
|
329
|
+
# Workspace configuration
|
|
330
|
+
members = ["packages/*"]
|
|
331
|
+
|
|
332
|
+
[dependency-groups]
|
|
333
|
+
dev = ["types-pyyaml>=6.0.12.20250516", "types-requests>=2.32.4.20250611"]
|
|
334
|
+
|
|
335
|
+
[tool.ruff]
|
|
336
|
+
# Exclude common directories
|
|
337
|
+
exclude = [
|
|
338
|
+
".git",
|
|
339
|
+
".mypy_cache",
|
|
340
|
+
".tox",
|
|
341
|
+
".venv",
|
|
342
|
+
"__pycache__",
|
|
343
|
+
"dist",
|
|
344
|
+
"build",
|
|
345
|
+
"*.egg-info",
|
|
346
|
+
]
|
|
347
|
+
|
|
348
|
+
# Same line length as Black
|
|
349
|
+
line-length = 88
|
|
350
|
+
|
|
351
|
+
# Target Python 3.10+
|
|
352
|
+
target-version = "py310"
|
|
353
|
+
|
|
354
|
+
[tool.ruff.lint]
|
|
355
|
+
# Enable multiple rule sets
|
|
356
|
+
select = [
|
|
357
|
+
"E", # pycodestyle errors
|
|
358
|
+
"W", # pycodestyle warnings
|
|
359
|
+
"F", # pyflakes
|
|
360
|
+
"I", # isort
|
|
361
|
+
"B", # flake8-bugbear
|
|
362
|
+
"C4", # flake8-comprehensions
|
|
363
|
+
"UP", # pyupgrade
|
|
364
|
+
"ARG", # flake8-unused-arguments
|
|
365
|
+
"SIM", # flake8-simplify
|
|
366
|
+
"TCH", # flake8-type-checking
|
|
367
|
+
"RUF", # Ruff-specific rules
|
|
368
|
+
]
|
|
369
|
+
|
|
370
|
+
# Ignore specific rules
|
|
371
|
+
ignore = [
|
|
372
|
+
"E501", # line too long (handled by formatter)
|
|
373
|
+
"B008", # function calls in argument defaults
|
|
374
|
+
"B904", # raise from exception
|
|
375
|
+
"SIM105", # try-except-pass
|
|
376
|
+
"RUF001", # ambiguous unicode characters (info symbol)
|
|
377
|
+
"ARG001", # unused function arguments (often needed for interfaces)
|
|
378
|
+
"E721", # type comparison (sometimes needed for Pydantic)
|
|
379
|
+
]
|
|
380
|
+
|
|
381
|
+
# Allow autofix for all enabled rules
|
|
382
|
+
fixable = ["ALL"]
|
|
383
|
+
|
|
384
|
+
[tool.ruff.lint.per-file-ignores]
|
|
385
|
+
# Ignore unused imports in __init__ files
|
|
386
|
+
"**/__init__.py" = ["F401"]
|
|
387
|
+
# Ignore imports in tests
|
|
388
|
+
"**/test_*.py" = ["F401", "ARG"]
|
|
389
|
+
# Ignore unused arguments in command handler methods
|
|
390
|
+
"**/command.py" = ["ARG002"]
|
|
391
|
+
"**/commands.py" = ["ARG002"]
|
|
392
|
+
# The root project (deepctl) is implicitly a member since it contains [project]
|
deepctl-0.1.0/setup.cfg
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"""Main entry point for deepctl."""
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
import click
|
|
6
|
+
from deepctl_core import Config, setup_output
|
|
7
|
+
from rich.console import Console
|
|
8
|
+
from rich.traceback import install
|
|
9
|
+
|
|
10
|
+
# Install rich traceback for better error messages
|
|
11
|
+
install(show_locals=True)
|
|
12
|
+
console = Console()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def preprocess_hyphenated_commands(args: list[str]) -> list[str]:
|
|
16
|
+
"""Convert hyphenated commands to nested commands.
|
|
17
|
+
|
|
18
|
+
This function looks for commands in the format 'group-subcommand' and
|
|
19
|
+
converts them to the nested format Click expects (e.g., 'group
|
|
20
|
+
subcommand').
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
args: Command line arguments
|
|
24
|
+
|
|
25
|
+
Returns:
|
|
26
|
+
Modified arguments with hyphenated commands converted to nested format
|
|
27
|
+
"""
|
|
28
|
+
if not args:
|
|
29
|
+
return args
|
|
30
|
+
|
|
31
|
+
# Get all registered commands to know which are groups
|
|
32
|
+
from importlib import metadata
|
|
33
|
+
|
|
34
|
+
group_commands = set()
|
|
35
|
+
|
|
36
|
+
# Discover group commands from entry points
|
|
37
|
+
try:
|
|
38
|
+
entry_points = metadata.entry_points()
|
|
39
|
+
for entry_point in entry_points.select(group="deepctl.commands"):
|
|
40
|
+
# We'll need to check if it's a group, but for now we'll use a
|
|
41
|
+
# heuristic
|
|
42
|
+
subcommand_group = f"deepctl.subcommands.{entry_point.name}"
|
|
43
|
+
try:
|
|
44
|
+
subcommand_eps = list(
|
|
45
|
+
entry_points.select(group=subcommand_group)
|
|
46
|
+
)
|
|
47
|
+
if subcommand_eps:
|
|
48
|
+
group_commands.add(entry_point.name)
|
|
49
|
+
except Exception:
|
|
50
|
+
pass
|
|
51
|
+
except Exception:
|
|
52
|
+
pass
|
|
53
|
+
|
|
54
|
+
# Process arguments
|
|
55
|
+
new_args = []
|
|
56
|
+
i = 0
|
|
57
|
+
|
|
58
|
+
while i < len(args):
|
|
59
|
+
arg = args[i]
|
|
60
|
+
|
|
61
|
+
# Skip if it's an option (starts with -)
|
|
62
|
+
if arg.startswith("-"):
|
|
63
|
+
new_args.append(arg)
|
|
64
|
+
i += 1
|
|
65
|
+
# If it's an option with a value, include the next arg too
|
|
66
|
+
if i < len(args) and not args[i].startswith("-"):
|
|
67
|
+
new_args.append(args[i])
|
|
68
|
+
i += 1
|
|
69
|
+
continue
|
|
70
|
+
|
|
71
|
+
# Check if this could be a hyphenated command
|
|
72
|
+
if "-" in arg and not arg.startswith("-"):
|
|
73
|
+
parts = arg.split("-", 1)
|
|
74
|
+
if len(parts) == 2:
|
|
75
|
+
group_name, subcommand = parts
|
|
76
|
+
|
|
77
|
+
# If the first part is a known group command, convert it
|
|
78
|
+
if group_name in group_commands:
|
|
79
|
+
new_args.extend([group_name, subcommand])
|
|
80
|
+
i += 1
|
|
81
|
+
continue
|
|
82
|
+
|
|
83
|
+
# Otherwise, keep the argument as-is
|
|
84
|
+
new_args.append(arg)
|
|
85
|
+
i += 1
|
|
86
|
+
|
|
87
|
+
return new_args
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
# Create CLI group
|
|
91
|
+
@click.group(name="deepctl")
|
|
92
|
+
@click.version_option(version="0.1.0", prog_name="deepctl")
|
|
93
|
+
@click.option(
|
|
94
|
+
"--config",
|
|
95
|
+
"-c",
|
|
96
|
+
type=click.Path(exists=True),
|
|
97
|
+
help="Path to configuration file",
|
|
98
|
+
)
|
|
99
|
+
@click.option(
|
|
100
|
+
"--profile",
|
|
101
|
+
"-p",
|
|
102
|
+
help="Configuration profile to use",
|
|
103
|
+
)
|
|
104
|
+
@click.option(
|
|
105
|
+
"--output",
|
|
106
|
+
"-o",
|
|
107
|
+
type=click.Choice(["json", "yaml", "table", "csv"], case_sensitive=False),
|
|
108
|
+
help="Output format",
|
|
109
|
+
)
|
|
110
|
+
@click.option(
|
|
111
|
+
"--quiet",
|
|
112
|
+
"-q",
|
|
113
|
+
is_flag=True,
|
|
114
|
+
help="Suppress non-essential output",
|
|
115
|
+
)
|
|
116
|
+
@click.option(
|
|
117
|
+
"--verbose",
|
|
118
|
+
"-v",
|
|
119
|
+
is_flag=True,
|
|
120
|
+
help="Enable verbose output",
|
|
121
|
+
)
|
|
122
|
+
@click.pass_context
|
|
123
|
+
def cli(
|
|
124
|
+
ctx: click.Context,
|
|
125
|
+
config: str | None,
|
|
126
|
+
profile: str | None,
|
|
127
|
+
output: str | None,
|
|
128
|
+
quiet: bool,
|
|
129
|
+
verbose: bool,
|
|
130
|
+
) -> None:
|
|
131
|
+
"""deepctl - Official Deepgram CLI for speech recognition and audio
|
|
132
|
+
intelligence."""
|
|
133
|
+
|
|
134
|
+
# Initialize configuration
|
|
135
|
+
ctx.ensure_object(dict)
|
|
136
|
+
ctx.obj["config"] = Config(config_path=config, profile=profile)
|
|
137
|
+
|
|
138
|
+
# Setup output formatting
|
|
139
|
+
setup_output(
|
|
140
|
+
format_type=output or ctx.obj["config"].get("output.format", "json"),
|
|
141
|
+
quiet=quiet,
|
|
142
|
+
verbose=verbose,
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
# Load commands from entry points
|
|
147
|
+
def load_commands() -> None:
|
|
148
|
+
"""Load commands from package entry points."""
|
|
149
|
+
# Use the plugin manager to load all commands
|
|
150
|
+
from deepctl_core import PluginManager
|
|
151
|
+
|
|
152
|
+
plugin_manager = PluginManager()
|
|
153
|
+
plugin_manager.load_plugins(cli)
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
# Load commands when module is imported
|
|
157
|
+
load_commands()
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def main() -> None:
|
|
161
|
+
"""Main entry point for the CLI."""
|
|
162
|
+
try:
|
|
163
|
+
# Preprocess arguments to handle hyphenated commands
|
|
164
|
+
args = sys.argv[1:] # Skip the program name
|
|
165
|
+
processed_args = preprocess_hyphenated_commands(args)
|
|
166
|
+
|
|
167
|
+
# Call CLI with processed arguments
|
|
168
|
+
cli(args=processed_args, standalone_mode=True)
|
|
169
|
+
except KeyboardInterrupt:
|
|
170
|
+
console.print("\n[yellow]Operation cancelled by user[/yellow]")
|
|
171
|
+
sys.exit(1)
|
|
172
|
+
except Exception as e:
|
|
173
|
+
console.print(f"[red]Error: {e}[/red]")
|
|
174
|
+
sys.exit(1)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
if __name__ == "__main__":
|
|
178
|
+
main()
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: deepctl
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Official Deepgram CLI for speech recognition and audio intelligence
|
|
5
|
+
Author-email: Deepgram <devrel@deepgram.com>
|
|
6
|
+
Maintainer-email: Deepgram <devrel@deepgram.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/deepgram/cli
|
|
9
|
+
Project-URL: Documentation, https://developers.deepgram.com/docs/cli
|
|
10
|
+
Project-URL: Repository, https://github.com/deepgram/cli
|
|
11
|
+
Project-URL: Bug Tracker, https://github.com/deepgram/cli/issues
|
|
12
|
+
Project-URL: Community, https://discord.gg/deepgram
|
|
13
|
+
Keywords: deepgram,speech,recognition,transcription,audio,cli
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
Requires-Dist: click>=8.0.0
|
|
26
|
+
Requires-Dist: deepgram-sdk>=3.0.0
|
|
27
|
+
Requires-Dist: deepctl-core>=0.1.0
|
|
28
|
+
Requires-Dist: deepctl-cmd-login>=0.1.0
|
|
29
|
+
Requires-Dist: deepctl-cmd-projects>=0.1.0
|
|
30
|
+
Requires-Dist: deepctl-cmd-transcribe>=0.1.0
|
|
31
|
+
Requires-Dist: deepctl-cmd-usage>=0.1.0
|
|
32
|
+
Requires-Dist: deepctl-cmd-mcp>=0.1.0
|
|
33
|
+
Requires-Dist: deepctl-cmd-debug>=0.1.0
|
|
34
|
+
Requires-Dist: deepctl-cmd-debug-browser>=0.1.0
|
|
35
|
+
Requires-Dist: deepctl-cmd-debug-network>=0.1.0
|
|
36
|
+
Requires-Dist: deepctl-cmd-debug-audio>=0.1.0
|
|
37
|
+
Requires-Dist: deepctl-shared-utils>=0.1.0
|
|
38
|
+
Requires-Dist: pydantic>=2.0.0
|
|
39
|
+
Requires-Dist: rich>=13.0.0
|
|
40
|
+
Requires-Dist: httpx>=0.24.0
|
|
41
|
+
Requires-Dist: requests<3.0,>=2.31
|
|
42
|
+
Requires-Dist: pyjwt>=2.8.0
|
|
43
|
+
Requires-Dist: keyring>=24.0.0
|
|
44
|
+
Requires-Dist: pyyaml>=6.0.0
|
|
45
|
+
Requires-Dist: typer>=0.9.0
|
|
46
|
+
Requires-Dist: platformdirs>=3.0.0
|
|
47
|
+
Provides-Extra: dev
|
|
48
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
49
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
50
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
51
|
+
Requires-Dist: pytest-mock>=3.10.0; extra == "dev"
|
|
52
|
+
Requires-Dist: responses>=0.23.0; extra == "dev"
|
|
53
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
54
|
+
Requires-Dist: ruff>=0.8.0; extra == "dev"
|
|
55
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
56
|
+
Requires-Dist: types-PyYAML>=6.0.0; extra == "dev"
|
|
57
|
+
Requires-Dist: types-requests>=2.31.0; extra == "dev"
|
|
58
|
+
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
|
|
59
|
+
Requires-Dist: tox>=4.0.0; extra == "dev"
|
|
60
|
+
Requires-Dist: twine>=4.0.0; extra == "dev"
|
|
61
|
+
Requires-Dist: build>=0.10.0; extra == "dev"
|
|
62
|
+
|
|
63
|
+
# deepctl
|
|
64
|
+
|
|
65
|
+
The official Deepgram CLI.
|
|
66
|
+
|
|
67
|
+
## Quick Start
|
|
68
|
+
|
|
69
|
+
### Try it without installing (like `npx`)
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Using pipx (traditional)
|
|
73
|
+
pipx run deepctl --help
|
|
74
|
+
pipx run deepctl transcribe audio.wav
|
|
75
|
+
|
|
76
|
+
# Using uv (recommended - much faster!)
|
|
77
|
+
uvx deepctl --help
|
|
78
|
+
uvx deepctl transcribe audio.wav
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Install permanently
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Recommended: Using pipx (supports plugins!)
|
|
85
|
+
pipx install deepctl
|
|
86
|
+
|
|
87
|
+
# Alternative: Using uv tool (plugins require manual workarounds)
|
|
88
|
+
uv tool install deepctl
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Usage
|
|
92
|
+
|
|
93
|
+
The CLI provides multiple command aliases for flexibility:
|
|
94
|
+
|
|
95
|
+
- `deepctl` - Primary command
|
|
96
|
+
- `deepgram` - Alternative command
|
|
97
|
+
- `dg` - Short alias
|
|
98
|
+
|
|
99
|
+
### Basic Commands
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Authentication
|
|
103
|
+
deepctl login
|
|
104
|
+
|
|
105
|
+
# Transcribe audio
|
|
106
|
+
deepctl transcribe audio.wav
|
|
107
|
+
deepctl transcribe https://example.com/audio.mp3
|
|
108
|
+
|
|
109
|
+
# Manage projects
|
|
110
|
+
deepctl projects list
|
|
111
|
+
deepctl projects create "My Project"
|
|
112
|
+
|
|
113
|
+
# View usage statistics
|
|
114
|
+
deepctl usage --month 2024-01
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Configuration
|
|
118
|
+
|
|
119
|
+
The CLI supports multiple configuration methods:
|
|
120
|
+
|
|
121
|
+
1. Command-line arguments (highest priority)
|
|
122
|
+
2. Environment variables
|
|
123
|
+
3. User config file (`~/.deepgram/config.yaml`)
|
|
124
|
+
4. Project config file (`./deepgram.yaml`)
|
|
125
|
+
|
|
126
|
+
### Output Formats
|
|
127
|
+
|
|
128
|
+
Choose your preferred output format:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
deepctl transcribe audio.wav --output json
|
|
132
|
+
deepctl transcribe audio.wav --output yaml
|
|
133
|
+
deepctl transcribe audio.wav --output table
|
|
134
|
+
deepctl transcribe audio.wav --output csv
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Development
|
|
138
|
+
|
|
139
|
+
This CLI is built with Python and uses a modular plugin architecture. **Cross-platform compatibility** is a core requirement - the CLI must work identically on Linux, Windows, macOS (Intel), and macOS (Apple Silicon).
|
|
140
|
+
|
|
141
|
+
### Requirements
|
|
142
|
+
|
|
143
|
+
- Python 3.10+
|
|
144
|
+
- `uv`
|
|
145
|
+
- Works on all major platforms:
|
|
146
|
+
- Linux (x86_64, arm64)
|
|
147
|
+
- Windows (x86_64)
|
|
148
|
+
- macOS (Intel x86_64, Apple Silicon arm64)
|
|
149
|
+
|
|
150
|
+
### Install uv
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# macOS/Linux
|
|
154
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
155
|
+
|
|
156
|
+
# Windows
|
|
157
|
+
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Installation for Development
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
git clone https://github.com/deepgram/cli
|
|
164
|
+
cd cli
|
|
165
|
+
|
|
166
|
+
# Create virtual environment and install dependencies
|
|
167
|
+
uv venv
|
|
168
|
+
uv pip install -e ".[dev]"
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Dependencies
|
|
172
|
+
|
|
173
|
+
All dependencies are managed in `pyproject.toml`. Install them with:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
uv pip install -e . # Runtime dependencies
|
|
177
|
+
uv pip install -e ".[dev]" # Development dependencies
|
|
178
|
+
uv pip install -e ".[test]" # Test dependencies
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Workspace Structure
|
|
182
|
+
|
|
183
|
+
This repository is organized as a uv workspace (monorepo) to support multiple related packages:
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
cli/ # Workspace root
|
|
187
|
+
├── src/ # Main CLI package (deepctl)
|
|
188
|
+
│ └── deepgram_cli/
|
|
189
|
+
├── packages/ # Additional workspace packages
|
|
190
|
+
│ └── (future packages)
|
|
191
|
+
└── docs/ # Shared documentation
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
See [Workspace and Monorepo Architecture](docs/Workspace%20and%20Monorepo%20Architecture.md) for detailed information about the workspace structure and how to add new packages.
|
|
195
|
+
|
|
196
|
+
### Running Tests
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
uv run pytest
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Plugin Support
|
|
203
|
+
|
|
204
|
+
### Installing Plugins
|
|
205
|
+
|
|
206
|
+
Deepctl supports external plugins that add custom commands:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
# First, install deepctl globally with pipx
|
|
210
|
+
pipx install deepctl
|
|
211
|
+
|
|
212
|
+
# Then inject plugins into the same environment
|
|
213
|
+
pipx inject deepctl deepctl-plugin-example
|
|
214
|
+
pipx inject deepctl your-custom-plugin
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Creating Plugins
|
|
218
|
+
|
|
219
|
+
Create custom commands by extending the `BaseCommand` class:
|
|
220
|
+
|
|
221
|
+
```python
|
|
222
|
+
from deepctl_core.base_command import BaseCommand
|
|
223
|
+
|
|
224
|
+
class MyCommand(BaseCommand):
|
|
225
|
+
name = "mycommand"
|
|
226
|
+
help = "Description of my command"
|
|
227
|
+
|
|
228
|
+
def handle(self, config, auth_manager, client, **kwargs):
|
|
229
|
+
# Command implementation
|
|
230
|
+
pass
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
See [packages/deepctl-plugin-example](packages/deepctl-plugin-example) for a complete example.
|
|
234
|
+
|
|
235
|
+
## Support
|
|
236
|
+
|
|
237
|
+
- [Documentation](https://developers.deepgram.com/docs/cli)
|
|
238
|
+
- [Community Discord](https://discord.gg/deepgram)
|
|
239
|
+
- [Bug Reports](https://github.com/deepgram/cli/issues)
|
|
240
|
+
|
|
241
|
+
## License
|
|
242
|
+
|
|
243
|
+
MIT License - see LICENSE file for details.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/deepctl/__init__.py
|
|
4
|
+
src/deepctl/main.py
|
|
5
|
+
src/deepctl.egg-info/PKG-INFO
|
|
6
|
+
src/deepctl.egg-info/SOURCES.txt
|
|
7
|
+
src/deepctl.egg-info/dependency_links.txt
|
|
8
|
+
src/deepctl.egg-info/entry_points.txt
|
|
9
|
+
src/deepctl.egg-info/requires.txt
|
|
10
|
+
src/deepctl.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
click>=8.0.0
|
|
2
|
+
deepgram-sdk>=3.0.0
|
|
3
|
+
deepctl-core>=0.1.0
|
|
4
|
+
deepctl-cmd-login>=0.1.0
|
|
5
|
+
deepctl-cmd-projects>=0.1.0
|
|
6
|
+
deepctl-cmd-transcribe>=0.1.0
|
|
7
|
+
deepctl-cmd-usage>=0.1.0
|
|
8
|
+
deepctl-cmd-mcp>=0.1.0
|
|
9
|
+
deepctl-cmd-debug>=0.1.0
|
|
10
|
+
deepctl-cmd-debug-browser>=0.1.0
|
|
11
|
+
deepctl-cmd-debug-network>=0.1.0
|
|
12
|
+
deepctl-cmd-debug-audio>=0.1.0
|
|
13
|
+
deepctl-shared-utils>=0.1.0
|
|
14
|
+
pydantic>=2.0.0
|
|
15
|
+
rich>=13.0.0
|
|
16
|
+
httpx>=0.24.0
|
|
17
|
+
requests<3.0,>=2.31
|
|
18
|
+
pyjwt>=2.8.0
|
|
19
|
+
keyring>=24.0.0
|
|
20
|
+
pyyaml>=6.0.0
|
|
21
|
+
typer>=0.9.0
|
|
22
|
+
platformdirs>=3.0.0
|
|
23
|
+
|
|
24
|
+
[dev]
|
|
25
|
+
pytest>=7.0.0
|
|
26
|
+
pytest-asyncio>=0.21.0
|
|
27
|
+
pytest-cov>=4.0.0
|
|
28
|
+
pytest-mock>=3.10.0
|
|
29
|
+
responses>=0.23.0
|
|
30
|
+
black>=23.0.0
|
|
31
|
+
ruff>=0.8.0
|
|
32
|
+
mypy>=1.0.0
|
|
33
|
+
types-PyYAML>=6.0.0
|
|
34
|
+
types-requests>=2.31.0
|
|
35
|
+
pre-commit>=3.0.0
|
|
36
|
+
tox>=4.0.0
|
|
37
|
+
twine>=4.0.0
|
|
38
|
+
build>=0.10.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
deepctl
|