Skip to main content

Template-driven file and directory generator for project workflows

Project description

sprout CLI (v0.1)

sprout 是一个项目内模板驱动的文件/目录生成 CLI,面向 Agent 协同开发场景。

核心特性

  • 从当前目录向上查找首个 .sprout/(类似 .git
  • 命令包目录:.sprout/commands/<command>/
  • 输入模式:支持 key=value--json--json-file
  • TTY 下缺参可引导进入交互模式,非 TTY 下快速失败
  • 冲突策略:fail / overwrite / skip / rename
  • 支持生成后执行 post actions
  • 运行时兼容 yaml / yml / json 配置与 manifest
  • 内置文档通过 sprout doc 访问

快速开始

# 0) 安装(开发中使用 uv)
uv sync

# 1) 初始化
uv run sprout init --with-examples

# 2) 查看命令
uv run sprout list --all

# 3) 执行命令
uv run sprout new issue name=my-task type=bug

# 4) 结构化输入
uv run sprout new issue --json '{"name":"my task","type":"bug"}'
uv run sprout new issue --json-file ./inputs.json

# 5) 预览
uv run sprout new issue name=test type=feat --dry-run

CLI 命令

sprout init [--profile minimal|docs] [--profile-file ./profile.json] [--with-examples]
sprout list [--all]
sprout doctor
sprout doc list
sprout doc show <name>
sprout doc path <name>
sprout new <command> [key=value ...] [--json '{...}' | --json-file ./inputs.json] [--set key=value] [-i|--interactive] [--no-input] [-n|--dry-run] [--conflict fail|overwrite|skip|rename]

.sprout/ 结构

.sprout/
  config.yaml
  commands/
    issue/
      manifest.yaml
      issue.md

文档入口

  • README.md:项目概览与快速开始
  • sprout doc show user-guide:CLI 使用手册
  • sprout doc show command-authoring-guide:命令包编写手册(面向维护者 / Agent)

边界约定:

  • user-guide 讲“怎么使用 sprout”
  • command-authoring-guide 讲“怎么编写 .sprout/commands/*

Agent 协作建议

如果让 Agent 帮你编写 .sprout 命令包,先让它读取:

sprout doc show command-authoring-guide

然后先对齐:

  1. 命令目的
  2. 输入字段及类型
  3. 输出文件/目录
  4. 冲突策略

常用检查

sprout list --all
sprout doctor
sprout new <command> name=test
sprout new <command> --json '{"name":"test"}'
sprout new <command> name=test --dry-run

常见问题

  • 找不到项目模板根:确认当前目录或父目录存在 .sprout/
  • 命令不可用:执行 sprout doctor 检查 invalid/conflict 报告
  • YAML 无法读取:安装 PyYAML,或改用 JSON
  • 想查看内置文档路径:执行 sprout doc path user-guidesprout doc path command-authoring-guide

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sprout_files-0.4.1.tar.gz (889.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sprout_files-0.4.1-py3-none-any.whl (39.8 kB view details)

Uploaded Python 3

File details

Details for the file sprout_files-0.4.1.tar.gz.

File metadata

  • Download URL: sprout_files-0.4.1.tar.gz
  • Upload date:
  • Size: 889.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sprout_files-0.4.1.tar.gz
Algorithm Hash digest
SHA256 9a11a7af960df43a7869c617bf31b208fe499bd88f368833a68f08b2ad9278a8
MD5 bb7a49de41e8b3b936e199b5f2a1f1d9
BLAKE2b-256 209e1e0ecacead185d4c3eefa954d5aa9bc7f4e58a08e7b2ba3500e5c0c17890

See more details on using hashes here.

File details

Details for the file sprout_files-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: sprout_files-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 39.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sprout_files-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3e44cff98f0ac50b95c4193a30d28e381448a798aea35133c553206c78a9021e
MD5 b26f8b429bfac173324d95875158301e
BLAKE2b-256 c0ae89bd91f04f18e328474202fd04c8d08f01711d97ee577c3b156fd61eb0e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page