Pre-release
This release is a pre-release and may not be stable for production use.
specererator v0.1.0
功能
根据用户需求及已有文档/代码文件,自动生成两份产物:
development_doc.md— 开发文档code_spec.md— Code Spec(供 AI 自动生成功能代码使用)
前置条件
- Python 3.8+
- Ollama 本地运行(或兼容的 LLM 服务)或者使用cloud API模型(需提供base_url, api_key)
- 已安装并运行,且已拉取所需模型:
ollama pull <模型名称> # 默认为qwen3.5:9b
github 安装
pip install specer
pypi 安装命令
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ specer==0.1.0b1
使用
安装成功之后就可使用specer命令
specer -r "<具体需求描述>"/<需求文件> -f <参考文档列表用空格分开> -o <输出目录>
快速开始
# 仅根据需求生成
specer -r "实现用户登录功能" -o ./demo
# 结合已有代码生成
specer -r "重构排序模块" -f src/sort.py docs/design.md -o ./demo
# 将需求以文件的方式传入
specer -r /tmp/requirement.md -f src/sort.py docs/design.md -o ./demo
# 指定模型 + 调试模式
specer -r "排序" -f src/sort.py -o ./demo -m llama3:8b --debug
# 外部接入云端API模型命令(以deepseek为例)
specer -r "实现用户登录功能" -o ./output -m deepseek-chat --base_url https://api.deepseek.com --api_key sk-<xxx>
# 外部接入云端API模型命令 + 环境变量(以deepseek为例)
export specer_API_KEY=sk-xxx
specer -r "实现用户登录功能" -o ./output -m deepseek-chat --base_url https://api.deepseek.com
命令参数说明
| 参数 | 说明 | 默认值 |
|---|---|---|
| -h,--help | 帮助信息 | 无 |
| -r,--requirement | 需求描述 (文字或文件路径) | 必填 |
| -f,--files | 已有文档/代码文件路径列表,用空格分隔。 | 无 |
| -o,--output_dir | 输出目录 | 必填 |
| -m,--model | 模型名称 | qwen3.5:9b |
| --debug | 启用 DEBUG 级别日志 | false |
| --log_file | 日志文件路径,如 ./specer.log | 无 |
| --version | 查看版本号 | 无 |
-f支持格式:.txt.md.py.java等纯文本格式。 不支持:.doc.docx
输出产物
执行成功后在 -o 指定的目录下生成:
development_doc.md— 开发文档code_spec.md— Code Spec(供 AI 生成代码使用)
常见问题
- PermissionError: 确保
-o指定的目录有写入权限 - Ollama 连接失败: 确认
ollama serve正在运行,默认地址 http://localhost:11434 - 模型不存在: 运行
ollama pull <模型名>拉取模型
Demo
# 运行以下命令
specer -r ./requirement/requirement.txt -f ./existing_files/documentation.txt ./existing_files/LRU_python_way.py -o ./demo
# 已有的参考文档在和需求文档分别在./existing_files和./requirement目录下面
# 产出的两篇文档在./demo目录下面
当前版本须知:
- 本工具目前处于早期 MVP 阶段,旨在验证“结构化 Spec 驱动 AI 编码”的工作流。
- 模型建议:本地模型仅用于演示和离线环境。为了获得最佳体验,强烈建议配置 DeepSeek / Claude 等 API模型。
- 当前局限:暂不支持 PDF/Word 解析(已在 v0.2 规划中),暂以 Markdown/纯文本输入为主。
Metadata
Release files for specer 0.1.0b2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| specer-0.1.0b2.tar.gz | 13.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| specer-0.1.0b2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.4 kB
Release files / specer-0.1.0b2.tar.gz
| Download URL | specer-0.1.0b2.tar.gz |
|---|---|
| Size | 13.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
05337f6a52202f3213ef80cbdfc033bd45dfc63b22df05a4a20929eda6d01b6b
|
|
BLAKE2b-256 checksum How to use checksums |
c1b33e281fe97135e85ec211978a881e37e23fd07d56ebc797c8f26b345131c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.2
|
Release files / specer-0.1.0b2-py3-none-any.whl
| Download URL | specer-0.1.0b2-py3-none-any.whl |
|---|---|
| Size | 15.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8cfe10fa3ef228df40b11165dc6e48c0b763a4f8a01ed4072c6ba68cb6e48df1
|
|
BLAKE2b-256 checksum How to use checksums |
128aa15f33ff1439c574d07dc6bb004fecf8eaf3f58599e9e24f7146896f9a8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.2
|