主题
从起始模板创建一个新应用,或把已有应用更新到最新的模板版本。
用量
终端窗口
llamactl init [--template <id>] [--dir <path>] [--force]
llamactl init --update模板
不带 --template 运行 llamactl init 会打开模板选择器。选择器同时展示带界面的模板与无界面的工作流模板。
当你已经知道要用哪个模板时,用 --template <id>。随着模板新增或改名,模板 ID 可能会变化,因此请用选择器或 Agent Templates 页面查看当前清单。
选项
--update:把当前应用更新到最新的模板版本。会忽略其他选项。--template <id>:要使用的模板。--dir <path>:创建新应用所在的目录。默认为模板名。--force:如果目录已存在则覆盖。
它会做什么
- 借助
copier把所选模板复制到目标目录 - 加入面向助手的文档:
AGENTS.md,并把CLAUDE.md/GEMINI.md做成符号链接 - 如果
git可用,则初始化一个 Git 仓库 - 打印接下来在本地运行与部署的步骤
示例
打开模板选择器:
终端窗口
llamactl init从已知模板创建:
终端窗口
llamactl init --template <template-id> --dir my-app覆盖一个已存在的目录:
终端窗口
llamactl init --template <template-id> --dir ./my-app --force把已有应用更新到最新模板:
终端窗口
llamactl init --update另见:入门指南。