Plone 命令行客户端——用于创建和操作自定义插件和主题
概览
Plone CLI 主要用于开发 Plone 包。它使用复印模板来支撑 Plone 后端插件、Zope 项目设置,并添加内容类型、行为和 REST API 服务等功能。 从7.x版本开始,我们使用复印模板代替bobtemplates.plone或cookiecutter模板。这为模板带来了用户体验优势和灵活性,并且具备未来适应性。 - 版本 >= 7.x 使用新的复印模板(UV/pyproject.toml 代替 buildout),并支持 Plone >= 6.x。- 版本 == 3.x 使用 bobtemplates.plone 和一些 cookieplone 模板,同时支持 Plone >= 6.x。- 使用 bobtemplates.plone 进行 Plone 5.x 和 Python 3 时,可以同时使用 plonecli 和 bobtemplates.plone == 6.x。它们支持 Plone 5 和 Plone 6,但主题模板是为 Plone 6 制作的。如果你真的需要为 Plone 5.x 创建主题包,可以使用 bobtemplates.plone < 6.x。
概述(AI 翻译)
用于创建Plone包的PloneCLI
Plone CLI 主要用于开发 Plone 包。它使用复印模板来支撑 Plone 后端插件、Zope 项目设置,并添加内容类型、行为和 REST API 服务等功能。
兼容性
从7.x版本开始,我们使用复印模板代替bobtemplates.plone或cookiecutter模板。 这为模板带来了一些用户体验优势和灵活性,并且具备未来适应性。
- 版本 >= 7.x 使用新的复印模板(UV/pyproject.toml 代替 buildout),并支持 Plone >= 6.x。
- 版本 == 3.x (当前稳定版本) 使用 bobtemplates.plone 和一些 cookieplone 模板,同时支持 Plone >= 6.x。
- 使用 bobtemplates.plone 进行 Plone 5.x 和 Python 3 时,可以使用 plonecli 和 bobtemplates.plone == 6.x。它们支持 Plone 5 和 Plone 6,但主题模板是为 Plone 6 设计的。如果你真的需要为 Plone 5.x 创建主题包,可以使用 bobtemplates.plone
(the open-standard discovery path) and linked from~/.claude/skills/ [for Claude Code. Use–scope project’ 来安装到当前项目中。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Plone CLI
A Plone CLI for creating Plone packages
The Plone CLI is meant for developing Plone packages. It uses copier templates to scaffold Plone backend addons, Zope project setups, and add features like content types, behaviors, and REST API services.
Compatibility
Starting from version 7.x, we use copier templates instead of bobtemplates.plone or cookiecutter templates. This brings some UX advantages and flexibility to the templates and is future-proof.
- Versions >= 7.x use the new copier templates (UV/pyproject.toml instead of buildout) and support Plone >= 6.x.
- Versions == 3.x (current stable version) use bobtemplates.plone and some cookieplone templates and also support Plone >= 6.x.
- When using bobtemplates.plone for Plone 5.x and Python 3, you can use plonecli together with bobtemplates.plone == 6.x. They support Plone 5 and Plone 6, except for the theming templates, which are made for Plone 6. If you really need to create a theming package for Plone 5.x, use bobtemplates.plone < 6.x.
Installation
UV Tool (Recommended)
The recommended way to install plonecli is as a UV tool, which makes it available globally:
uv tool install plonecli
To upgrade:
uv tool upgrade plonecli
Run Without Installing (uvx)
You can run plonecli without installing it using uvx:
uvx plonecli create addon my.addon
In a Virtual Environment
uv venv
source .venv/bin/activate
uv pip install plonecli
With pipx
pipx install plonecli
Shell Completion
plonecli supports tab-completion for commands and template names in bash, zsh, and fish.
Quick Install
plonecli completion --install
This auto-detects your shell and appends the activation line to your ~/.bashrc, ~/.zshrc, or fish completions directory. Restart your shell afterward.
Manual Setup
If you prefer to set it up yourself:
Bash (add to ~/.bashrc):
eval "$(_PLONECLI_COMPLETE=bash_source plonecli)"
Zsh (add to ~/.zshrc):
eval "$(_PLONECLI_COMPLETE=zsh_source plonecli)"
Fish (add to ~/.config/fish/completions/plonecli.fish):
env _PLONECLI_COMPLETE=fish_source plonecli | source
Faster Startup (Optional)
The eval approach generates the completion script on every shell start. For faster startup, save it to a file:
# Generate once
_PLONECLI_COMPLETE=bash_source plonecli > ~/.plonecli-complete.bash
# Then source from your ~/.bashrc instead of eval
source ~/.plonecli-complete.bash
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add plone/plonecli