Skip to main content
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
    

安装

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 .pdf 等二进制格式,请先转换为支持的格式后重试。

输出产物

执行成功后在 -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.0b3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for specer 0.1.0b3
File Size Uploaded
specer-0.1.0b3.tar.gz 13.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for specer 0.1.0b3
File Interpreter ABI Platform
specer-0.1.0b3-py3-none-any.whl Python 3 none any Details

Total release size: 28.4 kB

Release files / specer-0.1.0b3.tar.gz

Download URL specer-0.1.0b3.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
80366f215f3c4610c5ebb47c2198aa448b5bd31f534095e3a348241a1f4824e9
BLAKE2b-256 checksum
How to use checksums
0bb88be83b3a20b18ad849496f75f1971e73b6acd10572a3cffe7e0dae13b8f6
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.0b3-py3-none-any.whl

Download URL specer-0.1.0b3-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3afac255d5d0ebd717fd637815c4d52c6ee302c7a370160f4c926d1126f33075
BLAKE2b-256 checksum
How to use checksums
38f4d7210c6a8911a28a07f83fd2c9e5f3218327f8acb803b885f44c665370b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.1.0b3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page