zjandrew-seedaudio-cli 1.0.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.
Files changed (47) hide show
  1. zjandrew_seedaudio_cli-1.0.0/.github/workflows/ci.yml +33 -0
  2. zjandrew_seedaudio_cli-1.0.0/.github/workflows/release.yml +28 -0
  3. zjandrew_seedaudio_cli-1.0.0/.gitignore +37 -0
  4. zjandrew_seedaudio_cli-1.0.0/PKG-INFO +143 -0
  5. zjandrew_seedaudio_cli-1.0.0/README.md +125 -0
  6. zjandrew_seedaudio_cli-1.0.0/pyproject.toml +46 -0
  7. zjandrew_seedaudio_cli-1.0.0/skills/seedaudio/SKILL.md +357 -0
  8. zjandrew_seedaudio_cli-1.0.0/skills/seedaudio/references/voices-and-style.md +120 -0
  9. zjandrew_seedaudio_cli-1.0.0/src/seedaudio_cli/__init__.py +0 -0
  10. zjandrew_seedaudio_cli-1.0.0/src/seedaudio_cli/__main__.py +119 -0
  11. zjandrew_seedaudio_cli-1.0.0/src/seedaudio_cli/commands/__init__.py +0 -0
  12. zjandrew_seedaudio_cli-1.0.0/src/seedaudio_cli/commands/config.py +161 -0
  13. zjandrew_seedaudio_cli-1.0.0/src/seedaudio_cli/commands/dialogue.py +204 -0
  14. zjandrew_seedaudio_cli-1.0.0/src/seedaudio_cli/commands/synthesize.py +188 -0
  15. zjandrew_seedaudio_cli-1.0.0/src/seedaudio_cli/commands/voices.py +42 -0
  16. zjandrew_seedaudio_cli-1.0.0/src/seedaudio_cli/core/__init__.py +0 -0
  17. zjandrew_seedaudio_cli-1.0.0/src/seedaudio_cli/core/client.py +61 -0
  18. zjandrew_seedaudio_cli-1.0.0/src/seedaudio_cli/core/concat.py +95 -0
  19. zjandrew_seedaudio_cli-1.0.0/src/seedaudio_cli/core/config.py +105 -0
  20. zjandrew_seedaudio_cli-1.0.0/src/seedaudio_cli/core/dialogue.py +46 -0
  21. zjandrew_seedaudio_cli-1.0.0/src/seedaudio_cli/core/naming.py +31 -0
  22. zjandrew_seedaudio_cli-1.0.0/src/seedaudio_cli/core/request.py +109 -0
  23. zjandrew_seedaudio_cli-1.0.0/src/seedaudio_cli/core/synth.py +98 -0
  24. zjandrew_seedaudio_cli-1.0.0/src/seedaudio_cli/data/voices.json +40 -0
  25. zjandrew_seedaudio_cli-1.0.0/src/seedaudio_cli/framework/__init__.py +0 -0
  26. zjandrew_seedaudio_cli-1.0.0/src/seedaudio_cli/framework/envelope.py +79 -0
  27. zjandrew_seedaudio_cli-1.0.0/src/seedaudio_cli/framework/errors.py +44 -0
  28. zjandrew_seedaudio_cli-1.0.0/tests/__init__.py +0 -0
  29. zjandrew_seedaudio_cli-1.0.0/tests/conftest.py +50 -0
  30. zjandrew_seedaudio_cli-1.0.0/tests/integration/__init__.py +0 -0
  31. zjandrew_seedaudio_cli-1.0.0/tests/integration/test_config.py +76 -0
  32. zjandrew_seedaudio_cli-1.0.0/tests/integration/test_dialogue.py +110 -0
  33. zjandrew_seedaudio_cli-1.0.0/tests/integration/test_synthesize.py +137 -0
  34. zjandrew_seedaudio_cli-1.0.0/tests/integration/test_voices.py +32 -0
  35. zjandrew_seedaudio_cli-1.0.0/tests/unit/__init__.py +0 -0
  36. zjandrew_seedaudio_cli-1.0.0/tests/unit/core/__init__.py +0 -0
  37. zjandrew_seedaudio_cli-1.0.0/tests/unit/core/test_client.py +59 -0
  38. zjandrew_seedaudio_cli-1.0.0/tests/unit/core/test_concat.py +69 -0
  39. zjandrew_seedaudio_cli-1.0.0/tests/unit/core/test_config.py +70 -0
  40. zjandrew_seedaudio_cli-1.0.0/tests/unit/core/test_dialogue.py +45 -0
  41. zjandrew_seedaudio_cli-1.0.0/tests/unit/core/test_naming.py +37 -0
  42. zjandrew_seedaudio_cli-1.0.0/tests/unit/core/test_request.py +90 -0
  43. zjandrew_seedaudio_cli-1.0.0/tests/unit/core/test_synth.py +100 -0
  44. zjandrew_seedaudio_cli-1.0.0/tests/unit/framework/__init__.py +0 -0
  45. zjandrew_seedaudio_cli-1.0.0/tests/unit/framework/test_envelope.py +40 -0
  46. zjandrew_seedaudio_cli-1.0.0/tests/unit/framework/test_errors.py +34 -0
  47. zjandrew_seedaudio_cli-1.0.0/uv.lock +464 -0
