manage-app
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWhen To Use
何时使用
Pick this skill when the user wants to operate, troubleshoot, or ship an existing Twenty app — anything between "I have an app" and "it runs in production". Representative triggers:
- "sync my app changes to the server"
- "deploy my Twenty app to production"
- "check the logs for my logic function"
- "switch to a different Twenty remote / instance"
- "add a new remote for staging"
- "set up CI/CD for my Twenty app"
- "troubleshoot a failed deploy / sync / build"
- "uninstall my app from production"
- "run tests for my Twenty app"
- "run my logic function manually for testing"
Do not use this skill to scaffold (use ), to change app entities or code (use ), to prepare marketplace assets (use ), or to query workspace records (use ).
create-appdevelop-apppublish-appuse-twenty-mcp当用户希望操作、排查或发布现有 Twenty app 时,请选择此 skill——无论是“我已经有 app”还是“它已在生产环境中运行”。典型触发场景包括:
- “将我的 app 更改同步到服务器”
- “将我的 Twenty app 部署到生产环境”
- “查看我的 logic function 日志”
- “切换到其他 Twenty remote / instance”
- “为 staging 添加新的 remote”
- “为 Twenty app 设置 CI/CD”
- “排查失败的 deploy / sync / build”
- “从生产环境卸载我的 app”
- “为我的 Twenty app 运行测试”
- “手动运行 logic function 进行测试”
不要使用此 skill 来 scaffold(使用 )、更改 app entities 或代码(使用 )、准备 marketplace assets(使用 ),或查询 workspace records(使用 )。
create-appdevelop-apppublish-appuse-twenty-mcpBoundaries
边界
For background on how Twenty apps work — the SDK packages, remotes, sync lifecycle, and rendering model — read . Cross-skill operating rules that apply to every Twenty app task are in ; they are authoritative and not restated per skill.
../../references/concepts/how-apps-work.md../../references/concepts/operating-rules.mdDo not scaffold a new app here. Use when the app does not exist.
$create-appDo not add or modify app entities here. Use for objects, fields, logic functions, roles, views, navigation, page layouts, skills, agents, connection providers, front component registration, and settings menu items.
$develop-appDo not prepare marketplace README, screenshots, logos, or npm listing copy here. Use for public listing work.
$publish-appDo not retrieve CRM records here. Use for workspace data retrieval.
$use-twenty-mcp有关 Twenty apps 工作原理的背景信息——SDK packages、remotes、sync lifecycle 和 rendering model——请阅读 。适用于所有 Twenty app 任务的跨 skill 操作规则位于 ;这些规则具有权威性,不会在每个 skill 中重复说明。
../../references/concepts/how-apps-work.md../../references/concepts/operating-rules.md不要在此处 scaffold 新 app。当 app 尚不存在时,使用 。
$create-app不要在此处添加或修改 app entities。使用 处理 objects、fields、logic functions、roles、views、navigation、page layouts、skills、agents、connection providers、front component registration 和 settings menu items。
$develop-app不要在此处准备 marketplace README、screenshots、logos 或 npm listing copy。使用 完成公开列表相关工作。
$publish-app不要在此处检索 CRM records。使用 获取 workspace 数据。
$use-twenty-mcpOperating Rules
操作规则
First confirm the current directory is a Twenty app:
bash
test -f package.json
test -f src/application-config.tsInspect current app and scripts before running operational commands:
bash
sed -n '1,220p' package.json
yarn twenty remote:listTreat deploys, uninstalls, production remote changes, and production syncs as externally visible actions. Ask for explicit confirmation before running them when the target is production or user data could be affected.
For command details, remotes, validation command semantics, sync modes, troubleshooting, build, deploy, logs, exec, and CI/CD, read .
../../references/manage-app/cli-and-sync.mdIf the user asks to run tests, also read before running any test command. Full test suites include integration tests that install and uninstall the app on their target server, so start or verify the isolated test instance and run:
../../references/develop-app/tests.mdbash
yarn twenty docker:start --test
TWENTY_API_URL=http://localhost:2021 yarn testDo not run integration tests against the dev instance on unless the user explicitly asks for that target. If the user asks for unit tests only, use the package's unit-test script and no override is needed.
http://localhost:2020TWENTY_API_URL首先确认当前目录是一个 Twenty app:
bash
test -f package.json
test -f src/application-config.ts在运行运维命令之前,检查当前 app 和 scripts:
bash
sed -n '1,220p' package.json
yarn twenty remote:list将 deploy、uninstall、production remote 变更和 production sync 视为会对外产生影响的操作。当目标为生产环境或可能影响用户数据时,运行前必须获得明确确认。
有关命令详情、remotes、validation command semantics、sync modes、troubleshooting、build、deploy、logs、exec 和 CI/CD,请阅读 。
../../references/manage-app/cli-and-sync.md如果用户要求运行测试,还必须在运行任何测试命令前阅读 。完整测试套件包括 integration tests,会在目标 server 上 install 和 uninstall app,因此应先启动或确认隔离的 test instance,然后运行:
../../references/develop-app/tests.mdbash
yarn twenty docker:start --test
TWENTY_API_URL=http://localhost:2021 yarn test除非用户明确要求针对该目标运行,否则不要对 上的 dev instance 运行 integration tests。如果用户只要求 unit tests,请使用 package 的 unit-test script,且无需覆盖 。
http://localhost:2020TWENTY_API_URLRemotes
Remotes
A remote is a Twenty server that the app can sync or deploy to. Credentials are stored locally in .
~/.twenty/config.jsonCommon commands:
bash
undefinedremote 是 app 可以向其 sync 或 deploy 的 Twenty server。凭据存储在本地 中。
~/.twenty/config.json常用命令:
bash
undefinedAdd a remote interactively.
Add a remote interactively.
yarn twenty remote:add
yarn twenty remote:add
Connect to a local Twenty server.
Connect to a local Twenty server.
yarn twenty remote:add --local
yarn twenty remote:add --local
Add a remote non-interactively.
Add a remote non-interactively.
yarn twenty remote:add --url https://your-twenty-server.com --api-key $TWENTY_API_KEY --as production
yarn twenty remote:add --url https://your-twenty-server.com --api-key $TWENTY_API_KEY --as production
List configured remotes.
List configured remotes.
yarn twenty remote:list
yarn twenty remote:list
Switch the active remote.
Switch the active remote.
yarn twenty remote:use <name>
When the user says "prod", "production", or "workspace de prod", identify the target remote before syncing or deploying. If it is missing, add it with `--as production` or the user-provided name.yarn twenty remote:use <name>
当用户提到“prod”、“production”或“workspace de prod”时,在 sync 或 deploy 前确定目标 remote。如果尚未配置,则使用 `--as production` 或用户提供的名称添加该 remote。Development Sync
开发同步
Always use bounded apply to synchronize app changes with the active remote:
bash
yarn twenty applyDo not use bare (watch mode). Run each time changes need to be synced.
yarn twenty devyarn twenty applyBounded apply requires an authenticated remote. If authentication fails, re-add or switch the remote before retrying.
始终使用 bounded apply 将 app 更改同步到 active remote:
bash
yarn twenty apply不要直接使用 (watch mode)。每次需要同步更改时,都运行 。
yarn twenty devyarn twenty applybounded apply 需要已通过身份验证的 remote。如果身份验证失败,请重新添加或切换 remote 后再重试。
Troubleshooting
故障排查
Start by identifying which layer is failing:
- Remote/authentication.
- Dev sync or bounded apply.
- Build/package generation.
- Deploy/upload/install.
- Runtime function execution.
- CI/CD environment or secrets.
Collect the minimum useful context before changing configuration:
bash
sed -n '1,220p' package.json
sed -n '1,220p' src/application-config.ts
yarn twenty remote:list
yarn twenty apply --verboseFor remote or authentication issues:
- Check that the active remote is the intended workspace or server.
- Re-run for local app-dev servers.
yarn twenty remote:add --local - Re-run for remote servers.
yarn twenty remote:add --url <url> --as <name> - Avoid overwriting a production remote until the target URL is confirmed.
For sync issues:
- Prefer to get a bounded failure.
yarn twenty apply --verbose - Check generated type or schema errors before editing app entities.
- If the app depends on a changed data model, use to fix the entity definitions.
$develop-app
For build or deploy issues:
- Run before
yarn twenty dev:buildoryarn twenty app:publish --private.yarn twenty app:publish - Check version when updating an already deployed app.
package.json - Confirm the target with instead of relying on the active remote when production is involved.
yarn twenty app:publish --private --remote <name>
For runtime behavior:
- Use to inspect function execution logs.
yarn twenty dev:function:logs - Use to reproduce a logic function with a controlled payload.
yarn twenty dev:function:exec -n <function-name> -p '<json>'
For CI/CD failures:
- Check .
.github/workflows/ - Confirm points to a reachable server from the runner.
TWENTY_DEPLOY_URL - Confirm is configured as a secret, not committed in source.
TWENTY_DEPLOY_API_KEY
首先确定故障所在的层:
- Remote/身份验证。
- Dev sync 或 bounded apply。
- Build/package generation。
- Deploy/upload/install。
- Runtime function execution。
- CI/CD environment 或 secrets。
在修改配置前,收集最少但有用的上下文:
bash
sed -n '1,220p' package.json
sed -n '1,220p' src/application-config.ts
yarn twenty remote:list
yarn twenty apply --verbose对于 remote 或身份验证问题:
- 确认 active remote 是预期的 workspace 或 server。
- 对本地 app-dev server,重新运行 。
yarn twenty remote:add --local - 对远程 server,重新运行 。
yarn twenty remote:add --url <url> --as <name> - 在确认目标 URL 前,不要覆盖 production remote。
对于 sync 问题:
- 优先使用 获取范围明确的失败信息。
yarn twenty apply --verbose - 在编辑 app entities 前,检查生成的 type 或 schema 错误。
- 如果 app 依赖已更改的 data model,使用 修复 entity definitions。
$develop-app
对于 build 或 deploy 问题:
- 运行 ,然后再运行
yarn twenty dev:build或yarn twenty app:publish --private。yarn twenty app:publish - 更新已部署的 app 时,检查 中的 version。
package.json - 涉及 production 时,使用 确认目标,不要依赖 active remote。
yarn twenty app:publish --private --remote <name>
对于运行时行为:
- 使用 查看 function execution logs。
yarn twenty dev:function:logs - 使用 以受控 payload 复现 logic function。
yarn twenty dev:function:exec -n <function-name> -p '<json>'
对于 CI/CD 故障:
- 检查 。
.github/workflows/ - 确认 指向 runner 可以访问的 server。
TWENTY_DEPLOY_URL - 确认 已配置为 secret,而不是提交到 source 中。
TWENTY_DEPLOY_API_KEY
Build And Deploy
构建与部署
Build before deploy when the user asks for release readiness or when debugging packaging issues:
bash
yarn twenty dev:buildPublish an app to npm, or publish privately to a configured Twenty server registry:
bash
yarn twenty app:publish
yarn twenty app:publish --private --remote production
yarn twenty app:install --remote productionBefore deploying an update, check that has a strictly higher semver than the currently deployed version. Re-deploying the same version is rejected. After a private publish, install the deployed version with when the target workspace should use it.
package.jsonversionyarn twenty app:installUse instead when the user wants npm marketplace publishing, listing copy, screenshots, or public app store metadata.
$publish-app在用户要求确认发布就绪状态或排查打包问题时,部署前先进行构建:
bash
yarn twenty dev:build将 app 发布到 npm,或以私有方式发布到已配置的 Twenty server registry:
bash
yarn twenty app:publish
yarn twenty app:publish --private --remote production
yarn twenty app:install --remote production部署更新前,检查 中的 是否具有严格高于当前已部署版本的 semver。重新部署相同版本会被拒绝。私有发布后,当目标 workspace 应使用该版本时,运行 安装已部署版本。
package.jsonversionyarn twenty app:install当用户希望发布到 npm marketplace、准备 listing copy、screenshots 或 public app store metadata 时,改用 。
$publish-appLogs, Exec, And Cleanup
日志、执行与清理
Use function logs when debugging runtime behavior on the connected server:
bash
yarn twenty dev:function:logs
yarn twenty dev:function:logs -n <function-name>Run a logic function manually when testing behavior without its trigger:
bash
yarn twenty dev:function:exec -n <function-name>
yarn twenty dev:function:exec -n <function-name> -p '{"key":"value"}'Uninstall only after confirmation:
bash
yarn twenty app:uninstall
yarn twenty app:uninstall --yes在已连接的 server 上调试运行时行为时,使用 function logs:
bash
yarn twenty dev:function:logs
yarn twenty dev:function:logs -n <function-name>在没有触发器的情况下测试行为时,手动运行 logic function:
bash
yarn twenty dev:function:exec -n <function-name>
yarn twenty dev:function:exec -n <function-name> -p '{"key":"value"}'仅在获得确认后执行 uninstall:
bash
yarn twenty app:uninstall
yarn twenty app:uninstall --yesCI/CD
CI/CD
Apps generated with can use GitHub Actions for CI and CD. For deployment automation, check the app's files and configure:
create-twenty-app.github/workflows/TWENTY_DEPLOY_URLTWENTY_DEPLOY_API_KEY
Do not put API keys in source files. Use the repository or CI secret store.
由 生成的 app 可以使用 GitHub Actions 进行 CI 和 CD。对于 deployment automation,请检查 app 的 文件并配置:
create-twenty-app.github/workflows/TWENTY_DEPLOY_URLTWENTY_DEPLOY_API_KEY
不要将 API keys 放入 source files。请使用 repository 或 CI secret store。