twenty 2.57.0 → 2.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +82 -54
- package/README.md +35 -22
- package/dist/app-template/.nvmrc +1 -1
- package/dist/app-template/example/files/README.md +20 -4
- package/dist/app-template/example/files/github/workflows/publish.yml +1 -1
- package/dist/app-template/example/files/src/default-role.ts +6 -4
- package/dist/app-template/yarn.lock +177 -114
- package/dist/app-worker.cjs +1 -1
- package/dist/chunks/{cli-version.constant-1uwk-lMz.cjs → AssetDirectory-c_JEwMr2.cjs} +1 -1
- package/dist/chunks/FileFolder-BmCXp_bX.cjs +1 -0
- package/dist/chunks/TwentyStandardApplicationUniversalIdentifier-Cm4vo0D3.cjs +1 -0
- package/dist/chunks/build-source-manifest-Ddwa8ath.cjs +2 -0
- package/dist/chunks/build-source-snapshot-CUsEVNsQ.cjs +898 -0
- package/dist/chunks/cli-version.constant-y_3mZ4gx.cjs +1 -0
- package/dist/chunks/code-step-file-suffix.constant-B6vqrfcU.cjs +1 -0
- package/dist/chunks/collect-translatable-strings-AWv41yIv.cjs +1 -0
- package/dist/chunks/collect-watch-inputs-DfWAkX1r.cjs +1 -0
- package/dist/chunks/compile-application-translations-C9UZQCAb.cjs +58 -0
- package/dist/chunks/convert-to-label-CI8cZyg_.cjs +1 -0
- package/dist/chunks/create-http-status-error-1VM7PoVZ.cjs +1 -0
- package/dist/chunks/create-metadata-client-FopHnDj0.cjs +6 -0
- package/dist/chunks/create-pull-base-write-CX8xZhMz.cjs +1 -0
- package/dist/chunks/create-rest-client-HbzXSfhZ.cjs +1 -0
- package/dist/chunks/extract-manifest-from-file-DPDIhnyg.cjs +1 -0
- package/dist/chunks/extract-source-translations-B-XmoSt7.cjs +1 -0
- package/dist/chunks/{fetch-metadata-inspection-Dqn8jToW.cjs → fetch-metadata-inspection-ooyNi2DN.cjs} +1 -1
- package/dist/chunks/{fetch-signed-in-identity-DCqCwASL.cjs → fetch-signed-in-identity-nCzWXunB.cjs} +1 -1
- package/dist/chunks/fetch-workspace-or-throw-DHoa_BYF.cjs +1 -0
- package/dist/chunks/format-body-DlJyFFVS.cjs +1 -0
- package/dist/chunks/format-data-value-D_1TNU-r.cjs +1 -0
- package/dist/chunks/format-metadata-fields-DmRandPR.cjs +2 -0
- package/dist/chunks/format-metadata-owner-ByoX2plp.cjs +1 -0
- package/dist/chunks/format-progress-line-BoU0vHbc.cjs +1 -0
- package/dist/chunks/formatBytes-CUW21d2t.cjs +1 -0
- package/dist/chunks/generate-application-client-Dlp_O7qk.cjs +1 -0
- package/dist/chunks/{get-client-generation-skip-reason-DZmeP0IC.cjs → get-client-generation-skip-reason-BZiAtHwa.cjs} +1 -1
- package/dist/chunks/get-field-universal-identifier.util-d1401qKf.cjs +1 -0
- package/dist/chunks/get-function-input-schema-ClPQURr8.cjs +1 -0
- package/dist/chunks/get-local-status-BbRv0a22.cjs +1 -0
- package/dist/chunks/global-flags.constant-DMHyA_PD.cjs +1 -0
- package/dist/chunks/is-access-token-expiring-BvJhEqtV.cjs +1 -0
- package/dist/chunks/is-application-not-found-error-CQ7k4hGU.cjs +1 -0
- package/dist/chunks/is-exported-manifest-C4lO285q.cjs +1 -0
- package/dist/chunks/is-locale-catalog-T4W5NhnW.cjs +1 -0
- package/dist/chunks/{AppLocales-CcZVcJIa-BjjIbbsZ.cjs → is-supported-locale-DUMI9QQ2.cjs} +1 -1
- package/dist/chunks/is-valid-package-name-Ds0DY5qP.cjs +1 -0
- package/dist/chunks/isNonEmptyArray-v52xg4Xj.cjs +1 -0
- package/dist/chunks/isPlainObject-fJEJm71P.cjs +1 -0
- package/dist/chunks/isValidUniversalIdentifier-DymFerYs.cjs +1 -0
- package/dist/chunks/isValidUuid-D3NV1xmO.cjs +1 -0
- package/dist/chunks/kebab-case-B3kq7ANN.cjs +1 -0
- package/dist/chunks/list-application-source-files-DcyU-HrX.cjs +1 -0
- package/dist/chunks/locale-catalog-format-BD4XDEnl.cjs +1 -0
- package/dist/chunks/{metadata-page.constant-qMNOJLjJ.cjs → metadata-page.constant-D4-pGQWp.cjs} +1 -1
- package/dist/chunks/parse-api-url-B5c0Gh_n.cjs +1 -0
- package/dist/chunks/parse-app-export-BC81wdmc.cjs +1 -0
- package/dist/chunks/parse-extraction-locale-B0apfizg.cjs +1 -0
- package/dist/chunks/parse-graphql-response-Cl8_fBgo.cjs +1 -0
- package/dist/chunks/parse-json-input-DxGKbeED.cjs +1 -0
- package/dist/chunks/print-typescript-value-BjYn0ZFT.cjs +3 -0
- package/dist/chunks/proxy-header-environment-variable.constant-CJyhJMve.cjs +1 -0
- package/dist/chunks/pull-minimum-sdk-version.constant-DUMi_IUD.cjs +6 -0
- package/dist/chunks/pull-source-CXQQf8Lw.cjs +1 -0
- package/dist/chunks/read-app-identity-Cny6sAGs.cjs +1 -0
- package/dist/chunks/read-application-identifier-C4U2JsfD.cjs +1 -0
- package/dist/chunks/read-application-identity-5sO-Mqb1.cjs +1 -0
- package/dist/chunks/read-bounded-body-BekYzK8S.cjs +1 -0
- package/dist/chunks/read-command-values-l5T9Lba4.cjs +1 -0
- package/dist/chunks/read-config-6GnzcpJm.cjs +1 -0
- package/dist/chunks/read-infer-deletion-option-Hv5V-A47.cjs +8 -0
- package/dist/chunks/read-json-object-BMftwGZ5.cjs +1 -0
- package/dist/chunks/read-local-container-Cs3cWspd.cjs +1 -0
- package/dist/chunks/read-snapshot-file-Dxla2ete.cjs +1 -0
- package/dist/chunks/{read-source-identity-CaErC5Qk.cjs → read-source-identity-CG9W0pSt.cjs} +1 -1
- package/dist/chunks/record-pull-base-8bIoAoiB.cjs +1 -0
- package/dist/chunks/{record-typecheck-config-inputs-BAruvIZV.cjs → record-typecheck-config-inputs-U2RUjjp9.cjs} +1 -1
- package/dist/chunks/request-oauth-tokens-_Xwy2q9c.cjs +1 -0
- package/dist/chunks/resolve-app-project-B4IjfcM-.cjs +1 -0
- package/dist/chunks/resolve-command-target-CLqjjxCT.cjs +1 -0
- package/dist/chunks/resolve-inside-sdk-DA7EQpf0.cjs +1 -0
- package/dist/chunks/resolve-metadata-object-7DhvIcEm.cjs +1 -0
- package/dist/chunks/resolve-project-typescript-DO4LrLr-.cjs +1 -0
- package/dist/chunks/resolve-proxy-headers-DipR9jft.cjs +1 -0
- package/dist/chunks/resolve-request-url-CfvGDGkw.cjs +1 -0
- package/dist/chunks/resolve-source-sdk-C4Hu045V.cjs +1 -0
- package/dist/chunks/run-api-graphql-command-ELrIPdM5.cjs +1 -0
- package/dist/chunks/run-api-rest-command-COVnszcN.cjs +1 -0
- package/dist/chunks/{run-app-add-command-qkKHuv9-.cjs → run-app-add-command-b9sm20rn.cjs} +20 -18
- package/dist/chunks/{run-app-apply-command-XNJHctjU.cjs → run-app-apply-command-CD7NOdiR.cjs} +2 -2
- package/dist/chunks/run-app-build-command-C8ubC2GH.cjs +2 -0
- package/dist/chunks/{run-app-dev-command-D6zVdTId.cjs → run-app-dev-command-D1JOfJv6.cjs} +2 -2
- package/dist/chunks/run-app-exec-command-cw4vPVHE.cjs +3 -0
- package/dist/chunks/run-app-generate-client-command-BVRFtPni.cjs +2 -0
- package/dist/chunks/{run-app-init-command-DcS8RfBK.cjs → run-app-init-command-DuxE1JhM.cjs} +2 -2
- package/dist/chunks/run-app-install-command-DlcUupwk.cjs +1 -0
- package/dist/chunks/run-app-logs-command-CaLIVesh.cjs +8 -0
- package/dist/chunks/run-app-operation-DKPh4r7b.cjs +1 -0
- package/dist/chunks/{run-app-plan-command-DcjgbzTy.cjs → run-app-plan-command-BGQ7vJZT.cjs} +1 -1
- package/dist/chunks/run-app-publish-command-BGNJVIBl.cjs +1 -0
- package/dist/chunks/run-app-pull-command-NbZ8fjhE.cjs +6 -0
- package/dist/chunks/run-app-translations-extract-command-CGIFvpC1.cjs +2 -0
- package/dist/chunks/{run-app-typecheck-command-D2Po43IB.cjs → run-app-typecheck-command-D0KV3hFS.cjs} +1 -1
- package/dist/chunks/{run-app-uninstall-command-DXyjeBwO.cjs → run-app-uninstall-command-CepQk4_4.cjs} +1 -1
- package/dist/chunks/run-auth-login-command-DpS1bUdL.cjs +1 -0
- package/dist/chunks/{run-auth-logout-command-ChrdwI-r.cjs → run-auth-logout-command-hvi_HvpQ.cjs} +1 -1
- package/dist/chunks/run-auth-status-command-Dr4YQuLn.cjs +1 -0
- package/dist/chunks/{run-cli-BoGzN25b.cjs → run-cli-oUabLHNz.cjs} +6 -6
- package/dist/chunks/run-commands-command-DYm9TuAx.cjs +2 -0
- package/dist/chunks/run-data-export-command-C4_7rc0v.cjs +3 -0
- package/dist/chunks/run-data-get-command-CcEYQ4xO.cjs +1 -0
- package/dist/chunks/run-data-list-command-D0K7HFD-.cjs +1 -0
- package/dist/chunks/run-doctor-command-fHf5vCGl.cjs +2 -0
- package/dist/chunks/run-local-logs-command-COsSRk3f.cjs +1 -0
- package/dist/chunks/run-local-reset-command-m0x-EiA6.cjs +2 -0
- package/dist/chunks/run-local-start-command-DsFS9_ew.cjs +1 -0
- package/dist/chunks/{run-local-status-command-ClvEgxcU.cjs → run-local-status-command-BYxy0R9I.cjs} +1 -1
- package/dist/chunks/run-local-stop-command-D66F73fW.cjs +1 -0
- package/dist/chunks/run-local-upgrade-command-6P71bQw6.cjs +1 -0
- package/dist/chunks/run-metadata-field-describe-command-nfKhj-m_.cjs +3 -0
- package/dist/chunks/{run-metadata-field-list-command-YCsoqOo1.cjs → run-metadata-field-list-command-CW2I6hmh.cjs} +1 -1
- package/dist/chunks/{run-metadata-object-describe-command-DpTobKR3.cjs → run-metadata-object-describe-command-WLxcOe4T.cjs} +1 -1
- package/dist/chunks/{run-metadata-object-list-command-BnSIIMDP.cjs → run-metadata-object-list-command-Q4pwAEwO.cjs} +1 -1
- package/dist/chunks/run-open-command-DPrz3N1e.cjs +1 -0
- package/dist/chunks/{run-remote-list-command-0f2QIf8C.cjs → run-remote-list-command-C2tZHRAT.cjs} +1 -1
- package/dist/chunks/{run-remote-remove-command-ClFB0Ub7.cjs → run-remote-remove-command-DgSQvjeN.cjs} +1 -1
- package/dist/chunks/{run-remote-rename-command-BVUcpZxq.cjs → run-remote-rename-command--37-GTRY.cjs} +1 -1
- package/dist/chunks/{run-remote-use-command-ByRTqnq5.cjs → run-remote-use-command-B6obKSPB.cjs} +1 -1
- package/dist/chunks/{run-version-command-_9OGraNf.cjs → run-version-command-BWTSv9_Y.cjs} +1 -1
- package/dist/chunks/select-target-Ck9mdMLQ.cjs +1 -0
- package/dist/chunks/sign-in-to-remote-again-DFQr-xvw.cjs +1 -0
- package/dist/chunks/sign-in-with-browser-TQANmPyb.cjs +124 -0
- package/dist/chunks/standard-object-fields.constant-C4AVX0t2.cjs +1 -0
- package/dist/chunks/subscribe-graphql-w-Ar4hCj.cjs +2 -0
- package/dist/chunks/to-public-target-BltDNpJN.cjs +1 -0
- package/dist/chunks/to-worker-output-diagnostics-w1hZPfn0.cjs +2 -0
- package/dist/chunks/{typecheck-application-BYPGp8lW.cjs → typecheck-application-8A504oUF.cjs} +1 -1
- package/dist/chunks/{update-config-ClCVH3C5.cjs → update-config-Bk0qgzgZ.cjs} +1 -1
- package/dist/chunks/wait-for-local-environment-zNEJcWA1.cjs +1 -0
- package/dist/chunks/write-config-atomically-B6XQJ6XK.cjs +1 -0
- package/dist/cli.cjs +1 -1
- package/docs/commands.md +875 -233
- package/package.json +3 -2
- package/src/app/README.md +15 -10
- package/src/app/add/README.md +75 -51
- package/src/app/bundles/README.md +56 -33
- package/src/app/client/README.md +23 -21
- package/src/app/dev/README.md +30 -16
- package/src/app/exec/README.md +61 -41
- package/src/app/function-logs/README.md +49 -32
- package/src/app/manifest/README.md +31 -25
- package/src/app/pull/README.md +191 -21
- package/src/app/source/README.md +67 -14
- package/src/app/typecheck/README.md +29 -24
- package/dist/chunks/application-T4xvzjbB.cjs +0 -5
- package/dist/chunks/build-source-manifest-tGYOCdor.cjs +0 -2
- package/dist/chunks/build-source-snapshot-CzwiB8HK.cjs +0 -26
- package/dist/chunks/collect-translatable-strings-BB6KpZT2.cjs +0 -1
- package/dist/chunks/collect-watch-inputs-Dn6g1cNu.cjs +0 -1
- package/dist/chunks/compile-application-translations-S-xuODkF.cjs +0 -870
- package/dist/chunks/constants-Bw_pUpSi-BsJPlw-e.cjs +0 -55
- package/dist/chunks/convert-to-label-CbLHl7Lv.cjs +0 -1
- package/dist/chunks/create-http-status-error-DBUhBnxP.cjs +0 -1
- package/dist/chunks/create-metadata-client-wHecaKNL.cjs +0 -6
- package/dist/chunks/create-pull-base-write-BZnZwrLk.cjs +0 -1
- package/dist/chunks/create-rest-client-B-kdRm7C.cjs +0 -1
- package/dist/chunks/extract-manifest-from-file-CNGCZF6o.cjs +0 -1
- package/dist/chunks/extract-source-translations-BHWNS2e9.cjs +0 -1
- package/dist/chunks/fetch-workspace-or-throw-CBKYiJI0.cjs +0 -1
- package/dist/chunks/format-body-C7fmVDAZ.cjs +0 -1
- package/dist/chunks/format-data-value-DuQjxLye.cjs +0 -1
- package/dist/chunks/format-metadata-fields-DPClLlzD.cjs +0 -2
- package/dist/chunks/format-metadata-owner-ffrpq9D6.cjs +0 -1
- package/dist/chunks/format-progress-line-Cj65-DU5.cjs +0 -1
- package/dist/chunks/generate-application-client-DjE_Tp0M.cjs +0 -1
- package/dist/chunks/get-function-input-schema-GNk3NRLJ-DscBUsKy.cjs +0 -1
- package/dist/chunks/get-local-status-D52rgA2e.cjs +0 -1
- package/dist/chunks/get-system-view-universal-identifier.util-DgYnPEO1-CKEQWit5.cjs +0 -1
- package/dist/chunks/global-flags.constant-C8Yu1rWc.cjs +0 -1
- package/dist/chunks/is-access-token-expiring-Cin0OQ-E.cjs +0 -1
- package/dist/chunks/is-application-not-found-error-BAsQDAoQ.cjs +0 -1
- package/dist/chunks/is-exported-manifest-COVWXnDs.cjs +0 -1
- package/dist/chunks/is-locale-catalog-D0wFrW8f.cjs +0 -1
- package/dist/chunks/is-supported-locale-C33Of85N.cjs +0 -1
- package/dist/chunks/is-valid-package-name-CfHS8_Lr.cjs +0 -1
- package/dist/chunks/kebab-case-D0usAzG-.cjs +0 -1
- package/dist/chunks/list-application-source-files-jEau5Rie.cjs +0 -1
- package/dist/chunks/locale-catalog-format-Cg9YplKA.cjs +0 -20
- package/dist/chunks/metadata-Db5EuDpT.cjs +0 -1
- package/dist/chunks/parse-api-url-jHzjLWX1.cjs +0 -1
- package/dist/chunks/parse-app-export-Dnu8mFrS.cjs +0 -1
- package/dist/chunks/parse-extraction-locale-h0bmy8hf.cjs +0 -1
- package/dist/chunks/parse-graphql-response-BSRJqolm.cjs +0 -1
- package/dist/chunks/parse-json-input-CN9Wyj73.cjs +0 -1
- package/dist/chunks/print-typescript-value-BsjFUceV.cjs +0 -3
- package/dist/chunks/pull-minimum-sdk-version.constant-BxmmUfee.cjs +0 -6
- package/dist/chunks/pull-source-BPng2lln.cjs +0 -1
- package/dist/chunks/read-app-identity-yX9-Ylxj.cjs +0 -1
- package/dist/chunks/read-application-identifier-DuI_jnU7.cjs +0 -1
- package/dist/chunks/read-application-identity-BFQ0oOna.cjs +0 -1
- package/dist/chunks/read-bounded-body-BHRu5J2Y.cjs +0 -1
- package/dist/chunks/read-command-values-rGaU2qHz.cjs +0 -1
- package/dist/chunks/read-config-DdGLulo-.cjs +0 -1
- package/dist/chunks/read-infer-deletion-option-uFunybak.cjs +0 -8
- package/dist/chunks/read-json-object-DcNHNB8I.cjs +0 -1
- package/dist/chunks/read-local-container-CPiVE1-D.cjs +0 -1
- package/dist/chunks/read-snapshot-file-BPLzlSH_.cjs +0 -1
- package/dist/chunks/record-pull-base-RQ2mlIWr.cjs +0 -1
- package/dist/chunks/request-oauth-tokens-Bp2eRh4F.cjs +0 -1
- package/dist/chunks/resolve-app-project-aqOLK3Gb.cjs +0 -1
- package/dist/chunks/resolve-command-target-D4gMeXgA.cjs +0 -1
- package/dist/chunks/resolve-inside-sdk-Ca2uRzQW.cjs +0 -1
- package/dist/chunks/resolve-metadata-object-xK90Ursp.cjs +0 -1
- package/dist/chunks/resolve-project-typescript-DkwXiCmt.cjs +0 -1
- package/dist/chunks/resolve-request-url-I1EOOumy.cjs +0 -1
- package/dist/chunks/resolve-source-sdk-CggXRBVx.cjs +0 -1
- package/dist/chunks/run-api-graphql-command-C3sJMP8H.cjs +0 -1
- package/dist/chunks/run-api-rest-command-DQOP-cn8.cjs +0 -1
- package/dist/chunks/run-app-build-command-CaInzuD2.cjs +0 -2
- package/dist/chunks/run-app-exec-command-DMHS9gpq.cjs +0 -3
- package/dist/chunks/run-app-generate-client-command-Ddq9lT40.cjs +0 -2
- package/dist/chunks/run-app-install-command-DUB3JTon.cjs +0 -1
- package/dist/chunks/run-app-logs-command-CQHxh_Dt.cjs +0 -9
- package/dist/chunks/run-app-operation-KdXiXPb6.cjs +0 -1
- package/dist/chunks/run-app-publish-command-DEV9zgL1.cjs +0 -1
- package/dist/chunks/run-app-pull-command-B-hxnqvY.cjs +0 -6
- package/dist/chunks/run-app-translations-extract-command-C0OfqFii.cjs +0 -2
- package/dist/chunks/run-auth-login-command-CVLvoJ7G.cjs +0 -1
- package/dist/chunks/run-auth-status-command-X0m6rzI-.cjs +0 -1
- package/dist/chunks/run-commands-command-hMdnwU8-.cjs +0 -2
- package/dist/chunks/run-data-get-command-DFE4NM2R.cjs +0 -1
- package/dist/chunks/run-data-list-command-BMEzitv6.cjs +0 -1
- package/dist/chunks/run-doctor-command-Bj2UR9ai.cjs +0 -2
- package/dist/chunks/run-local-logs-command-mUwB2XdV.cjs +0 -1
- package/dist/chunks/run-local-reset-command-WooW50PQ.cjs +0 -2
- package/dist/chunks/run-local-start-command-CiXP155w.cjs +0 -1
- package/dist/chunks/run-local-stop-command-BuV_YdJ7.cjs +0 -1
- package/dist/chunks/run-local-upgrade-command--O_EiVZc.cjs +0 -1
- package/dist/chunks/run-metadata-field-describe-command-iEw4KqIg.cjs +0 -3
- package/dist/chunks/run-open-command-DWLQ7z_P.cjs +0 -1
- package/dist/chunks/select-target-BHGEOc55.cjs +0 -1
- package/dist/chunks/sign-in-to-remote-again-DF27JFsz.cjs +0 -1
- package/dist/chunks/sign-in-with-browser-BNG4oa7e.cjs +0 -124
- package/dist/chunks/to-public-target-D00so1uO.cjs +0 -1
- package/dist/chunks/to-worker-output-diagnostics-WZlUWvcj.cjs +0 -2
- package/dist/chunks/utils-Ds_lD5Ag-DfSfzJJP.cjs +0 -11
- package/dist/chunks/wait-for-local-environment-CjCRJnhK.cjs +0 -1
- package/dist/chunks/write-config-atomically-CQdFdvWo.cjs +0 -1
- /package/dist/chunks/{capitalize-DFPVt1IM-CF4z3TZK.cjs → capitalize-CF4z3TZK.cjs} +0 -0
- /package/dist/chunks/{isDefined-Dtu5EYqP-CJctgvfE.cjs → isDefined-CJctgvfE.cjs} +0 -0
package/docs/commands.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
For available commands and flags, run `twenty commands` or
|
|
4
4
|
`twenty <command> --help`. This reference describes behavior, permissions and
|
|
5
|
-
failure recovery. See the [README](../README.md) to
|
|
5
|
+
failure recovery. See the [README](../README.md) to install and start the CLI,
|
|
6
|
+
or [Contributing](../CONTRIBUTING.md) to build it from source.
|
|
6
7
|
|
|
7
8
|
- [Connections and authentication](#connections-and-authentication)
|
|
8
9
|
- [Raw API requests](#raw-api-requests)
|
|
@@ -10,12 +11,16 @@ failure recovery. See the [README](../README.md) to build and start the CLI.
|
|
|
10
11
|
- [Doctor](#diagnose-your-setup)
|
|
11
12
|
- [Open](#open-the-workspace)
|
|
12
13
|
- [Metadata](#inspect-the-data-model)
|
|
13
|
-
- [Records](#read-records)
|
|
14
|
+
- [Records](#read-records) and [export](#export-records)
|
|
14
15
|
- [Local development environment](#run-a-local-development-environment)
|
|
15
16
|
- [App init](#create-an-app) and [add](#add-definitions-to-an-app)
|
|
16
17
|
- [Build and typecheck](#build-and-check-an-app)
|
|
17
|
-
- [Plan](#preview-app-changes), [apply](#apply-an-app) and
|
|
18
|
-
|
|
18
|
+
- [Plan](#preview-app-changes), [apply](#apply-an-app) and
|
|
19
|
+
[dev](#develop-an-app)
|
|
20
|
+
- [Pull](#pull-an-app) and [client generation](#regenerate-the-typed-client)
|
|
21
|
+
- [Install](#install-a-registered-app), [uninstall](#uninstall-an-app) and
|
|
22
|
+
[publish](#publish-an-app-to-npm)
|
|
23
|
+
- [Translations](#app-translations)
|
|
19
24
|
- [Function execution](#execute-an-app-function) and [logs](#watch-app-logs)
|
|
20
25
|
- [Expired browser sessions](#expired-browser-sessions)
|
|
21
26
|
- [Output and exit codes](#output)
|
|
@@ -30,24 +35,35 @@ twenty local logs --no-follow
|
|
|
30
35
|
twenty local stop
|
|
31
36
|
```
|
|
32
37
|
|
|
33
|
-
`local` runs the full Twenty development environment, including the web UI,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
38
|
+
`local` runs the full Twenty development environment, including the web UI, API,
|
|
39
|
+
worker and databases. Docker must be installed and running with a local socket
|
|
40
|
+
context; remote Docker endpoints are rejected. These commands need neither an
|
|
41
|
+
app directory nor a saved workspace connection. They do not sign in, change
|
|
42
|
+
remotes or apply an app.
|
|
43
|
+
|
|
44
|
+
### Start and select a version
|
|
45
|
+
|
|
46
|
+
`start [version]` creates an instance or starts the existing one, then waits up
|
|
47
|
+
to five minutes for `/healthz`. A readiness failure leaves the container and
|
|
48
|
+
data in place for diagnosis.
|
|
49
|
+
|
|
50
|
+
For a new instance, select the version in this order:
|
|
51
|
+
|
|
52
|
+
1. Explicit version or image tag.
|
|
53
|
+
2. Highest published version matching the nearest `package.json`'s
|
|
54
|
+
`engines.twenty`.
|
|
55
|
+
3. `latest`, only when no range exists.
|
|
56
|
+
|
|
57
|
+
A failed lookup or unmatched range is an error. Versions such as `2.53` and
|
|
58
|
+
`2.53.1` select `v2.53` and `v2.53.1`; `2.53` keeps the floating minor tag.
|
|
59
|
+
Other image tags are used as given. New instances pull the image before
|
|
60
|
+
creation, even if it is cached locally.
|
|
61
|
+
|
|
62
|
+
Existing instances keep their image and port; use `upgrade` to change versions.
|
|
63
|
+
Compatibility with `engines.twenty` uses the image's `APP_VERSION`. A missing,
|
|
64
|
+
invalid or incompatible version warns without preventing startup.
|
|
65
|
+
|
|
66
|
+
### Ports and test instances
|
|
51
67
|
|
|
52
68
|
New instances bind to loopback on port `2020`. Use `--port <port>` when creating
|
|
53
69
|
one. `--test` selects the separate test instance, default port `2021`; pass it
|
|
@@ -62,20 +78,28 @@ twenty local upgrade 2.53.1 --test
|
|
|
62
78
|
twenty local reset --test --yes
|
|
63
79
|
```
|
|
64
80
|
|
|
81
|
+
### Status, logs and cancellation
|
|
82
|
+
|
|
65
83
|
`status` reports `not-created`, `stopped`, `starting` or `healthy`; unavailable
|
|
66
84
|
Docker is an error. `logs` follows by default; `--no-follow` prints recent logs
|
|
67
85
|
and exits. It supports human or NDJSON output, with a terminal result or error;
|
|
68
86
|
other local commands support human or JSON output. Ctrl+C cancels the CLI
|
|
69
87
|
operation, without stopping the environment or deleting data.
|
|
70
88
|
|
|
89
|
+
### Stop or upgrade
|
|
90
|
+
|
|
71
91
|
`stop` preserves the container and all data. `upgrade [version]` uses the same
|
|
72
92
|
version selection as a new start. It pulls the image before stopping the old
|
|
73
93
|
instance, then recreates it with the same ports, named volumes and user-provided
|
|
74
|
-
environment overrides. The old container is kept until the replacement is
|
|
94
|
+
environment overrides. The old container is kept until the replacement is
|
|
95
|
+
created.
|
|
96
|
+
|
|
75
97
|
If creation fails or is cancelled, the CLI restores the old container and its
|
|
76
98
|
previous running state. If the image digest is unchanged, no restart occurs.
|
|
77
|
-
Custom storage layouts are rejected. Data volumes survive a failed upgrade,
|
|
78
|
-
|
|
99
|
+
Custom storage layouts are rejected. Data volumes survive a failed upgrade, but
|
|
100
|
+
database migrations are not automatically rolled back.
|
|
101
|
+
|
|
102
|
+
### Reset data
|
|
79
103
|
|
|
80
104
|
`reset` removes the selected container and its database, analytics and file
|
|
81
105
|
volumes. It requires confirmation, or `--yes` in scripts. It does not affect
|
|
@@ -89,9 +113,9 @@ twenty auth login --url https://acme.twenty.com
|
|
|
89
113
|
twenty auth status
|
|
90
114
|
```
|
|
91
115
|
|
|
92
|
-
The connection is named `default` when neither `--name` nor `--remote` is
|
|
93
|
-
Run `twenty auth login` again to sign in to that saved URL. To keep
|
|
94
|
-
connections, give each a name:
|
|
116
|
+
The connection is named `default` when neither `--name` nor `--remote` is
|
|
117
|
+
supplied. Run `twenty auth login` again to sign in to that saved URL. To keep
|
|
118
|
+
several connections, give each a name:
|
|
95
119
|
|
|
96
120
|
```bash
|
|
97
121
|
twenty auth login --url https://acme.twenty.com --name dev --use
|
|
@@ -109,19 +133,26 @@ For scripts, pass an API key through standard input:
|
|
|
109
133
|
printf '%s' "$TWENTY_API_KEY" | twenty auth login --with-token --url https://acme.twenty.com --name ci
|
|
110
134
|
```
|
|
111
135
|
|
|
136
|
+
### Saved connections
|
|
137
|
+
|
|
112
138
|
Credentials and remote settings are saved in `~/.twenty/config.json`, with
|
|
113
139
|
owner-only file permissions. Login validates credentials before saving them.
|
|
114
140
|
`--use` makes the remote the default; the first remote also becomes the default.
|
|
115
141
|
Creating the connection named `default` does not switch an existing default
|
|
116
142
|
remote unless you pass `--use`.
|
|
117
|
-
|
|
118
|
-
|
|
143
|
+
|
|
144
|
+
Use `twenty auth login --remote dev` to sign in again to a saved URL. Changing
|
|
145
|
+
an existing remote's URL requires `--replace`.
|
|
146
|
+
|
|
147
|
+
### Connection precedence
|
|
119
148
|
|
|
120
149
|
Commands select a workspace in this order:
|
|
121
150
|
|
|
122
151
|
1. `--remote <name>`, ignoring environment target settings with a warning.
|
|
123
|
-
2. `TWENTY_REMOTE`, which cannot be combined with either API environment
|
|
124
|
-
|
|
152
|
+
2. `TWENTY_REMOTE`, which cannot be combined with either API environment
|
|
153
|
+
variable.
|
|
154
|
+
3. `TWENTY_API_URL` and `TWENTY_API_KEY`, which must both be set and are not
|
|
155
|
+
saved.
|
|
125
156
|
4. The saved default remote.
|
|
126
157
|
|
|
127
158
|
```bash
|
|
@@ -135,10 +166,12 @@ both. Neither command revokes the server-side credential. `twenty auth token`
|
|
|
135
166
|
prints the selected credential for use in another tool; its output is a secret,
|
|
136
167
|
including in JSON mode.
|
|
137
168
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
169
|
+
### Noninteractive commands
|
|
170
|
+
|
|
171
|
+
`--no-input` disables prompts and browser opening. JSON/NDJSON output,
|
|
172
|
+
redirected stdin and CI also disable interaction. Pass required values and
|
|
173
|
+
explicit command-specific approvals, such as `app apply --create` or `--yes`, in
|
|
174
|
+
scripts. Disabling prompts does not approve an operation.
|
|
142
175
|
|
|
143
176
|
## Raw API requests
|
|
144
177
|
|
|
@@ -149,9 +182,9 @@ twenty api graphql --metadata --query '{ currentWorkspace { displayName } }'
|
|
|
149
182
|
```
|
|
150
183
|
|
|
151
184
|
Both commands use the selected connection. REST paths stay inside its API URL;
|
|
152
|
-
credentials are not sent to an arbitrary host. REST
|
|
153
|
-
|
|
154
|
-
|
|
185
|
+
credentials are not sent to an arbitrary host. REST uses GET by default.
|
|
186
|
+
`--body` accepts JSON inline, `@file.json`, or `-` for stdin and requires an
|
|
187
|
+
explicit `--method`.
|
|
155
188
|
|
|
156
189
|
```bash
|
|
157
190
|
twenty api rest /rest/companies --method POST --body '{"name":"Example"}'
|
|
@@ -160,8 +193,8 @@ twenty api graphql --query @query.graphql --variables @variables.json
|
|
|
160
193
|
|
|
161
194
|
GraphQL uses the core endpoint by default and the metadata endpoint with
|
|
162
195
|
`--metadata`. `--query` accepts a document inline, `@file.graphql` or `-`;
|
|
163
|
-
`--variables` accepts a JSON object through the same input forms. Only one
|
|
164
|
-
can read stdin. Mutations and REST writes execute directly, without a
|
|
196
|
+
`--variables` accepts a JSON object through the same input forms. Only one
|
|
197
|
+
option can read stdin. Mutations and REST writes execute directly, without a
|
|
165
198
|
confirmation step. Server permissions still apply.
|
|
166
199
|
|
|
167
200
|
Human output displays the response body. In JSON mode, REST returns status,
|
|
@@ -173,11 +206,75 @@ by the transport's 16 MiB limit; raw requests do not paginate automatically.
|
|
|
173
206
|
|
|
174
207
|
API requests, browser sign-in requests and app uploads honor `HTTP_PROXY`,
|
|
175
208
|
`HTTPS_PROXY` and `NO_PROXY` (also their lowercase equivalents, which take
|
|
176
|
-
precedence). `HTTP_PROXY` also covers HTTPS when `HTTPS_PROXY` is unset.
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
209
|
+
precedence). `HTTP_PROXY` also covers HTTPS when `HTTPS_PROXY` is unset. Use
|
|
210
|
+
`NO_PROXY=localhost,127.0.0.1` to bypass a proxy for local development, or
|
|
211
|
+
`NO_PROXY=*` to bypass it for all hosts.
|
|
212
|
+
|
|
213
|
+
Proxies must support HTTP CONNECT. For a corporate certificate authority, set
|
|
214
|
+
`NODE_EXTRA_CA_CERTS` before starting the CLI. TLS certificate verification
|
|
215
|
+
stays enabled.
|
|
216
|
+
|
|
217
|
+
## Authenticating proxies
|
|
218
|
+
|
|
219
|
+
When an identity-aware proxy such as Cloudflare Access, Google IAP, Pomerium or
|
|
220
|
+
oauth2-proxy sits in front of the server, the CLI's requests reach the proxy's
|
|
221
|
+
sign-in page instead of Twenty and fail with `PROXY_AUTH_REQUIRED` (exit 3).
|
|
222
|
+
Give the CLI the proxy's credentials as HTTP headers, either fixed values or a
|
|
223
|
+
command that prints fresh ones:
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
twenty auth login --url https://twenty.example.com \
|
|
227
|
+
--proxy-header-command 'echo "cf-access-token: $(cloudflared access token -app=https://twenty.example.com)"'
|
|
228
|
+
|
|
229
|
+
twenty auth login --url https://twenty.example.com \
|
|
230
|
+
--proxy-header "CF-Access-Client-Id: $CLIENT_ID" \
|
|
231
|
+
--proxy-header "CF-Access-Client-Secret: $CLIENT_SECRET"
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Both options are saved on the remote as `proxyHeaders` and `proxyHeaderCommand`
|
|
235
|
+
and apply to every later command that uses it. Passing an option replaces the
|
|
236
|
+
saved value; an empty value removes it. Logout keeps them;
|
|
237
|
+
`twenty remote remove` deletes them. When `--replace` points a remote at another
|
|
238
|
+
URL, saved proxy settings are not carried over unless you pass them again.
|
|
239
|
+
|
|
240
|
+
The command runs through your shell when a request first needs it, at most once
|
|
241
|
+
per CLI invocation, and must print one `Name: value` line per header within 60
|
|
242
|
+
seconds. If the proxy rejects the headers (a redirect to its sign-in page, or a
|
|
243
|
+
401/403 that is not a Twenty JSON response), the CLI runs the command again and
|
|
244
|
+
retries the request once; the proxy rejected it before Twenty received it.
|
|
245
|
+
Command headers take precedence over fixed headers of the same name.
|
|
246
|
+
|
|
247
|
+
For CI and other environments without a saved remote, set `TWENTY_PROXY_HEADERS`
|
|
248
|
+
(one `Name: value` per line) and `TWENTY_PROXY_HEADER_COMMAND`. They also apply
|
|
249
|
+
to saved remotes: environment headers override saved headers of the same name,
|
|
250
|
+
and the environment command replaces the saved one. Neither is passed to app
|
|
251
|
+
workers.
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
export TWENTY_PROXY_HEADERS="CF-Access-Client-Id: $CLIENT_ID
|
|
255
|
+
CF-Access-Client-Secret: $CLIENT_SECRET"
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Proxy headers are only sent to the host of the selected connection's API URL,
|
|
259
|
+
including app uploads that the server receives itself, and never to other hosts
|
|
260
|
+
such as pre-signed storage URLs. They cannot replace headers the CLI sets
|
|
261
|
+
itself, including `Authorization`; proxies that need their own bearer token,
|
|
262
|
+
such as Google IAP, accept it in `Proxy-Authorization`. Proxy settings are only
|
|
263
|
+
read from `~/.twenty/config.json`, the environment and command options, never
|
|
264
|
+
from an app project. Errors never include header values or the command's output,
|
|
265
|
+
only the end of its standard error.
|
|
266
|
+
|
|
267
|
+
Recipes:
|
|
268
|
+
|
|
269
|
+
| Proxy | Setting |
|
|
270
|
+
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
271
|
+
| Cloudflare Access, as a user | `--proxy-header-command 'echo "cf-access-token: $(cloudflared access token -app=<url>)"'` after `cloudflared access login <url>` |
|
|
272
|
+
| Cloudflare Access, service token | `--proxy-header "CF-Access-Client-Id: …" --proxy-header "CF-Access-Client-Secret: …"` |
|
|
273
|
+
| Google IAP | A `--proxy-header-command` that prints `Proxy-Authorization: Bearer <token>` with an OIDC token for the IAP client ID, for example from `gcloud auth print-identity-token` |
|
|
274
|
+
| Pomerium, oauth2-proxy | The bearer or session header your deployment accepts, from its own CLI or a service account |
|
|
275
|
+
|
|
276
|
+
Without changing CLI settings, a local tunnel such as `cloudflared access tcp`
|
|
277
|
+
also works: point the remote at the tunnel's `localhost` address.
|
|
181
278
|
|
|
182
279
|
## Diagnose your setup
|
|
183
280
|
|
|
@@ -187,11 +284,51 @@ twenty doctor --remote staging --path ./my-app --json
|
|
|
187
284
|
twenty doctor --offline
|
|
188
285
|
```
|
|
189
286
|
|
|
190
|
-
|
|
287
|
+
### Checks and scope
|
|
288
|
+
|
|
289
|
+
`doctor` checks:
|
|
290
|
+
|
|
291
|
+
- The CLI and Node versions.
|
|
292
|
+
- Executable ownership and precedence on `PATH`.
|
|
293
|
+
- Configuration and the selected connection.
|
|
294
|
+
- An app's installed SDK authoring exports.
|
|
295
|
+
|
|
296
|
+
It works without an app or saved remote; unavailable optional checks are
|
|
297
|
+
`skipped`. Use `--path` to require a specific app.
|
|
298
|
+
|
|
299
|
+
PATH inspection does not execute binaries or inspect shell aliases, functions or
|
|
300
|
+
command caches. Package-manager wrappers with indeterminate ownership are
|
|
301
|
+
reported as unknown.
|
|
302
|
+
|
|
303
|
+
### Network access and expired credentials
|
|
304
|
+
|
|
305
|
+
By default it sends one read-only request to the selected workspace's metadata
|
|
306
|
+
endpoint to check access. This does not prove access to every object or app
|
|
307
|
+
operation. `--offline` disables network requests. The network check runs a
|
|
308
|
+
configured proxy header command; `--offline` does not.
|
|
309
|
+
|
|
310
|
+
Doctor never imports app or SDK code, builds an app, installs packages, repairs
|
|
311
|
+
files, or refreshes credentials.
|
|
312
|
+
|
|
313
|
+
An expired OAuth access token skips the network check: it produces a warning
|
|
314
|
+
when a refresh token is saved (renewal remains unverified), or a failure when
|
|
315
|
+
there is none. Renew through `twenty auth status` for the same remote, or sign
|
|
316
|
+
in again.
|
|
191
317
|
|
|
192
|
-
|
|
318
|
+
### Doctor results
|
|
193
319
|
|
|
194
|
-
Each check has an `id`, `status
|
|
320
|
+
Each check has an `id`, `status`, message, and optional code, hint and details.
|
|
321
|
+
Statuses are `pass`, `warning`, `fail` or `skipped`.
|
|
322
|
+
|
|
323
|
+
| Result | Exit code | JSON checklist |
|
|
324
|
+
| ------------------------------------------ | ------------------ | ---------------------- |
|
|
325
|
+
| At least one failed check | 1, `DOCTOR_FAILED` | `error.details.checks` |
|
|
326
|
+
| No failed checks, including warnings/skips | 0 | `data.checks` |
|
|
327
|
+
| Ctrl+C | 130 | Cancellation error |
|
|
328
|
+
|
|
329
|
+
Human output shows the full checklist on success or failure. Output omits
|
|
330
|
+
credentials, server response bodies and user identity, but includes local paths
|
|
331
|
+
and the selected API URL.
|
|
195
332
|
|
|
196
333
|
## Open the workspace
|
|
197
334
|
|
|
@@ -201,7 +338,15 @@ twenty open settings/applications
|
|
|
201
338
|
twenty open --remote staging --url-only --json
|
|
202
339
|
```
|
|
203
340
|
|
|
204
|
-
`open` asks the selected workspace for its web address, which is its custom
|
|
341
|
+
`open` asks the selected workspace for its web address, which is its custom
|
|
342
|
+
domain when one is enabled and its subdomain otherwise. It then opens that
|
|
343
|
+
address, or a page inside it, in your default browser. The address carries no
|
|
344
|
+
credentials, so sign in to the workspace in the browser if needed.
|
|
345
|
+
|
|
346
|
+
A browser only opens in an interactive terminal: with `--no-input`, JSON output,
|
|
347
|
+
redirected stdin or in CI, the command stops with `USAGE` (exit 2) unless
|
|
348
|
+
`--url-only` is set, which prints the address instead. A page is a path inside
|
|
349
|
+
the workspace; one that would lead to another site is refused with `USAGE`.
|
|
205
350
|
|
|
206
351
|
If the workspace returns no web address, `open` uses the frontend origin from
|
|
207
352
|
the server's OAuth discovery document. It drops the authorization path, query,
|
|
@@ -217,11 +362,26 @@ twenty metadata field list companies --all
|
|
|
217
362
|
twenty metadata field describe companies tier --json
|
|
218
363
|
```
|
|
219
364
|
|
|
220
|
-
Object arguments accept exact, case-sensitive singular or plural API names.
|
|
365
|
+
Object arguments accept exact, case-sensitive singular or plural API names.
|
|
366
|
+
Field arguments accept exact API names. Labels are never matched, and ambiguous
|
|
367
|
+
names fail with `AMBIGUOUS_RESOURCE` (exit 2). Missing names return `NOT_FOUND`
|
|
368
|
+
(exit 4).
|
|
221
369
|
|
|
222
|
-
Object describe shows object properties. Use field list to inspect its fields;
|
|
370
|
+
Object describe shows object properties. Use field list to inspect its fields;
|
|
371
|
+
system fields are hidden unless `--all` is present. Field describe can inspect a
|
|
372
|
+
named system field directly. Each field reports its own owner, independently of
|
|
373
|
+
its object. If application names cannot be read, Custom remains identifiable and
|
|
374
|
+
other owners are reported as unknown with a warning; ownership is not a
|
|
375
|
+
permission check.
|
|
223
376
|
|
|
224
|
-
Inspection reads every metadata page before resolving names, so a match on an
|
|
377
|
+
Inspection reads every metadata page before resolving names, so a match on an
|
|
378
|
+
early page cannot hide an ambiguity on a later one. Each object/field traversal
|
|
379
|
+
is capped at 10,000 items or 16 MiB of node data; exceeding either limit fails
|
|
380
|
+
instead of returning incomplete metadata. Requests use the selected connection
|
|
381
|
+
and fetch live metadata on every invocation.
|
|
382
|
+
|
|
383
|
+
Human output shows labels, constraints, options and relationships; JSON also
|
|
384
|
+
preserves IDs, universal identifiers, settings and relationship endpoints.
|
|
225
385
|
|
|
226
386
|
## Read records
|
|
227
387
|
|
|
@@ -232,15 +392,102 @@ twenty data get people <id> --json
|
|
|
232
392
|
twenty data list people --all --format ndjson
|
|
233
393
|
```
|
|
234
394
|
|
|
235
|
-
These commands resolve the same exact singular/plural API names as metadata
|
|
395
|
+
These commands resolve the same exact singular/plural API names as metadata
|
|
396
|
+
inspection, including custom objects, and reuse the selected connection. They
|
|
397
|
+
require access to object metadata as well as the records. `data get` reads one
|
|
398
|
+
record with one level of related records; it does not recursively expand or
|
|
399
|
+
paginate relations.
|
|
400
|
+
|
|
401
|
+
### Pages and filters
|
|
402
|
+
|
|
403
|
+
`data list` reads one page by default, with a default `--limit` of 50 and a
|
|
404
|
+
maximum of 200. `--cursor` passes the opaque REST `starting_after` cursor.
|
|
405
|
+
`--filter` and `--order-by` pass REST expressions unchanged; server ordering and
|
|
406
|
+
its ID tie-breaker are preserved. Every result includes page information, and
|
|
407
|
+
human output shows a next-page command.
|
|
408
|
+
|
|
409
|
+
Pagination is not a database snapshot; concurrent writes can change results or
|
|
410
|
+
totals during traversal.
|
|
411
|
+
|
|
412
|
+
### Record output
|
|
413
|
+
|
|
414
|
+
`--fields name,employees` selects human table columns only. Tables shorten cells
|
|
415
|
+
longer than 60 characters and display absent values as `-`. JSON and NDJSON
|
|
416
|
+
retain full records, including composite values and relation identifiers.
|
|
417
|
+
|
|
418
|
+
`--all` reads every remaining page, including when starting from `--cursor`.
|
|
419
|
+
Human/JSON results are limited to 10,000 records and 16 MiB of serialized
|
|
420
|
+
payload; human tables are also bounded. Exceeding a limit returns
|
|
421
|
+
`RESULT_LIMIT_EXCEEDED` (exit 2), with no partial success. Every HTTP response
|
|
422
|
+
is separately limited to 16 MiB, including in NDJSON mode.
|
|
423
|
+
|
|
424
|
+
### Stream large traversals
|
|
425
|
+
|
|
426
|
+
Use explicit `--format ndjson` for larger traversals. It emits numbered `start`,
|
|
427
|
+
`record`, page `progress`, and terminal `result`/`error` events, reading one
|
|
428
|
+
page at a time and waiting for stdout when the reader is slow. `resumeCursor`
|
|
429
|
+
advances only after a complete page has been written.
|
|
430
|
+
|
|
431
|
+
After a partial page or a failure, resume with the last reported cursor and the
|
|
432
|
+
same filter/order; records from the partial page may repeat. With no completed
|
|
433
|
+
page, use the original cursor or restart without one. A stream without a
|
|
434
|
+
terminal event is incomplete. Without `--all`, NDJSON still reads only one page.
|
|
435
|
+
|
|
436
|
+
## Export records
|
|
437
|
+
|
|
438
|
+
```bash
|
|
439
|
+
twenty data export companies --output companies.csv
|
|
440
|
+
twenty data export companies --fields name,domainName,employees --filter 'employees[gte]:5000' --output large-companies.csv
|
|
441
|
+
twenty data export people --order-by 'name.lastName[AscNullsLast]' --output people.csv --format ndjson
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
`data export` runs a server-side CSV export, follows progress and immediately
|
|
445
|
+
downloads the result. It requires `EXPORT_CSV`, access to the object's metadata
|
|
446
|
+
and records, and a server supporting asynchronous record export. API-key
|
|
447
|
+
connections require a server that supports API keys for record export;
|
|
448
|
+
browser-authenticated connections use the same user permissions as other
|
|
449
|
+
commands.
|
|
450
|
+
|
|
451
|
+
### CSV columns and permissions
|
|
236
452
|
|
|
237
|
-
|
|
453
|
+
`--fields` selects active field API names in CSV order. By default, all active
|
|
454
|
+
non-system fields are selected. The server always includes `Id` first, expands
|
|
455
|
+
composite fields into columns and exports many-to-one relations as IDs. Filters
|
|
456
|
+
and ordering use the REST expression syntax from `data list`, converted to the
|
|
457
|
+
export subscription's input. Row and field permissions still apply on the
|
|
458
|
+
server.
|
|
238
459
|
|
|
239
|
-
|
|
460
|
+
### Download and overwrite behavior
|
|
240
461
|
|
|
241
|
-
`--
|
|
462
|
+
`--output` is required and names a file, not stdout. Existing files are
|
|
463
|
+
preserved unless `--force` is passed. CSV bytes stream to a private temporary
|
|
464
|
+
file in the destination directory, with a 1 GiB limit and a 15-minute download
|
|
465
|
+
timeout. The destination appears, or is replaced with `--force`, only after the
|
|
466
|
+
download finishes.
|
|
242
467
|
|
|
243
|
-
|
|
468
|
+
On failure or cancellation, the CLI attempts to remove the temporary file and
|
|
469
|
+
preserves an existing destination. On systems with POSIX permissions, the saved
|
|
470
|
+
CSV remains readable and writable only by its owner (mode `0600`).
|
|
471
|
+
|
|
472
|
+
Without `--force`, the destination filesystem must support hard links; for
|
|
473
|
+
filesystems such as exFAT, choose another destination or pass `--force` to allow
|
|
474
|
+
replacement.
|
|
475
|
+
|
|
476
|
+
### Export output
|
|
477
|
+
|
|
478
|
+
Human output shows an updating percentage bar in an interactive terminal and the
|
|
479
|
+
saved file's size. Redirected output, CI and terminals with `TERM=dumb` use
|
|
480
|
+
plain progress lines. JSON returns one result containing the export ID, object,
|
|
481
|
+
output path, byte count and elapsed time. NDJSON emits `start`, percentage
|
|
482
|
+
`progress`, and terminal `result` or `error` events. CSV contents are written
|
|
483
|
+
only to the output file.
|
|
484
|
+
|
|
485
|
+
### Interrupted exports
|
|
486
|
+
|
|
487
|
+
Keep the command connected until it finishes. Downloads use the same credential
|
|
488
|
+
that started the export and the server's short-lived, single-use link. If
|
|
489
|
+
generation or download is interrupted, run the export again; there is no resume
|
|
490
|
+
or redownload command.
|
|
244
491
|
|
|
245
492
|
## Create an app
|
|
246
493
|
|
|
@@ -249,23 +496,51 @@ twenty app init my-app
|
|
|
249
496
|
twenty app init billing --path ./apps/billing --display-name Billing --json
|
|
250
497
|
```
|
|
251
498
|
|
|
252
|
-
`app init` creates a new app from the template bundled with the CLI, with fresh
|
|
499
|
+
`app init` creates a new app from the template bundled with the CLI, with fresh
|
|
500
|
+
universal identifiers and `twenty-client-sdk`, `twenty-sdk` and `twenty-ui`
|
|
501
|
+
pinned to the exact version the CLI was built with.
|
|
502
|
+
|
|
503
|
+
It needs no installed SDK, saved remote or network access, and it only writes
|
|
504
|
+
files: it does not install dependencies, create a Git repository, start a
|
|
505
|
+
server, sign in or sync anything. A published CLI also writes a `yarn.lock`, so
|
|
506
|
+
the first `yarn install` uses exact, integrity-checked versions.
|
|
507
|
+
|
|
508
|
+
The next steps it prints, and returns as `data.nextSteps` in JSON, cover the
|
|
509
|
+
rest, and name the remote when you pass `--remote`.
|
|
510
|
+
|
|
511
|
+
### Project name and destination
|
|
512
|
+
|
|
513
|
+
The name must be a valid npm package name, otherwise the command fails with
|
|
514
|
+
`INVALID_APP_NAME` (exit 2). The app is created in `./<name>` unless `--path`
|
|
515
|
+
says otherwise; `--display-name` and `--description` set what Twenty shows.
|
|
516
|
+
|
|
517
|
+
The target must not exist yet or be an empty directory; anything else fails with
|
|
518
|
+
`APP_PATH_UNAVAILABLE` (exit 6) and nothing is written. The template is rendered
|
|
519
|
+
in a hidden sibling directory and moved into place only after every placeholder
|
|
520
|
+
was filled, so a failure or Ctrl+C does not leave a half-created app behind.
|
|
253
521
|
|
|
254
|
-
|
|
522
|
+
An existing empty directory is filled with create-only writes, so a file that
|
|
523
|
+
appears there meanwhile is never overwritten.
|
|
255
524
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
525
|
+
### Server compatibility
|
|
526
|
+
|
|
527
|
+
New apps declare `engines.twenty` as `>=` the template release version. The
|
|
528
|
+
server checks this range against the workspace's completed upgrade version on
|
|
529
|
+
apply. Upgrade the workspace before deploying a newer template, including during
|
|
530
|
+
local development. Adjust the range only after testing the app against older
|
|
531
|
+
versions.
|
|
532
|
+
|
|
533
|
+
### Generated test harness
|
|
260
534
|
|
|
261
535
|
The integration tests of a new app run against a workspace through this CLI.
|
|
262
536
|
`src/__tests__/global-setup.ts` uninstalls any previous copy, runs
|
|
263
537
|
`twenty app apply --create` before the tests and `twenty app uninstall --yes`
|
|
264
|
-
after them, through `src/__tests__/run-twenty.ts`.
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
538
|
+
after them, through `src/__tests__/run-twenty.ts`.
|
|
539
|
+
|
|
540
|
+
That helper runs `twenty` with `--json`, returns its result, and passes its
|
|
541
|
+
progress through. It skips the binaries a package manager puts first on `PATH`
|
|
542
|
+
inside `yarn test`, so the globally installed CLI runs; set `TWENTY_CLI` to use
|
|
543
|
+
another executable. Credentials come from `TWENTY_API_URL` and `TWENTY_API_KEY`,
|
|
269
544
|
which the template's Vitest config sets.
|
|
270
545
|
|
|
271
546
|
## Add definitions to an app
|
|
@@ -279,10 +554,12 @@ twenty app add logic-function --name send-invoice --no-input
|
|
|
279
554
|
twenty app add front-component --name invoice-panel --no-input
|
|
280
555
|
```
|
|
281
556
|
|
|
282
|
-
`app add` creates definitions from the CLI's templates.
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
`
|
|
557
|
+
`app add` creates definitions from the CLI's templates. It discovers the
|
|
558
|
+
containing app, or accepts `--path <app-directory>`. No sign-in or workspace
|
|
559
|
+
connection is needed. Use `object`, `field`, `logic-function`, `front-component`
|
|
560
|
+
or `validation-rule`.
|
|
561
|
+
|
|
562
|
+
### Object companions
|
|
286
563
|
|
|
287
564
|
Objects can also create optional UI definitions:
|
|
288
565
|
|
|
@@ -295,24 +572,31 @@ Combine these flags to select what to generate without a companion prompt.
|
|
|
295
572
|
Without any creation flags, a human interactive terminal asks whether to create
|
|
296
573
|
all three, defaulting to No. Press Enter or answer No to create only the object.
|
|
297
574
|
With `--no-input`, `--json`, redirected stdin or CI, companions are created only
|
|
298
|
-
when explicitly requested by flags.
|
|
299
|
-
|
|
300
|
-
|
|
575
|
+
when explicitly requested by flags.
|
|
576
|
+
|
|
577
|
+
These flags are valid only for objects. View, navigation and layout files go
|
|
578
|
+
under `src/views`, `src/navigation-menu-items` and `src/page-layouts`.
|
|
301
579
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
580
|
+
### Generated files
|
|
581
|
+
|
|
582
|
+
Files are created under `src/objects`, `src/fields`, `src/logic-functions`,
|
|
583
|
+
`src/front-components` and `src/validation-rules`, with kebab-case filenames and
|
|
584
|
+
fresh universal UUIDs. Existing files are never replaced, including filename
|
|
585
|
+
collisions after case normalization. Symlinked destination paths are refused.
|
|
586
|
+
Both cases exit 6. JSON returns app-relative paths in `data.createdPaths`.
|
|
587
|
+
|
|
588
|
+
### Required inputs
|
|
307
589
|
|
|
308
590
|
Omitted values are prompted only in a human interactive terminal. With `--json`,
|
|
309
|
-
`--no-input`, redirected stdin or CI, required values must be supplied
|
|
310
|
-
or the command exits 2 before creating files. Labels default to the
|
|
311
|
-
default to `TEXT`. `--object` requires the parent's universal
|
|
312
|
-
workspace database ID.
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
591
|
+
`--no-input`, redirected stdin or CI, required values must be supplied
|
|
592
|
+
explicitly or the command exits 2 before creating files. Labels default to the
|
|
593
|
+
name; fields default to `TEXT`. `--object` requires the parent's universal
|
|
594
|
+
identifier, not its workspace database ID.
|
|
595
|
+
|
|
596
|
+
Relations additionally require `--target-object` and `--target-field`;
|
|
597
|
+
`--relation-type` defaults to `ONE_TO_MANY` and `--on-delete` to `CASCADE`. The
|
|
598
|
+
command does not create the reverse field or check that these identifiers exist
|
|
599
|
+
in a workspace.
|
|
316
600
|
|
|
317
601
|
Review the generated definition and its type-specific settings, then run
|
|
318
602
|
`twenty app build` and `twenty app plan`. Generation does not install or apply
|
|
@@ -327,47 +611,65 @@ twenty app typecheck
|
|
|
327
611
|
twenty app build --path ./apps/billing --json
|
|
328
612
|
```
|
|
329
613
|
|
|
330
|
-
These commands run inside an app project: the nearest folder, from the current
|
|
614
|
+
These commands run inside an app project: the nearest folder, from the current
|
|
615
|
+
one upwards, whose `package.json` depends on `twenty-sdk`. Pass `--path` to
|
|
616
|
+
choose another app. In a folder that contains several apps, `--path` is
|
|
617
|
+
required, and the error lists them.
|
|
618
|
+
|
|
619
|
+
### SDK requirements
|
|
331
620
|
|
|
332
621
|
The CLI owns manifest generation, bundling and typechecking. It uses the app's
|
|
333
622
|
installed `twenty-sdk` authoring exports (`define` and `front-component`, SDK
|
|
334
623
|
`>=1.23.0`). An app without an installed SDK fails with `SDK_NOT_INSTALLED`;
|
|
335
|
-
missing or unsupported authoring
|
|
336
|
-
|
|
337
|
-
`engines.node` range accepts fails
|
|
338
|
-
Node version outside that range
|
|
339
|
-
warning, which `doctor` also reports.
|
|
340
|
-
|
|
341
|
-
|
|
624
|
+
missing or unsupported authoring exports fail with `SDK_SOURCE_UNSUPPORTED`.
|
|
625
|
+
|
|
626
|
+
A Node version below every version the SDK's `engines.node` range accepts fails
|
|
627
|
+
with `NODE_VERSION_UNSUPPORTED`; any other Node version outside that range
|
|
628
|
+
continues with a `NODE_VERSION_UNTESTED` warning, which `doctor` also reports.
|
|
629
|
+
The CLI never installs dependencies or substitutes another SDK.
|
|
630
|
+
|
|
631
|
+
Yarn Plug'n'Play is not supported; use `nodeLinker: node-modules`.
|
|
632
|
+
|
|
633
|
+
### Compiler requirements
|
|
342
634
|
|
|
343
635
|
Typechecking uses `typescript` installed in the app or its workspace, never the
|
|
344
636
|
global CLI's parser dependency. Missing TypeScript fails with
|
|
345
637
|
`TYPESCRIPT_NOT_INSTALLED`. Configuration errors and unbuilt project references
|
|
346
|
-
fail with `TYPECHECK_FAILED`.
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
638
|
+
fail with `TYPECHECK_FAILED`.
|
|
639
|
+
|
|
640
|
+
For example, a project with an unbuilt reference to `tsconfig.spec.json` can
|
|
641
|
+
report `TS6305`: remove an unintended reference, or build the referenced project
|
|
642
|
+
before checking the app. Changing compiler versions can also change diagnostics.
|
|
643
|
+
|
|
644
|
+
### Worker isolation
|
|
350
645
|
|
|
351
646
|
Builds run in a separate worker process. That process does not receive the CLI's
|
|
352
647
|
connections or credentials: `TWENTY_API_URL`, `TWENTY_API_KEY`, `TWENTY_REMOTE`
|
|
353
|
-
and every `TWENTY_*` token, key, secret or password variable are removed from
|
|
354
|
-
environment.
|
|
355
|
-
|
|
356
|
-
|
|
648
|
+
and every `TWENTY_*` token, key, secret or password variable are removed from
|
|
649
|
+
its environment.
|
|
650
|
+
|
|
651
|
+
App and SDK output becomes `PROJECT_OUTPUT` diagnostics; an app that exits the
|
|
652
|
+
process fails with `WORKER_FAILED`. This separates output and process state; it
|
|
653
|
+
is not a sandbox for untrusted code.
|
|
654
|
+
|
|
655
|
+
### Build output and errors
|
|
357
656
|
|
|
358
657
|
`app build` produces a temporary snapshot under `.twenty/cli/snapshots`, reports
|
|
359
|
-
its files, upload roles, sizes, SHA-256 checksums, content hash and manifest,
|
|
360
|
-
deletes the snapshot. Nothing is uploaded or kept. `app typecheck` checks
|
|
361
|
-
project without writing files. Build and type errors exit 1 with diagnostics
|
|
362
|
-
`error.details.diagnostics`.
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
658
|
+
its files, upload roles, sizes, SHA-256 checksums, content hash and manifest,
|
|
659
|
+
then deletes the snapshot. Nothing is uploaded or kept. `app typecheck` checks
|
|
660
|
+
the project without writing files. Build and type errors exit 1 with diagnostics
|
|
661
|
+
in `error.details.diagnostics`.
|
|
662
|
+
|
|
663
|
+
Worker failures report the underlying code in `error.details.toolingErrorCode`.
|
|
664
|
+
Worker process failures use `error.details.workerErrorCode`. Ctrl+C cancels the
|
|
665
|
+
worker and exits 130; a worker that does not stop within a few seconds is
|
|
666
|
+
killed. The JSON `sdk` object identifies the app's installed authoring SDK
|
|
667
|
+
version.
|
|
668
|
+
|
|
669
|
+
The CLI version determines build rules, including derived permission
|
|
670
|
+
identifiers. Different tooling versions can produce different manifests. Run
|
|
671
|
+
`twenty app plan` and inspect the changes before applying an app with a
|
|
672
|
+
different tooling version.
|
|
371
673
|
|
|
372
674
|
## Preview app changes
|
|
373
675
|
|
|
@@ -377,11 +679,40 @@ twenty app plan --path ./apps/billing --no-prune --json
|
|
|
377
679
|
twenty app plan --prune
|
|
378
680
|
```
|
|
379
681
|
|
|
380
|
-
`app plan` builds once with the CLI pipeline, releases the temporary snapshot,
|
|
682
|
+
`app plan` builds once with the CLI pipeline, releases the temporary snapshot,
|
|
683
|
+
then requests the server's metadata preview with `dryRun: true`. It uses the
|
|
684
|
+
usual connection selection and requires the server's `APPLICATIONS` permission.
|
|
685
|
+
The server enforces authorization, ownership and manifest/version compatibility.
|
|
686
|
+
|
|
687
|
+
No registration, installation, upload or metadata synchronization is performed,
|
|
688
|
+
and planning never advances a pull base. The local build can generate app
|
|
689
|
+
artifacts, just as `app build` does.
|
|
690
|
+
|
|
691
|
+
JSON marks plans with `plan: true`. A plan is not a saved approval: remote
|
|
692
|
+
changes can alter what a later apply does. A missing owned application
|
|
693
|
+
registration returns `PLAN_UNAVAILABLE` (exit 1). Register the app with
|
|
694
|
+
`twenty app apply --create`, then plan again.
|
|
695
|
+
|
|
696
|
+
### Deletions and plan output
|
|
381
697
|
|
|
382
|
-
|
|
698
|
+
Entities missing from source are included as deletions by default, except for
|
|
699
|
+
the workspace custom application, which keeps them unless you pass `--prune`.
|
|
700
|
+
`--no-prune` passes `inferDeletionFromMissingEntities: false` to the preview and
|
|
701
|
+
`--prune` passes `true`; without either the argument is omitted and the server
|
|
702
|
+
decides.
|
|
383
703
|
|
|
384
|
-
|
|
704
|
+
Servers released before `--prune` existed treat an omitted argument as `true`,
|
|
705
|
+
so pass `--no-prune` to keep entities against them. The deprecated `--no-delete`
|
|
706
|
+
still works as `--no-prune` with a `DEPRECATED_OPTION` warning; an explicit
|
|
707
|
+
`--prune` or `--no-prune` takes precedence over it.
|
|
708
|
+
|
|
709
|
+
Human output lists every action, identifies object/field deletions that would
|
|
710
|
+
remove stored data, and shows the opt-out hint. JSON includes action details and
|
|
711
|
+
counts. Application-variable values, including previous values in updates, are
|
|
712
|
+
redacted from all plan actions regardless of their `isSecret` setting.
|
|
713
|
+
|
|
714
|
+
A plan exceeding 10,000 actions or the transport's 16 MiB response limit fails
|
|
715
|
+
instead of displaying an incomplete plan.
|
|
385
716
|
|
|
386
717
|
## Apply an app
|
|
387
718
|
|
|
@@ -392,16 +723,91 @@ twenty app apply --no-prune
|
|
|
392
723
|
twenty app apply --prune
|
|
393
724
|
```
|
|
394
725
|
|
|
395
|
-
`app apply` builds the app once with the CLI pipeline and keeps that build's
|
|
726
|
+
`app apply` builds the app once with the CLI pipeline and keeps that build's
|
|
727
|
+
snapshot until it finishes, so the files it uploads are the ones it built. It
|
|
728
|
+
then asks the workspace for a fresh plan, shows it, and applies it: it installs
|
|
729
|
+
the development app if needed, uploads the snapshot files, synchronizes the
|
|
730
|
+
manifest, and regenerates the app's typed API client. It needs the server's
|
|
731
|
+
`APPLICATIONS` and `UPLOAD_FILE` permissions.
|
|
732
|
+
|
|
733
|
+
### Register a new app
|
|
734
|
+
|
|
735
|
+
An app without a registration needs `--create`, or a yes at the prompt in an
|
|
736
|
+
interactive terminal. The CLI then registers the app (the server also requires
|
|
737
|
+
`API_KEYS_AND_WEBHOOKS` for this), installs it, and plans its changes before
|
|
738
|
+
uploading anything. Without approval it stops with `CREATE_REQUIRED` (exit 2).
|
|
739
|
+
The registration's client secret is never requested.
|
|
740
|
+
|
|
741
|
+
### Approve deletions
|
|
742
|
+
|
|
743
|
+
Entities missing from source are deleted by default (except in the workspace
|
|
744
|
+
custom application), as in `app plan`; `--no-prune` keeps them, `--prune`
|
|
745
|
+
deletes them in every app, and the choice is sent to both the plan and the sync.
|
|
746
|
+
JSON reports `inferDeletionFromMissingEntities: null` when neither flag is
|
|
747
|
+
passed.
|
|
748
|
+
|
|
749
|
+
Object and field deletions permanently delete stored data, so they need `--yes`
|
|
750
|
+
or a yes at the prompt. Otherwise the command stops with `CONFIRMATION_REQUIRED`
|
|
751
|
+
(exit 2) before changing anything. `--yes` never changes which entities are
|
|
752
|
+
deleted.
|
|
753
|
+
|
|
754
|
+
### Upload the built files
|
|
755
|
+
|
|
756
|
+
File bytes go straight to the upload URLs the server returns, without the CLI's
|
|
757
|
+
credentials. Each file is checked against the build's size and SHA-256 before
|
|
758
|
+
anything is uploaded.
|
|
396
759
|
|
|
397
|
-
|
|
398
|
-
- **Deletions.** Entities missing from source are deleted by default (except in the workspace custom application), as in `app plan`; `--no-prune` keeps them, `--prune` deletes them in every app, and the choice is sent to both the plan and the sync. JSON reports `inferDeletionFromMissingEntities: null` when neither flag is passed. Object and field deletions permanently delete stored data, so they need `--yes` or a yes at the prompt. Otherwise the command stops with `CONFIRMATION_REQUIRED` (exit 2) before changing anything. `--yes` never changes which entities are deleted.
|
|
399
|
-
- **Uploads.** File bytes go straight to the upload URLs the server returns, without the CLI's credentials. Each file is checked against the build's size and SHA-256 before anything is uploaded.
|
|
400
|
-
- **Pull baseline.** After an acknowledged sync, the CLI fetches the workspace ID and fresh application export, then atomically records `.twenty/cli/pull-base.json`. This baseline lets `app pull` distinguish workspace changes from local edits. It is bound to the normalized API URL, workspace UUID and app UUID. JSON reports `pullBase: "recorded"`, `"failed"` or `"unsupported"`; only a recorded base adds `pullBase` to `completedPhases`. Invalid exports or file-write errors preserve the prior base, warn with `PULL_BASE_NOT_RECORDED`, and allow client generation to continue. A server without the export API reports `"unsupported"` without a warning on every apply. The export is recorded as the server sent it; collections it lacks are read as empty by pull. Cancellation before the base is committed exits 130 with `outcome: "applied"` and `phase: "pullBase"`.
|
|
401
|
-
- **Typed client.** After the sync, the CLI fetches the app's GraphQL schema from the workspace and calls the app's own `twenty-client-sdk/generate` to regenerate the client in the app's own `node_modules/twenty-client-sdk` (`clientGeneration: "generated"`). It is skipped with a `CLIENT_NOT_GENERATED` warning when the app has no `node_modules/twenty-client-sdk` of its own, as in a hoisted workspace. A symlinked client package is followed and its target rewritten, so don't apply two apps that share one client package at the same time.
|
|
402
|
-
- **Failures.** A failed apply reports `details.phase`, `details.completedPhases` and `details.outcome`: `not-started` when the failing step changed nothing, `partial` when some files were uploaded, `unknown` when a request was sent but its effect is not known, such as a failed or interrupted sync, and `applied` when the sync succeeded but baseline recording was cancelled or client generation failed. Earlier steps, like a new registration, stay done. There is no rollback and no automatic retry: run `twenty app plan` to see where the workspace stands, then apply again. When client generation failed, the workspace has the new version but the client files may be incomplete: fix the problem, then run `twenty app generate-client`, which regenerates the client without syncing again. Ctrl+C exits with 130 and reports the step it interrupted.
|
|
760
|
+
### Record the pull baseline
|
|
403
761
|
|
|
404
|
-
|
|
762
|
+
After an acknowledged sync, the CLI fetches the workspace ID and fresh
|
|
763
|
+
application export, then atomically records `.twenty/cli/pull-base.json`. This
|
|
764
|
+
baseline lets `app pull` distinguish workspace changes from local edits. It is
|
|
765
|
+
bound to the normalized API URL, workspace UUID and app UUID.
|
|
766
|
+
|
|
767
|
+
JSON reports `pullBase: "recorded"`, `"failed"` or `"unsupported"`; only a
|
|
768
|
+
recorded base adds `pullBase` to `completedPhases`. Invalid exports or
|
|
769
|
+
file-write errors preserve the prior base, warn with `PULL_BASE_NOT_RECORDED`,
|
|
770
|
+
and allow client generation to continue. A server without the export API reports
|
|
771
|
+
`"unsupported"` without a warning on every apply.
|
|
772
|
+
|
|
773
|
+
The export is recorded as the server sent it; collections it lacks are read as
|
|
774
|
+
empty by pull. Cancellation before the base is committed exits 130 with
|
|
775
|
+
`outcome: "applied"` and `phase: "pullBase"`.
|
|
776
|
+
|
|
777
|
+
### Generate the typed client after apply
|
|
778
|
+
|
|
779
|
+
After the sync, the CLI fetches the app's GraphQL schema from the workspace and
|
|
780
|
+
calls the app's own `twenty-client-sdk/generate` to regenerate the client in the
|
|
781
|
+
app's own `node_modules/twenty-client-sdk` (`clientGeneration: "generated"`).
|
|
782
|
+
|
|
783
|
+
It is skipped with a `CLIENT_NOT_GENERATED` warning when the app has no
|
|
784
|
+
`node_modules/twenty-client-sdk` of its own, as in a hoisted workspace. A
|
|
785
|
+
symlinked client package is followed and its target rewritten, so don't apply
|
|
786
|
+
two apps that share one client package at the same time.
|
|
787
|
+
|
|
788
|
+
### Recover from an apply failure
|
|
789
|
+
|
|
790
|
+
A failed apply reports `details.phase`, `details.completedPhases` and
|
|
791
|
+
`details.outcome`: `not-started` when the failing step changed nothing,
|
|
792
|
+
`partial` when some files were uploaded, `unknown` when a request was sent but
|
|
793
|
+
its effect is not known, such as a failed or interrupted sync, and `applied`
|
|
794
|
+
when the sync succeeded but baseline recording was cancelled or client
|
|
795
|
+
generation failed.
|
|
796
|
+
|
|
797
|
+
Earlier steps, like a new registration, stay done. There is no rollback and no
|
|
798
|
+
automatic retry: run `twenty app plan` to see where the workspace stands, then
|
|
799
|
+
apply again.
|
|
800
|
+
|
|
801
|
+
When client generation failed, the workspace has the new version but the client
|
|
802
|
+
files may be incomplete: fix the problem, then run `twenty app generate-client`,
|
|
803
|
+
which regenerates the client without syncing again. Ctrl+C exits with 130 and
|
|
804
|
+
reports the step it interrupted.
|
|
805
|
+
|
|
806
|
+
Remote changes made between the plan and the sync can change what the sync does.
|
|
807
|
+
Remote changes between the acknowledged sync and the export can also enter the
|
|
808
|
+
saved baseline without appearing in local source; this is not an atomic server
|
|
809
|
+
snapshot of the sync. Planning, a failed sync, or a sync with an unknown outcome
|
|
810
|
+
never advances the baseline.
|
|
405
811
|
|
|
406
812
|
## Develop an app
|
|
407
813
|
|
|
@@ -414,54 +820,74 @@ twenty app dev --path ./apps/billing --format ndjson --no-prune
|
|
|
414
820
|
`app dev` builds and syncs once, then watches for edits. Each attempt uses the
|
|
415
821
|
same CLI build and strict project TypeScript checks as `app apply`. A failed
|
|
416
822
|
build prints diagnostics and keeps watching; it never uploads an incomplete
|
|
417
|
-
revision. It needs the same `APPLICATIONS` and `UPLOAD_FILE` permissions as
|
|
823
|
+
revision. It needs the same `APPLICATIONS` and `UPLOAD_FILE` permissions as
|
|
824
|
+
apply.
|
|
825
|
+
|
|
826
|
+
### Watched files
|
|
418
827
|
|
|
419
828
|
The CLI watches the app folder and the external local files read by definition
|
|
420
829
|
loading, bundling and typechecking, including linked packages and extended
|
|
421
830
|
TypeScript configs. Relative imports of missing external files watch the nearest
|
|
422
|
-
existing parent, so creating the file can recover a failed build.
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
831
|
+
existing parent, so creating the file can recover a failed build.
|
|
832
|
+
|
|
833
|
+
The last successful input graph stays watched after a failure. `.git`,
|
|
834
|
+
`.twenty`, `node_modules`, root `dist`, editor temporary files and `.DS_Store`
|
|
835
|
+
are ignored. Arbitrary filesystem reads inside app code are not discovered.
|
|
836
|
+
Restart dev after installing dependencies or changing the package manager's
|
|
837
|
+
links.
|
|
838
|
+
|
|
839
|
+
### Concurrent edits
|
|
427
840
|
|
|
428
841
|
Only one remote apply runs at a time. The compiler can prepare a newer complete
|
|
429
842
|
snapshot while that apply finishes; intermediate edits coalesce into the latest
|
|
430
843
|
revision. Uploads read independent, checksum-verified files, so a later build
|
|
431
844
|
cannot overwrite them. An unchanged content hash skips sync only after that
|
|
432
|
-
snapshot was acknowledged by the workspace.
|
|
433
|
-
|
|
845
|
+
snapshot was acknowledged by the workspace.
|
|
846
|
+
|
|
847
|
+
This is eventual convergence after edits settle, not an atomic checkout of files
|
|
848
|
+
being edited concurrently.
|
|
849
|
+
|
|
850
|
+
### Approval and failures
|
|
434
851
|
|
|
435
852
|
Registration uses `--create` or a terminal confirmation. Deletion inference is
|
|
436
|
-
on by default except for the workspace custom application, with `--no-prune`
|
|
437
|
-
|
|
438
|
-
deletions require a terminal confirmation or `--yes`. Every revision
|
|
439
|
-
fresh plan.
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
853
|
+
on by default except for the workspace custom application, with `--no-prune` to
|
|
854
|
+
keep missing entities and `--prune` to delete them in every app. Object and
|
|
855
|
+
field deletions require a terminal confirmation or `--yes`. Every revision
|
|
856
|
+
requests a fresh plan.
|
|
857
|
+
|
|
858
|
+
An edit cancels a pending confirmation; approval for the old revision cannot
|
|
859
|
+
authorize the new one. A remote failure is reported with the same phase/outcome
|
|
860
|
+
details as apply and is retried only after a new source edit, with a new plan.
|
|
861
|
+
Inspect `twenty app plan` when a request's outcome is unknown.
|
|
862
|
+
|
|
863
|
+
### Client generation during dev
|
|
443
864
|
|
|
444
865
|
After an acknowledged sync, dev records the pull base and regenerates the app's
|
|
445
866
|
own typed client when its schema, generator package or generated files changed.
|
|
446
867
|
Compilation pauses during generation, then explicitly rebuilds. Unchanged client
|
|
447
|
-
inputs and unchanged build output prevent a generation/sync loop.
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
and
|
|
868
|
+
inputs and unchanged build output prevent a generation/sync loop.
|
|
869
|
+
|
|
870
|
+
A schema fetch failure keeps the old client and prints a warning. If generation
|
|
871
|
+
starts writing and fails, dev stops because the client files may be incomplete;
|
|
872
|
+
fix the problem and run `twenty app generate-client` before restarting dev.
|
|
873
|
+
|
|
874
|
+
### Dev output and cancellation
|
|
451
875
|
|
|
452
|
-
Use human output or `--format ndjson`; `--json` is rejected before target
|
|
453
|
-
NDJSON uses ordered `progress` events with `data.kind`: `watch-ready`,
|
|
876
|
+
Use human output or `--format ndjson`; `--json` is rejected before target
|
|
877
|
+
lookup. NDJSON uses ordered `progress` events with `data.kind`: `watch-ready`,
|
|
454
878
|
`build-start`, `build-success`, `build-failure`, `build-skipped`, `sync-start`,
|
|
455
|
-
`sync-progress`, `sync-superseded`, `sync-failure` and `sync-success`.
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
879
|
+
`sync-progress`, `sync-superseded`, `sync-failure` and `sync-success`.
|
|
880
|
+
|
|
881
|
+
Build events carry the revision, successful builds also carry the build ID and
|
|
882
|
+
content hash. Output honors backpressure; buffered progress is bounded. Ctrl+C
|
|
883
|
+
stops watching, cancels active requests, releases snapshots after readers
|
|
884
|
+
settle, and exits 130 with the interrupted remote phase when available. It does
|
|
885
|
+
not roll back writes.
|
|
460
886
|
|
|
461
887
|
An abnormal worker exit or a filesystem-watcher failure ends the session; fix
|
|
462
888
|
the cause and restart `twenty app dev`. A killed process can leave temporary
|
|
463
|
-
folders in `.twenty/cli/snapshots`. After stopping all dev/apply sessions for
|
|
464
|
-
app, abandoned snapshot folders can be removed.
|
|
889
|
+
folders in `.twenty/cli/snapshots`. After stopping all dev/apply sessions for
|
|
890
|
+
that app, abandoned snapshot folders can be removed.
|
|
465
891
|
|
|
466
892
|
## Regenerate the typed client
|
|
467
893
|
|
|
@@ -470,9 +896,18 @@ twenty app generate-client --remote dev
|
|
|
470
896
|
twenty app generate-client --path ./apps/billing --json
|
|
471
897
|
```
|
|
472
898
|
|
|
473
|
-
`app generate-client` fetches the app's GraphQL schema from the workspace and
|
|
899
|
+
`app generate-client` fetches the app's GraphQL schema from the workspace and
|
|
900
|
+
regenerates the typed client in the app's own `node_modules/twenty-client-sdk`,
|
|
901
|
+
the same step `app apply` and `app dev` run after a sync, without building,
|
|
902
|
+
uploading or syncing. Use it after installing dependencies, after a failed
|
|
903
|
+
client generation, or to pick up schema changes made in the workspace. It needs
|
|
904
|
+
no server permission flag.
|
|
474
905
|
|
|
475
|
-
The app must already be installed in the workspace; otherwise the command fails
|
|
906
|
+
The app must already be installed in the workspace; otherwise the command fails
|
|
907
|
+
with `APP_NOT_INSTALLED` (exit 4), and `twenty app apply` installs it and
|
|
908
|
+
generates the client. An app without its own `node_modules/twenty-client-sdk`,
|
|
909
|
+
as in a hoisted workspace, fails with `CLIENT_SDK_NOT_INSTALLED` instead of the
|
|
910
|
+
warning `app apply` prints.
|
|
476
911
|
|
|
477
912
|
## Pull an app
|
|
478
913
|
|
|
@@ -482,27 +917,111 @@ twenty app pull --path ./apps/billing --json
|
|
|
482
917
|
twenty app pull --path ./workspace-app --yes --no-input
|
|
483
918
|
```
|
|
484
919
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
920
|
+
### Choose the application
|
|
921
|
+
|
|
922
|
+
| Where you run pull | Application selected |
|
|
923
|
+
| ------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
924
|
+
| Inside an app with an application definition | The identifier in that local definition |
|
|
925
|
+
| Inside an SDK project without an application definition | The selected workspace's custom application |
|
|
926
|
+
| Outside an app | The selected workspace's custom application, in a new local project |
|
|
927
|
+
|
|
928
|
+
Outside an app, pull asks where to create the project, then asks to create it,
|
|
929
|
+
install dependencies with Yarn, and pull. `--path` selects an existing app or a
|
|
930
|
+
new or empty destination. Noninteractive creation requires both `--path` and
|
|
931
|
+
`--yes`. An unrelated nonempty directory is never overwritten.
|
|
932
|
+
|
|
933
|
+
New projects use the bundled package and configuration files without demo
|
|
934
|
+
entities. Pull writes the custom application's definition. A missing custom
|
|
935
|
+
application is an error. There is no `--universal-identifier` option.
|
|
936
|
+
|
|
937
|
+
Creating the project changes local files only. It does not register an app or
|
|
938
|
+
modify the workspace. If installation fails, the scaffold remains: run
|
|
939
|
+
`yarn install` there, then retry pull. Existing projects do not install
|
|
940
|
+
dependencies automatically.
|
|
941
|
+
|
|
942
|
+
### Requirements
|
|
943
|
+
|
|
944
|
+
- The selected connection needs the server's `APPLICATIONS` permission.
|
|
945
|
+
- The project needs an installed `twenty-sdk >=1.23.0` with public
|
|
946
|
+
`twenty-sdk/define` and `twenty-sdk/front-component` exports.
|
|
947
|
+
- The SDK must also expose the authoring APIs used by the generated files.
|
|
948
|
+
Missing APIs fail with `SDK_SOURCE_UNSUPPORTED`; install a compatible version
|
|
949
|
+
(2.50.0 or later).
|
|
950
|
+
- Pull does not need a project TypeScript compiler. Run `twenty app typecheck`
|
|
951
|
+
afterwards to validate generated definitions against the installed SDK.
|
|
952
|
+
|
|
953
|
+
### What is restored
|
|
954
|
+
|
|
955
|
+
| Content | Local result | Limits |
|
|
956
|
+
| ----------------------------------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
|
|
957
|
+
| Supported metadata and translations | App definitions and locale catalogs | Unsupported metadata is reported, not regenerated |
|
|
958
|
+
| Workflows | `defineWorkflow` files in `src/workflows` | Unsupported steps or references leave the local file intact |
|
|
959
|
+
| Skills and agents | `defineSkill` and `defineAgent` files in `src/skills` and `src/agents` | Definitions the server cannot reproduce become coverage gaps |
|
|
960
|
+
| Front component entry source | Original TSX, preserving identifiers and supported widget references | Missing source becomes a coverage gap; imported local files are not pulled yet |
|
|
961
|
+
| Dependencies | `package.json` and `yarn.lock` at the project root | Only the stored `dependencies` pair is restored |
|
|
962
|
+
| Public assets | Exact image, font and other asset bytes under `public/` | Only `public-asset` files with safe paths are accepted |
|
|
963
|
+
|
|
964
|
+
Logic-function source is not exported yet. Only declared front component source
|
|
965
|
+
paths are accepted. Record attachments and other file categories are refused
|
|
966
|
+
before writing. Each export response is limited to 16 MiB.
|
|
967
|
+
|
|
968
|
+
A workflow changed in the workflow builder is normally a coverage gap. The
|
|
969
|
+
workspace custom application is the exception: its workflows are pulled from
|
|
970
|
+
their active version, and apply publishes changed definitions as new versions.
|
|
971
|
+
An agent on more than one role is another example of a coverage gap. These gaps
|
|
972
|
+
preserve the corresponding local files.
|
|
973
|
+
|
|
974
|
+
Front component imports are preserved. Restore missing imported files and
|
|
975
|
+
install dependencies before building or applying. If exported `package.json`
|
|
976
|
+
omits `twenty-sdk`, as the workspace custom application does, pull keeps the
|
|
977
|
+
local SDK dependency. The installed generated client is left alone.
|
|
978
|
+
|
|
979
|
+
Run `yarn install` after pulling dependency changes into an existing project.
|
|
980
|
+
|
|
981
|
+
### Local changes and deletions
|
|
982
|
+
|
|
983
|
+
Pull uses `.twenty/cli/pull-base.json`, saved by apply or a previous pull, to
|
|
984
|
+
compare remote and local definitions. That baseline belongs to one API URL,
|
|
985
|
+
workspace UUID and application UUID.
|
|
986
|
+
|
|
987
|
+
**Pull can overwrite local edits without a confirmation prompt.**
|
|
988
|
+
|
|
989
|
+
| Situation | Result |
|
|
990
|
+
| --------------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
991
|
+
| Matching baseline, unchanged workspace entity | Keep local source |
|
|
992
|
+
| Matching baseline, changed workspace entity | Write remote definition and report overwritten local edits |
|
|
993
|
+
| Matching baseline, confirmed remote entity deletion | Remove its local definition |
|
|
994
|
+
| No matching baseline | Keep local-only definitions; do not infer deletions |
|
|
995
|
+
| Coverage gap, unreadable definition or local-only nested entity | Preserve and report it |
|
|
996
|
+
| Dependency, public asset or front component source unchanged remotely | Keep local edits |
|
|
997
|
+
| Dependency, public asset or front component source changed remotely | Replace it and report overwritten local edits |
|
|
998
|
+
| File absent from remote export | Leave the local file untouched |
|
|
999
|
+
|
|
1000
|
+
Coverage gaps do not need `--force` or a partial-mode opt-in. JSON includes
|
|
1001
|
+
`coverage`, `skipped`, `unreadableRelativePaths`, `localOnlyRelativePaths` and
|
|
1002
|
+
`overwrittenLocalChanges`. Without a baseline, overwritten local edits cannot be
|
|
1003
|
+
distinguished from generated source.
|
|
1004
|
+
|
|
1005
|
+
### Failure and recovery
|
|
1006
|
+
|
|
1007
|
+
Pull stages new content and backs up originals before replacing files. It
|
|
1008
|
+
updates the baseline after writing the files. Ordinary write failures restore
|
|
1009
|
+
both the previous files and the baseline.
|
|
1010
|
+
|
|
1011
|
+
| `error.details.outcome` | Meaning |
|
|
1012
|
+
| ----------------------- | ------------------------------------------------------------------------- |
|
|
1013
|
+
| `unchanged` | Acknowledged refusal, cancellation before writing, or successful rollback |
|
|
1014
|
+
| `unknown` | Worker stopped without acknowledging completion, or rollback failed |
|
|
1015
|
+
| `pulled` | Files and baseline were committed, but temporary-file cleanup failed |
|
|
1016
|
+
|
|
1017
|
+
An interrupted worker can leave partial writes. Inspect the changes and retained
|
|
1018
|
+
`.twenty/cli/pull-backup-*` files before retrying. Failed rollback also reports
|
|
1019
|
+
`backupDirectory`.
|
|
1020
|
+
|
|
1021
|
+
Ctrl+C exits 130 unless the worker acknowledges a completed commit; in that case
|
|
1022
|
+
pull returns its result. See the
|
|
1023
|
+
[pull implementation](../src/app/pull/README.md) for reconciliation and
|
|
1024
|
+
compatibility details.
|
|
506
1025
|
|
|
507
1026
|
## Install a registered app
|
|
508
1027
|
|
|
@@ -512,13 +1031,41 @@ twenty app install --path ./apps/billing --json
|
|
|
512
1031
|
twenty app install --universal-identifier <id> --remote staging --json
|
|
513
1032
|
```
|
|
514
1033
|
|
|
515
|
-
`app install` installs a package already registered on the target server. It
|
|
1034
|
+
`app install` installs a package already registered on the target server. It
|
|
1035
|
+
reads the local app definition to find its universal identifier, without
|
|
1036
|
+
building or typechecking the app; `--universal-identifier` works without a local
|
|
1037
|
+
project. Identifiers are sent in lowercase. It requires `APPLICATIONS`
|
|
1038
|
+
permission.
|
|
1039
|
+
|
|
1040
|
+
The server selects the registered package and version. Local source changes are
|
|
1041
|
+
not uploaded. For a private package, run `app publish --private` first;
|
|
1042
|
+
publishing to npm alone does not create a server registration. Installation can
|
|
1043
|
+
run app hooks and update an existing installation. Use `app apply` to sync local
|
|
1044
|
+
source instead.
|
|
516
1045
|
|
|
517
|
-
|
|
1046
|
+
### Install progress
|
|
518
1047
|
|
|
519
|
-
The command waits up to ten minutes for its server installation job to complete,
|
|
1048
|
+
The command waits up to ten minutes for its server installation job to complete,
|
|
1049
|
+
then verifies that the app is installed. While it waits, human output shows the
|
|
1050
|
+
job's progress as an updating percentage bar in an interactive terminal.
|
|
1051
|
+
Redirected output, CI and terminals with `TERM=dumb` print a plain progress line
|
|
1052
|
+
each time the percentage changes.
|
|
520
1053
|
|
|
521
|
-
|
|
1054
|
+
JSON returns `application`, `installed: true` and `jobId`. Failed jobs return
|
|
1055
|
+
`INSTALL_FAILED`; missing or mismatched job status is an error, not a successful
|
|
1056
|
+
installation.
|
|
1057
|
+
|
|
1058
|
+
### Install failures
|
|
1059
|
+
|
|
1060
|
+
Identifier resolution and installation errors include `details.phase`,
|
|
1061
|
+
`details.completedPhases` and `details.outcome`, plus the universal identifier
|
|
1062
|
+
and job identifier when available. Identifier resolution failures report
|
|
1063
|
+
`phase: "identity"` and `outcome: "not-started"`. Ctrl+C or a timeout stops
|
|
1064
|
+
waiting but does not cancel the server job.
|
|
1065
|
+
|
|
1066
|
+
Run the same command again to retry or resume waiting for an installation that
|
|
1067
|
+
is still running. The command requires the server's `triggerInstallApplication`
|
|
1068
|
+
and `findInstallApplicationJobStatus` APIs, including lookup by `jobId`.
|
|
522
1069
|
|
|
523
1070
|
## Uninstall an app
|
|
524
1071
|
|
|
@@ -528,11 +1075,31 @@ twenty app uninstall --yes --json
|
|
|
528
1075
|
twenty app uninstall --universal-identifier <id> --yes
|
|
529
1076
|
```
|
|
530
1077
|
|
|
531
|
-
`app uninstall` reads the local app definition to find its universal identifier,
|
|
1078
|
+
`app uninstall` reads the local app definition to find its universal identifier,
|
|
1079
|
+
without building or typechecking the app. It checks that the app is installed on
|
|
1080
|
+
the target and that the workspace allows uninstalling it, then uninstalls it.
|
|
1081
|
+
`--universal-identifier` works without a local project. It needs the server's
|
|
1082
|
+
`APPLICATIONS` permission.
|
|
1083
|
+
|
|
1084
|
+
### Confirmation and data deletion
|
|
1085
|
+
|
|
1086
|
+
Uninstalling runs the app's uninstall hook and deletes everything the app owns,
|
|
1087
|
+
including its objects, fields and their data. It always needs `--yes`, or a yes
|
|
1088
|
+
at the prompt in an interactive terminal; otherwise it stops with
|
|
1089
|
+
`CONFIRMATION_REQUIRED` (exit 2) before changing anything. An app that is not
|
|
1090
|
+
installed returns `APP_NOT_INSTALLED` (exit 4), and one the workspace does not
|
|
1091
|
+
allow to uninstall returns `APP_NOT_UNINSTALLABLE` (exit 6).
|
|
532
1092
|
|
|
533
|
-
|
|
1093
|
+
### Uninstall recovery
|
|
534
1094
|
|
|
535
|
-
The app's registration is kept, so `twenty app apply` can install it again
|
|
1095
|
+
The app's registration is kept, so `twenty app apply` can install it again
|
|
1096
|
+
without `--create`. Failures report `details.phase`, `details.completedPhases`
|
|
1097
|
+
and `details.outcome`, as for apply: an uninstall request that fails after the
|
|
1098
|
+
server received it, or is interrupted with Ctrl+C, has an `unknown` outcome.
|
|
1099
|
+
|
|
1100
|
+
Running the command again reports `APP_NOT_INSTALLED` once the app is gone.
|
|
1101
|
+
`--universal-identifier` accepts any UUID casing and sends the canonical
|
|
1102
|
+
lowercase form.
|
|
536
1103
|
|
|
537
1104
|
## Execute an app function
|
|
538
1105
|
|
|
@@ -547,18 +1114,26 @@ its functions, then executes the selected function's deployed code. Sync local
|
|
|
547
1114
|
changes with `app apply` or `app dev` first. Execution does not build bundles,
|
|
548
1115
|
typecheck, sync, register or install the app.
|
|
549
1116
|
|
|
1117
|
+
### Function and payload selection
|
|
1118
|
+
|
|
550
1119
|
Choose exactly one of `--name` (exact deployed name), `--universal-identifier`,
|
|
551
1120
|
`--post-install`, `--pre-install` or `--uninstall-hook`. Hook selectors run the
|
|
552
1121
|
hook's code and its side effects without installing or uninstalling the app.
|
|
553
1122
|
Payloads must be JSON objects, supplied inline, through `@file`, or through `-`
|
|
554
|
-
for stdin; the default is `{}`.
|
|
555
|
-
|
|
1123
|
+
for stdin; the default is `{}`.
|
|
1124
|
+
|
|
1125
|
+
The selected function must belong to both the local app manifest and the
|
|
1126
|
+
installed app on the target workspace.
|
|
1127
|
+
|
|
1128
|
+
### Execution permissions
|
|
556
1129
|
|
|
557
1130
|
The current server requires a signed-in user and the `APPLICATIONS` and
|
|
558
|
-
`WORKFLOWS` settings permissions. Sign in with
|
|
559
|
-
--name dev`, then pass `--remote dev`. API keys,
|
|
560
|
-
targets, cannot execute logic functions. The
|
|
561
|
-
which functions the user may run on demand.
|
|
1131
|
+
`WORKFLOWS` settings permissions. Sign in with
|
|
1132
|
+
`twenty auth login --url <url> --name dev`, then pass `--remote dev`. API keys,
|
|
1133
|
+
including environment API-key targets, cannot execute logic functions. The
|
|
1134
|
+
server additionally restricts which functions the user may run on demand.
|
|
1135
|
+
|
|
1136
|
+
### Execution output and failures
|
|
562
1137
|
|
|
563
1138
|
Human output shows status, duration, returned data, error and logs. `--json`
|
|
564
1139
|
returns those fields in the standard envelope; NDJSON is not supported. A
|
|
@@ -569,8 +1144,10 @@ There are no automatic retries. The request deadline uses the deployed
|
|
|
569
1144
|
function's timeout plus 60 seconds. A lost response or Ctrl+C can leave the
|
|
570
1145
|
function running on the server; the error reports `outcome: "unknown"` and asks
|
|
571
1146
|
you to check its effects before retrying. An acknowledged execution rejection
|
|
572
|
-
reports `"not-started"`.
|
|
573
|
-
|
|
1147
|
+
reports `"not-started"`.
|
|
1148
|
+
|
|
1149
|
+
Ctrl+C exits 130, without rolling back side effects. See the
|
|
1150
|
+
[execution implementation](../src/app/exec/README.md) for compatibility details.
|
|
574
1151
|
|
|
575
1152
|
## Watch app logs
|
|
576
1153
|
|
|
@@ -585,43 +1162,55 @@ output from every logic function in that app. Output arrives when an execution
|
|
|
585
1162
|
finishes, not line by line while it runs. It does not fetch historical logs,
|
|
586
1163
|
watch other apps, or build, sync, register or install anything.
|
|
587
1164
|
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
1165
|
+
### Log filters
|
|
1166
|
+
|
|
1167
|
+
Names are not unique: `--name` matches every function with that exact name in
|
|
1168
|
+
the app. Use `--universal-identifier` to isolate one function. The two filters
|
|
1169
|
+
are mutually exclusive. Human output labels each execution with its function
|
|
1170
|
+
name and identifier; NDJSON records contain `applicationUniversalIdentifier`,
|
|
592
1171
|
`functionName`, `functionUniversalIdentifier` and `logs`.
|
|
593
1172
|
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
1173
|
+
### Log compatibility
|
|
1174
|
+
|
|
1175
|
+
Some server schemas expose only log text. If the identity fields are
|
|
1176
|
+
unsupported, the CLI warns and subscribes once requesting only `logs`. An
|
|
1177
|
+
explicit filter supplies that name or identifier; unknown identities are `null`
|
|
1178
|
+
in NDJSON and omitted from human labels. With neither filter, those schemas
|
|
1179
|
+
cannot attribute mixed output to individual functions.
|
|
1180
|
+
|
|
1181
|
+
### Log output and disconnects
|
|
599
1182
|
|
|
600
1183
|
The stream supports human output and `--format ndjson`; finite `--json` is
|
|
601
1184
|
rejected. Ctrl+C closes it and exits 130. A server completion exits 0. A dropped
|
|
602
1185
|
or stalled connection exits with an error and the emitted record count, with no
|
|
603
|
-
automatic reconnect because missed logs cannot be replayed.
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
1186
|
+
automatic reconnect because missed logs cannot be replayed.
|
|
1187
|
+
|
|
1188
|
+
Slow output applies backpressure; each SSE frame is limited to 16 MiB, with no
|
|
1189
|
+
session-size cap. Connection setup and gaps between received body chunks each
|
|
1190
|
+
have a 60-second deadline; server heartbeat comments keep quiet subscriptions
|
|
1191
|
+
alive.
|
|
1192
|
+
|
|
1193
|
+
### Log permissions
|
|
607
1194
|
|
|
608
1195
|
This uses the existing app-log subscription and its `WORKFLOWS` permission and
|
|
609
|
-
application access checks. API keys and browser-login remotes are supported.
|
|
610
|
-
|
|
611
|
-
workspace-wide Settings logs API. See the
|
|
1196
|
+
application access checks. API keys and browser-login remotes are supported. It
|
|
1197
|
+
does not require the paid audit-log entitlement, ClickHouse history or the
|
|
1198
|
+
workspace-wide Settings logs API. See the
|
|
1199
|
+
[log subscription implementation](../src/app/function-logs/README.md).
|
|
612
1200
|
|
|
613
1201
|
## Expired browser sessions
|
|
614
1202
|
|
|
615
1203
|
For commands that use a workspace, interactive OAuth sessions are checked before
|
|
616
1204
|
the command starts. If a session is rejected or cannot be refreshed, the CLI
|
|
617
|
-
offers to sign in again once, validates the new session, and saves its
|
|
618
|
-
without changing the remote's URL, default selection or other
|
|
1205
|
+
offers to sign in again once, validates the new session, and saves its
|
|
1206
|
+
credentials without changing the remote's URL, default selection or other
|
|
1207
|
+
settings.
|
|
619
1208
|
|
|
620
|
-
API keys, JSON/NDJSON output, `--no-input`, redirected stdin and CI never
|
|
621
|
-
this prompt. Permission errors do not trigger sign-in either. If
|
|
622
|
-
fails after a command starts, the CLI stops with the login hint;
|
|
623
|
-
replay requests or restart an app apply. A remote changed during
|
|
624
|
-
as-is, and the command stops with `CONFLICT`.
|
|
1209
|
+
API keys, JSON/NDJSON output, `--no-input`, redirected stdin and CI never
|
|
1210
|
+
trigger this prompt. Permission errors do not trigger sign-in either. If
|
|
1211
|
+
authentication fails after a command starts, the CLI stops with the login hint;
|
|
1212
|
+
it does not replay requests or restart an app apply. A remote changed during
|
|
1213
|
+
sign-in is left as-is, and the command stops with `CONFLICT`.
|
|
625
1214
|
|
|
626
1215
|
## Output
|
|
627
1216
|
|
|
@@ -630,7 +1219,8 @@ as-is, and the command stops with `CONFLICT`.
|
|
|
630
1219
|
`twenty commands --json` lists command arguments, flags, output modes and
|
|
631
1220
|
project/target requirements for scripts that discover the command surface.
|
|
632
1221
|
|
|
633
|
-
Commands print readable text by default. With `--json`, a command prints exactly
|
|
1222
|
+
Commands print readable text by default. With `--json`, a command prints exactly
|
|
1223
|
+
one JSON document on stdout, including when it fails:
|
|
634
1224
|
|
|
635
1225
|
```json
|
|
636
1226
|
{
|
|
@@ -647,7 +1237,8 @@ Commands print readable text by default. With `--json`, a command prints exactly
|
|
|
647
1237
|
}
|
|
648
1238
|
```
|
|
649
1239
|
|
|
650
|
-
A failure has `"ok": false` and an `error` object with a stable `code`, a
|
|
1240
|
+
A failure has `"ok": false` and an `error` object with a stable `code`, a
|
|
1241
|
+
`message`, and sometimes a `hint` and `details`.
|
|
651
1242
|
|
|
652
1243
|
Exit codes:
|
|
653
1244
|
|
|
@@ -669,13 +1260,40 @@ twenty app publish
|
|
|
669
1260
|
twenty app publish --path ./apps/billing --tag beta --json
|
|
670
1261
|
```
|
|
671
1262
|
|
|
672
|
-
Builds and typechecks the app, packs that exact build, then publishes the
|
|
1263
|
+
Builds and typechecks the app, packs that exact build, then publishes the
|
|
1264
|
+
package with public access. No Twenty remote or workspace authentication is
|
|
1265
|
+
required. Publishing to npm does not sync or install the app in a workspace.
|
|
1266
|
+
|
|
1267
|
+
### Registry and provenance
|
|
1268
|
+
|
|
1269
|
+
Install npm and authenticate with the intended registry first. npm runs from the
|
|
1270
|
+
app directory, so its project/user configuration and environment credentials
|
|
1271
|
+
apply. `--tag` sets the npm dist-tag. GitHub Actions jobs with OIDC request
|
|
1272
|
+
provenance automatically; set `TWENTY_APP_PUBLISH_DISABLE_PROVENANCE=true` to
|
|
1273
|
+
opt out, for example when publishing from a private source repository.
|
|
673
1274
|
|
|
674
|
-
|
|
1275
|
+
### Package contents
|
|
675
1276
|
|
|
676
|
-
Packing and publishing skip npm lifecycle scripts because the CLI already built
|
|
1277
|
+
Packing and publishing skip npm lifecycle scripts because the CLI already built
|
|
1278
|
+
the app. npm's package-file selection still applies.
|
|
677
1279
|
|
|
678
|
-
|
|
1280
|
+
If `package.json` has a `files` field, it must include `manifest.json` and the
|
|
1281
|
+
generated app files; the command rejects an incomplete package before
|
|
1282
|
+
publication. npm excludes the root `yarn.lock` from packages, so the CLI also
|
|
1283
|
+
packs it as `dependencies/yarn.lock`, where Twenty reads it at install.
|
|
1284
|
+
|
|
1285
|
+
Temporary packages and build snapshots are removed after completion or failure.
|
|
1286
|
+
|
|
1287
|
+
### Publish output and failures
|
|
1288
|
+
|
|
1289
|
+
Human mode displays npm output and supports interactive authentication when a
|
|
1290
|
+
terminal is available. JSON mode returns one CLI envelope and does not prompt;
|
|
1291
|
+
configure an automation token or npm’s `npm_config_otp` environment option
|
|
1292
|
+
before running it. Failed npm commands return `PUBLISH_FAILED` with the
|
|
1293
|
+
subprocess exit code and captured output.
|
|
1294
|
+
|
|
1295
|
+
If publication is interrupted after sending the package, check the registry
|
|
1296
|
+
before retrying, since the version may already have been published.
|
|
679
1297
|
|
|
680
1298
|
### Publish to a private Twenty registry
|
|
681
1299
|
|
|
@@ -684,11 +1302,32 @@ twenty app publish --private --remote staging
|
|
|
684
1302
|
twenty app publish --private --path ./apps/billing --json
|
|
685
1303
|
```
|
|
686
1304
|
|
|
687
|
-
`--private` publishes the same built package to the selected Twenty server
|
|
1305
|
+
`--private` publishes the same built package to the selected Twenty server
|
|
1306
|
+
registry instead of npm.
|
|
1307
|
+
|
|
1308
|
+
It uses the normal saved remote or environment credentials, requests a tarball
|
|
1309
|
+
upload, sends the bytes directly to storage, then registers the uploaded app.
|
|
1310
|
+
npm is still needed for local packing, but npm registry credentials are not used
|
|
1311
|
+
and `--tag` is rejected.
|
|
688
1312
|
|
|
689
|
-
|
|
1313
|
+
The server requires file-upload permission and `MARKETPLACE_APPS` permission on
|
|
1314
|
+
the target workspace.
|
|
690
1315
|
|
|
691
|
-
|
|
1316
|
+
Publishing registers a version; it does not install the app or directly sync the
|
|
1317
|
+
selected workspace. Publishing an update can trigger automatic upgrades in
|
|
1318
|
+
workspaces where the app is already installed with automatic upgrades enabled.
|
|
1319
|
+
The server enforces application ownership, version progression and engine
|
|
1320
|
+
compatibility.
|
|
1321
|
+
|
|
1322
|
+
JSON results contain `target: "private"`, the selected server under `registry`,
|
|
1323
|
+
the registration and `installed: false`, indicating that this command did not
|
|
1324
|
+
request installation.
|
|
1325
|
+
|
|
1326
|
+
Failed uploads never trigger registration. If registration fails or is
|
|
1327
|
+
interrupted after sending the request, the app may already be registered. The
|
|
1328
|
+
error includes the phase, upload file ID and an `unknown` outcome; check the
|
|
1329
|
+
server registry before retrying. Temporary packages are cleaned up in either
|
|
1330
|
+
case.
|
|
692
1331
|
|
|
693
1332
|
## App translations
|
|
694
1333
|
|
|
@@ -704,16 +1343,19 @@ app containing the current directory.
|
|
|
704
1343
|
Extraction runs locally, without a workspace connection. It reads app metadata
|
|
705
1344
|
and static `t`, `msg`, and `Trans` strings in front-component source files. It
|
|
706
1345
|
refreshes `locales/en.json` with source strings and updates existing target JSON
|
|
707
|
-
catalogs. `--locale` also creates a missing supported target catalog, for
|
|
708
|
-
`locales/fr-FR.json`. The source locale `en` cannot be a target.
|
|
1346
|
+
catalogs. `--locale` also creates a missing supported target catalog, for
|
|
1347
|
+
example `locales/fr-FR.json`. The source locale `en` cannot be a target.
|
|
1348
|
+
|
|
1349
|
+
### Catalog updates and recovery
|
|
709
1350
|
|
|
710
1351
|
Translations for unchanged message/context pairs are preserved. New entries have
|
|
711
|
-
empty translations; obsolete entries are removed. Context groups remain
|
|
712
|
-
Malformed target catalogs fail with `INVALID_INPUT` before writing any
|
|
713
|
-
Unsafe catalog or staging paths report `APP_PATH_UNAVAILABLE`. Files
|
|
714
|
-
`locales/compiled` are left untouched.
|
|
715
|
-
|
|
716
|
-
|
|
1352
|
+
empty translations; obsolete entries are removed. Context groups remain
|
|
1353
|
+
separate. Malformed target catalogs fail with `INVALID_INPUT` before writing any
|
|
1354
|
+
catalogs. Unsafe catalog or staging paths report `APP_PATH_UNAVAILABLE`. Files
|
|
1355
|
+
under `locales/compiled` are left untouched.
|
|
1356
|
+
|
|
1357
|
+
Temporary files live under `.twenty/cli`. Each catalog is replaced atomically;
|
|
1358
|
+
an interrupted run may update only some catalogs, so rerun extraction to finish.
|
|
717
1359
|
|
|
718
1360
|
The command validates app definitions but does not bundle or upload them. Edit
|
|
719
1361
|
the target catalogs, then run `twenty app apply` to deploy translations. Build
|