@@ -0,0 +1,33 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ${{ matrix.os }}
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ os: [ubuntu-latest, macos-latest]
15
+ python: ["3.10", "3.11", "3.12"]
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: astral-sh/setup-uv@v3
19
+ - name: Pin Python
20
+ run: uv python pin ${{ matrix.python }}
21
+ - name: Install
22
+ run: uv sync --all-extras
23
+ - name: Lint
24
+ run: uv run ruff check . && uv run ruff format --check .
25
+ - name: Typecheck
26
+ run: uv run pyright
27
+ - name: Tests
28
+ run: uv run pytest --cov=seedaudio_cli --cov-report=xml
29
+ - name: Upload coverage
30
+ if: matrix.os == 'ubuntu-latest' && matrix.python == '3.12'
31
+ uses: codecov/codecov-action@v4
32
+ with:
33
+ file: ./coverage.xml
@@ -0,0 +1,28 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ jobs:
8
+ release:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ id-token: write # for PyPI OIDC trusted publishing
12
+ contents: write # for GitHub Release
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: astral-sh/setup-uv@v3
16
+ - run: uv sync --all-extras
17
+ - run: uv run ruff check . && uv run ruff format --check .
18
+ - run: uv run pyright
19
+ - run: uv run pytest
20
+ - name: Build
21
+ run: uv build
22
+ - name: Publish to PyPI
23
+ uses: pypa/gh-action-pypi-publish@release/v1
24
+ - name: GitHub Release
25
+ uses: softprops/action-gh-release@v2
26
+ with:
27
+ generate_release_notes: true
28
+ files: dist/*
@@ -0,0 +1,37 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.egg-info/
6
+ build/
7
+ dist/
8
+ .eggs/
9
+
10
+ # Virtual env / uv
11
+ .venv/
12
+ .python-version
13
+
14
+ # Tooling
15
+ .ruff_cache/
16
+ .pytest_cache/
17
+ .coverage
18
+ .coverage.*
19
+ htmlcov/
20
+ .pyright/
21
+
22
+ # Editor / OS
23
+ .DS_Store
24
+ .idea/
25
+ .vscode/
26
+
27
+ # Local config / secrets
28
+ .env
29
+ ~/.seedaudio-cli/
30
+
31
+ # Test / output artifacts
32
+ tmp/
33
+ *.mp3
34
+ *.wav
35
+ *.pcm
36
+ *.ogg
37
+ !tests/fixtures/**
@@ -0,0 +1,143 @@
1
+ Metadata-Version: 2.4
2
+ Name: zjandrew-seedaudio-cli
3
+ Version: 1.0.0
4
+ Summary: CLI for Volcengine Doubao speech synthesis (TTS), with a companion Claude Code SKILL
5
+ Author: zjandrew
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.10
8
+ Requires-Dist: click>=8.1
9
+ Requires-Dist: httpx>=0.27
10
+ Requires-Dist: rich>=13
11
+ Provides-Extra: dev
12
+ Requires-Dist: pyright; extra == 'dev'
13
+ Requires-Dist: pytest-cov; extra == 'dev'
14
+ Requires-Dist: pytest>=8; extra == 'dev'
15
+ Requires-Dist: respx; extra == 'dev'
16
+ Requires-Dist: ruff; extra == 'dev'
17
+ Description-Content-Type: text/markdown
18
+
19
+ # seedaudio-cli
20
+
21
+ CLI for Volcengine Doubao speech synthesis (豆包语音合成大模型 2.0, `seed-tts-2.0`), with an
22
+ accompanying SKILL for Claude Code / AI agents.
23
+
24
+ It targets the **V3 HTTP Chunked unidirectional** TTS endpoint
25
+ (`/api/v3/tts/unidirectional`): one-shot text in, audio file out. Synthesis is synchronous —
26
+ there is no task/polling model.
27
+
28
+ ## Install
29
+
30
+ ```bash
31
+ # Recommended:
32
+ uv tool install zjandrew-seedaudio-cli
33
+
34
+ # Or with pipx:
35
+ pipx install zjandrew-seedaudio-cli
36
+
37
+ # Companion SKILL:
38
+ npx skills add zjandrew/seedaudio-cli -g -y
39
+ ```
40
+
41
+ The PyPI distribution is named `zjandrew-seedaudio-cli`; the binary is still `seedaudio-cli`.
42
+
43
+ Local development:
44
+
45
+ ```bash
46
+ git clone https://github.com/zjandrew/seedaudio-cli.git
47
+ cd seedaudio-cli
48
+ uv sync --all-extras
49
+ uv run seedaudio-cli --version
50
+ ```
51
+
52
+ ## Configure
53
+
54
+ TTS auth is the 语音技术 console **API Key** model — a single `X-Api-Key`, *not* the Ark
55
+ `ARK_API_KEY` Bearer that the video API uses. Get it from
56
+ [控制台 > API Key 管理](https://console.volcengine.com/speech/new/setting/apikeys).
57
+
58
+ ```bash
59
+ # Interactive wizard (creates ~/.seedaudio-cli/config.json, chmod 600):
60
+ seedaudio-cli config init
61
+
62
+ # Or env vars:
63
+ export SEEDAUDIO_API_KEY=...
64
+ export SEEDAUDIO_ENDPOINT=https://openspeech.bytedance.com # optional
65
+
66
+ # Or programmatic:
67
+ seedaudio-cli config set api_key ...
68
+ seedaudio-cli config set default_voice zh_female_vv_uranus_bigtts
69
+ # resource_id is auto-inferred from the voice (S_/ICL_/saturn_ -> seed-icl-2.0, else
70
+ # seed-tts-2.0); set it only to pin/override globally:
71
+ seedaudio-cli config set resource_id seed-icl-2.0 # optional global pin
72
+ ```
73
+
74
+ Priority: CLI flag > env var > config file > built-in default.
75
+
76
+ ### Multiple profiles
77
+
78
+ ```bash
79
+ seedaudio-cli config list
80
+ seedaudio-cli config add prod
81
+ seedaudio-cli config use prod
82
+ seedaudio-cli --profile prod synthesize -p "..."
83
+ ```
84
+
85
+ ## Usage
86
+
87
+ ```bash
88
+ # Text → speech (mp3)
89
+ seedaudio-cli synthesize -p "你好,欢迎使用豆包语音合成" \
90
+ --voice zh_female_vv_uranus_bigtts --out hello.mp3
91
+
92
+ # Tune delivery
93
+ seedaudio-cli synthesize -p "新闻播报示例" --voice zh_male_liufei_uranus_bigtts \
94
+ --speech-rate 10 --loudness-rate 0 --pitch 0 --encoding wav --sample-rate 24000 --out news.wav
95
+
96
+ # Emotion / style via voice instruction (context_texts)
97
+ seedaudio-cli synthesize -p "今天真是太开心啦" --voice zh_female_vv_uranus_bigtts \
98
+ -m seed-tts-2.0-expressive --instruct "用特别开心、撒娇的语气说" --out happy.mp3
99
+
100
+ # Long text — the streaming endpoint returns a COMPLETE file in one request, even for
101
+ # thousands of chars / minutes of audio, so a whole article or chapter just works:
102
+ seedaudio-cli synthesize --text-file chapter1.txt --voice zh_male_xuanyijieshuo_uranus_bigtts --out chapter1.mp3
103
+ # (book-length >tens-of-thousands of chars: use Volcengine's async long-text API, not wrapped here)
104
+
105
+ # Multi-role dialogue: each line `角色: 台词`, mapped to a voice per role
106
+ seedaudio-cli dialogue --script play.txt \
107
+ --voice 旁白=zh_male_xuanyijieshuo_uranus_bigtts \
108
+ --voice 小美=zh_female_wenrouxiaoya_uranus_bigtts \
109
+ --instruct 小美="用温柔的语气说" --out play.mp3
110
+
111
+ # Word-level timestamps alongside the audio
112
+ seedaudio-cli synthesize -p "字幕对齐示例" --voice zh_female_vv_uranus_bigtts \
113
+ --subtitle --out clip.mp3 # writes clip.mp3 + clip.mp3.words.json
114
+
115
+ # Discover voices (curated subset; full list in the console)
116
+ seedaudio-cli voices --language zh
117
+
118
+ # Dry run (prints the request body, no API call — works without credentials)
119
+ seedaudio-cli --dry-run synthesize -p "..." --voice zh_female_vv_uranus_bigtts
120
+ ```
121
+
122
+ ## SKILL
123
+
124
+ `skills/seedaudio/SKILL.md` ships in this repo. Install for Claude Code:
125
+
126
+ ```bash
127
+ npx skills add zjandrew/seedaudio-cli -g -y
128
+ ```
129
+
130
+ ## Exit codes
131
+
132
+ | Code | Meaning |
133
+ |---|---|
134
+ | 0 | success |
135
+ | 2 | INVALID_INPUT / CONFIG_MISSING |
136
+ | 3 | IO_ERROR |
137
+ | 4 | API_ERROR |
138
+ | 5 | NETWORK_ERROR |
139
+ | 10 | INTERNAL |
140
+
141
+ ## License
142
+
143
+ MIT
@@ -0,0 +1,125 @@
1
+ # seedaudio-cli
2
+
3
+ CLI for Volcengine Doubao speech synthesis (豆包语音合成大模型 2.0, `seed-tts-2.0`), with an
4
+ accompanying SKILL for Claude Code / AI agents.
5
+
6
+ It targets the **V3 HTTP Chunked unidirectional** TTS endpoint
7
+ (`/api/v3/tts/unidirectional`): one-shot text in, audio file out. Synthesis is synchronous —
8
+ there is no task/polling model.
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ # Recommended:
14
+ uv tool install zjandrew-seedaudio-cli
15
+
16
+ # Or with pipx:
17
+ pipx install zjandrew-seedaudio-cli
18
+
19
+ # Companion SKILL:
20
+ npx skills add zjandrew/seedaudio-cli -g -y
21
+ ```
22
+
23
+ The PyPI distribution is named `zjandrew-seedaudio-cli`; the binary is still `seedaudio-cli`.
24
+
25
+ Local development:
26
+
27
+ ```bash
28
+ git clone https://github.com/zjandrew/seedaudio-cli.git
29
+ cd seedaudio-cli
30
+ uv sync --all-extras
31
+ uv run seedaudio-cli --version
32
+ ```
33
+
34
+ ## Configure
35
+
36
+ TTS auth is the 语音技术 console **API Key** model — a single `X-Api-Key`, *not* the Ark
37
+ `ARK_API_KEY` Bearer that the video API uses. Get it from
38
+ [控制台 > API Key 管理](https://console.volcengine.com/speech/new/setting/apikeys).
39
+
40
+ ```bash
41
+ # Interactive wizard (creates ~/.seedaudio-cli/config.json, chmod 600):
42
+ seedaudio-cli config init
43
+
44
+ # Or env vars:
45
+ export SEEDAUDIO_API_KEY=...
46
+ export SEEDAUDIO_ENDPOINT=https://openspeech.bytedance.com # optional
47
+
48
+ # Or programmatic:
49
+ seedaudio-cli config set api_key ...
50
+ seedaudio-cli config set default_voice zh_female_vv_uranus_bigtts
51
+ # resource_id is auto-inferred from the voice (S_/ICL_/saturn_ -> seed-icl-2.0, else
52
+ # seed-tts-2.0); set it only to pin/override globally:
53
+ seedaudio-cli config set resource_id seed-icl-2.0 # optional global pin
54
+ ```
55
+
56
+ Priority: CLI flag > env var > config file > built-in default.
57
+
58
+ ### Multiple profiles
59
+
60
+ ```bash
61
+ seedaudio-cli config list
62
+ seedaudio-cli config add prod
63
+ seedaudio-cli config use prod
64
+ seedaudio-cli --profile prod synthesize -p "..."
65
+ ```
66
+
67
+ ## Usage
68
+
69
+ ```bash
70
+ # Text → speech (mp3)
71
+ seedaudio-cli synthesize -p "你好,欢迎使用豆包语音合成" \
72
+ --voice zh_female_vv_uranus_bigtts --out hello.mp3
73
+
74
+ # Tune delivery
75
+ seedaudio-cli synthesize -p "新闻播报示例" --voice zh_male_liufei_uranus_bigtts \
76
+ --speech-rate 10 --loudness-rate 0 --pitch 0 --encoding wav --sample-rate 24000 --out news.wav
77
+
78
+ # Emotion / style via voice instruction (context_texts)
79
+ seedaudio-cli synthesize -p "今天真是太开心啦" --voice zh_female_vv_uranus_bigtts \
80
+ -m seed-tts-2.0-expressive --instruct "用特别开心、撒娇的语气说" --out happy.mp3
81
+
82
+ # Long text — the streaming endpoint returns a COMPLETE file in one request, even for
83
+ # thousands of chars / minutes of audio, so a whole article or chapter just works:
84
+ seedaudio-cli synthesize --text-file chapter1.txt --voice zh_male_xuanyijieshuo_uranus_bigtts --out chapter1.mp3
85
+ # (book-length >tens-of-thousands of chars: use Volcengine's async long-text API, not wrapped here)
86
+
87
+ # Multi-role dialogue: each line `角色: 台词`, mapped to a voice per role
88
+ seedaudio-cli dialogue --script play.txt \
89
+ --voice 旁白=zh_male_xuanyijieshuo_uranus_bigtts \
90
+ --voice 小美=zh_female_wenrouxiaoya_uranus_bigtts \
91
+ --instruct 小美="用温柔的语气说" --out play.mp3
92
+
93
+ # Word-level timestamps alongside the audio
94
+ seedaudio-cli synthesize -p "字幕对齐示例" --voice zh_female_vv_uranus_bigtts \
95
+ --subtitle --out clip.mp3 # writes clip.mp3 + clip.mp3.words.json
96
+
97
+ # Discover voices (curated subset; full list in the console)
98
+ seedaudio-cli voices --language zh
99
+
100
+ # Dry run (prints the request body, no API call — works without credentials)
101
+ seedaudio-cli --dry-run synthesize -p "..." --voice zh_female_vv_uranus_bigtts
102
+ ```
103
+
104
+ ## SKILL
105
+
106
+ `skills/seedaudio/SKILL.md` ships in this repo. Install for Claude Code:
107
+
108
+ ```bash
109
+ npx skills add zjandrew/seedaudio-cli -g -y
110
+ ```
111
+
112
+ ## Exit codes
113
+
114
+ | Code | Meaning |
115
+ |---|---|
116
+ | 0 | success |
117
+ | 2 | INVALID_INPUT / CONFIG_MISSING |
118
+ | 3 | IO_ERROR |
119
+ | 4 | API_ERROR |
120
+ | 5 | NETWORK_ERROR |
121
+ | 10 | INTERNAL |
122
+
123
+ ## License
124
+
125
+ MIT
@@ -0,0 +1,46 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "zjandrew-seedaudio-cli"
7
+ version = "1.0.0"
8
+ description = "CLI for Volcengine Doubao speech synthesis (TTS), with a companion Claude Code SKILL"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ authors = [{ name = "zjandrew" }]
13
+ dependencies = [
14
+ "click>=8.1",
15
+ "httpx>=0.27",
16
+ "rich>=13",
17
+ ]
18
+
19
+ [project.optional-dependencies]
20
+ dev = ["pytest>=8", "pytest-cov", "ruff", "pyright", "respx"]
21
+
22
+ [project.scripts]
23
+ seedaudio-cli = "seedaudio_cli.__main__:main"
24
+
25
+ [tool.hatch.build.targets.wheel]
26
+ packages = ["src/seedaudio_cli"]
27
+
28
+ [tool.ruff]
29
+ line-length = 100
30
+ target-version = "py310"
31
+
32
+ [tool.ruff.lint]
33
+ select = ["E", "F", "I", "UP", "B", "SIM", "RUF"]
34
+ # This is a Chinese-text TTS tool: fullwidth CJK punctuation (。,!) is intentional,
35
+ # so the "ambiguous unicode" rules would only produce noise.
36
+ ignore = ["RUF001", "RUF002", "RUF003"]
37
+
38
+ [tool.pyright]
39
+ include = ["src", "tests"]
40
+ pythonVersion = "3.10"
41
+ typeCheckingMode = "strict"
42
+ reportMissingTypeStubs = false
43
+
44
+ [tool.pytest.ini_options]
45
+ testpaths = ["tests"]
46
+ addopts = "-ra --strict-markers"