@thatopen/services 0.3.16 → 0.4.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.
Files changed (74) hide show
  1. package/README.md +62 -62
  2. package/dist/cli.js +4 -1
  3. package/dist/core/client.d.ts +1 -0
  4. package/dist/core/platform-client.d.ts +7 -0
  5. package/dist/index.cjs.js +2 -2
  6. package/dist/index.es.js +382 -370
  7. package/dist/vite-env.d.ts +1 -1
  8. package/docs/ai-quickstart.md +130 -130
  9. package/docs/cli/create.md +29 -29
  10. package/docs/cli/local-server.md +38 -38
  11. package/docs/cli/login.md +32 -32
  12. package/docs/cli/publish.md +31 -31
  13. package/docs/cli/run.md +26 -26
  14. package/docs/cli/serve.md +43 -43
  15. package/docs/cli/swap.md +30 -30
  16. package/docs/cloud/GaussianSplatConverter.md +43 -43
  17. package/docs/cloud/PointCloudConverter.md +53 -53
  18. package/docs/revit-collab-quickstart.md +256 -256
  19. package/package.json +95 -95
  20. package/resources/AGENTS.md +40 -40
  21. package/src/built-in/CDEManager/example.ts +214 -214
  22. package/src/built-in/CDEManager/examples/FileEditing/example.ts +226 -226
  23. package/src/built-in/CDEManager/examples/FileMoves/example.ts +186 -186
  24. package/src/built-in/CDEManager/examples/FileOperations/example.ts +295 -295
  25. package/src/built-in/CDEManager/examples/FileTransfers/example.ts +210 -210
  26. package/src/built-in/CDEManager/examples/FolderManagement/example.ts +230 -230
  27. package/src/built-in/CDEManager/examples/MetadataSchema/example.ts +230 -230
  28. package/src/built-in/CDEManager/examples/MetadataViews/example.ts +166 -166
  29. package/src/built-in/CDEManager/examples/ProjectConfig/example.ts +177 -177
  30. package/src/built-in/ClashesManager/example.ts +283 -283
  31. package/src/built-in/UIManager/src/app/example.ts +97 -97
  32. package/src/built-in/UIManager/src/app/examples/AppState/example.ts +140 -140
  33. package/src/built-in/UIManager/src/app/examples/Banner/example.ts +159 -159
  34. package/src/built-in/UIManager/src/app/examples/Contexts/example.ts +123 -123
  35. package/src/built-in/UIManager/src/app/examples/FileDrop/example.ts +124 -124
  36. package/src/built-in/UIManager/src/app/examples/FloatingLayout/example.ts +90 -90
  37. package/src/built-in/UIManager/src/app/examples/Modal/example.ts +163 -163
  38. package/src/built-in/UIManager/src/app/examples/Notifications/example.ts +133 -133
  39. package/src/built-in/UIManager/src/app/examples/Sidebar/example.ts +102 -102
  40. package/src/cli/templates/app/README.md +217 -217
  41. package/src/cli/templates/app/index.html +35 -35
  42. package/src/cli/templates/app/package.json +32 -32
  43. package/src/cli/templates/app/src/app.ts +37 -37
  44. package/src/cli/templates/app/src/assets/tool-placeholder.ts +50 -50
  45. package/src/cli/templates/app/src/bim-components/CloudRunner/index.ts +95 -95
  46. package/src/cli/templates/app/src/bim-components/CloudRunner/src/index.ts +1 -1
  47. package/src/cli/templates/app/src/bim-components/CloudRunner/src/types.ts +5 -5
  48. package/src/cli/templates/app/src/bim-components/index.ts +1 -1
  49. package/src/cli/templates/app/src/globals.ts +1 -1
  50. package/src/cli/templates/app/src/main.ts +199 -199
  51. package/src/cli/templates/app/src/setups/reality-capture/lib/hidden-tiles-plugin.ts +88 -88
  52. package/src/cli/templates/app/src/setups/reality-capture/lib/point-tile-plugin.ts +166 -166
  53. package/src/cli/templates/app/src/setups/reality-capture/lib/render-frame.ts +31 -31
  54. package/src/cli/templates/app/src/setups/reality-capture/lib/splat-tile-plugin.ts +51 -51
  55. package/src/cli/templates/app/src/setups/reality-capture-viewer.ts +1383 -1383
  56. package/src/cli/templates/app/src/ui-components/app-info-section/index.ts +26 -26
  57. package/src/cli/templates/app/src/ui-components/app-info-section/src/index.ts +1 -1
  58. package/src/cli/templates/app/src/ui-components/app-info-section/src/types.ts +15 -15
  59. package/src/cli/templates/app/src/ui-components/cloud-runner-section/index.ts +37 -37
  60. package/src/cli/templates/app/src/ui-components/cloud-runner-section/src/index.ts +1 -1
  61. package/src/cli/templates/app/src/ui-components/cloud-runner-section/src/types.ts +14 -14
  62. package/src/cli/templates/app/src/ui-components/index.ts +2 -2
  63. package/src/cli/templates/app/tsconfig.json +16 -16
  64. package/src/cli/templates/app/vite.config.js +57 -57
  65. package/src/cli/templates/cloud-component/README.md +205 -205
  66. package/src/cli/templates/cloud-component/_thatopen +5 -5
  67. package/src/cli/templates/cloud-component/declarations.json +4 -4
  68. package/src/cli/templates/cloud-component/package.json +21 -21
  69. package/src/cli/templates/cloud-component/src/main.ts +70 -70
  70. package/src/cli/templates/cloud-component/tsconfig.json +16 -16
  71. package/src/cli/templates/cloud-component/vite.config.js +46 -46
  72. package/src/cli/templates/shared/AGENTS.md +8 -8
  73. package/src/cli/templates/shared/CLAUDE.md +1 -1
  74. package/src/cli/templates/shared/_gitignore +5 -5
@@ -1 +1 @@
1
- /// <reference types="vite/client" />
1
+ /// <reference types="vite/client" />
@@ -1,130 +1,130 @@
1
- # That Open Platform — AI Quick Start (zero to a running app or cloud component)
2
-
3
- You are an AI assistant. A user pointed you at this URL so you can scaffold and run something
4
- on the [That Open Platform](https://platform.thatopen.com) from scratch, using
5
- `@thatopen/services` (the `thatopen` CLI + client library). Follow the steps below in order.
6
-
7
- > The only secret you need is a **platform API token** — **not** an npm token. The CLI
8
- > derives private beta-registry access from the platform token automatically.
9
-
10
- ---
11
-
12
- ## First — what are you building? (ask if the user hasn't said)
13
-
14
- There are two kinds of project. **If the user hasn't told you which they want, ASK them
15
- before scaffolding** — explain it in plain terms and let them pick:
16
-
17
- - **App** — something people *open and click around in*, running in the platform's browser
18
- UI: a 3D BIM viewer, a dashboard, a form, a custom tool. Choose this when the goal is a
19
- visual interface. Template: `app`.
20
- - **Cloud component** — *server-side logic* with no UI of its own, running in the platform's
21
- cloud and triggered by an app or an automation to do work on the project's data — e.g.
22
- convert a file (IFC→fragments, point cloud→tiles), generate a report, run a calculation.
23
- Choose this when the goal is processing/automation, not a screen. Template: `cloud-component`.
24
-
25
- Steps 0–2 are identical for both; they diverge only at `create` (step 3) and how you run them
26
- (step 4). This guide marks **[app]** / **[component]** where they differ.
27
-
28
- ## 0. Prerequisites (check, don't assume)
29
-
30
- - **Node.js ≥ 18** and **npm** — verify with `node -v`.
31
- - A **That Open Platform API token**. The user creates it themselves:
32
- → **https://platform.thatopen.com/dashboard/data → API Tokens → create → copy.**
33
- Ask the user to paste it. **Never print it back, never write it into a file, never commit it.**
34
-
35
- ## 1. Install the CLI
36
-
37
- ```bash
38
- npm install -g @thatopen/services@latest
39
- ```
40
-
41
- ## 2. Log in (do this BEFORE creating the project)
42
-
43
- Get the token from the platform dashboard — **https://platform.thatopen.com/dashboard/data**
44
- → **API Tokens** → create → copy. Ask the user to paste it, then run:
45
-
46
- ```bash
47
- thatopen login --token <platform-token>
48
- ```
49
-
50
- This validates the token and stores it in `~/.thatopen/config.json`. Login **must** come
51
- first: the next step's install pulls the private `@thatopen-platform/*-beta` packages, and
52
- `create` uses your logged-in token to write an authenticated `.npmrc` so that install can
53
- resolve them. No npm account or manual npm token is involved.
54
-
55
- ## 3. Scaffold a beta project
56
-
57
- **[app]**
58
- ```bash
59
- thatopen create my-app --beta
60
- cd my-app
61
- ```
62
-
63
- **[component]**
64
- ```bash
65
- thatopen create my-component -t cloud-component --beta
66
- cd my-component
67
- ```
68
-
69
- `--beta` is required for now (the templates use engine APIs that currently live only in the
70
- beta libraries; public support lands with the October release). `create` configures private
71
- beta access from your platform token and runs `npm install` for you. The **app** scaffold is
72
- a complete working viewer; the **cloud-component** scaffold is a `main()` entry point plus a
73
- `declarations.json` (the parameters the component accepts) — read its `README.md`, which
74
- explains the exactly-four globals the cloud engine injects (do NOT import them) and how to
75
- read/write the project's data.
76
-
77
- ## 4. Run it
78
-
79
- **[app]**
80
- ```bash
81
- npm run dev
82
- ```
83
- Serves the app and opens it inside the platform. **You now have a complete, working viewer** —
84
- model loading, spatial tree, properties, measurement, sectioning, and more.
85
-
86
- **[component]**
87
- ```bash
88
- npm run run # executes the component locally against the platform (no browser)
89
- ```
90
- Runs `main()` in a local emulation of the cloud engine so you can iterate before publishing.
91
-
92
- ## 5. Then build — read the in-project agent guide
93
-
94
- The scaffold is real, working code — a complete viewer **[app]** or a runnable `main()`
95
- **[component]** — not a blank page. **Before changing anything**, open and follow:
96
-
97
- ```
98
- node_modules/@thatopen/services/resources/AGENTS.md
99
- ```
100
-
101
- (The scaffolded project's own `AGENTS.md` points here too.) It is the canonical guide for
102
- **both** project types: it indexes every platform built-in, the client API, the CLI, and the
103
- engine / UI example sets. Load those indexes before writing code. For an **app**, **all UI
104
- must be built with Lit + `@thatopen/ui` (`BUI`)** — consult the design system first. Run the
105
- scaffold first, then extend it; don't rebuild from scratch.
106
-
107
- ## 6. Publish (when ready)
108
-
109
- ```bash
110
- npm run publish
111
- ```
112
-
113
- Builds, zips (`dist/bundle.zip`), and uploads a new version to the platform — for an **app**
114
- or a **component** (a component also ships its `declarations.json`). Re-run it any time to
115
- push a new version.
116
-
117
- Once published, it shows up at **https://platform.thatopen.com/dashboard/data** — an **app**
118
- under **Apps**, a **cloud component** under **Components**. Either way it isn't running
119
- anywhere yet: to actually use it, **add it to one of your projects** from there. (A cloud
120
- component, once added to a project, is then triggered by an app or an automation in it.)
121
-
122
- ---
123
-
124
- ## Rules for you, the assistant
125
-
126
- - **Platform token only.** Never introduce, request, or store an npm token.
127
- - **Never echo or persist the user's token.** It belongs only in `~/.thatopen/config.json` /
128
- `.npmrc`, both of which the CLI manages and git-ignores.
129
- - **Propose a short plan and get the user's OK** before changing files.
130
- - The scaffold already works — **extend it, don't replace it.**
1
+ # That Open Platform — AI Quick Start (zero to a running app or cloud component)
2
+
3
+ You are an AI assistant. A user pointed you at this URL so you can scaffold and run something
4
+ on the [That Open Platform](https://platform.thatopen.com) from scratch, using
5
+ `@thatopen/services` (the `thatopen` CLI + client library). Follow the steps below in order.
6
+
7
+ > The only secret you need is a **platform API token** — **not** an npm token. The CLI
8
+ > derives private beta-registry access from the platform token automatically.
9
+
10
+ ---
11
+
12
+ ## First — what are you building? (ask if the user hasn't said)
13
+
14
+ There are two kinds of project. **If the user hasn't told you which they want, ASK them
15
+ before scaffolding** — explain it in plain terms and let them pick:
16
+
17
+ - **App** — something people *open and click around in*, running in the platform's browser
18
+ UI: a 3D BIM viewer, a dashboard, a form, a custom tool. Choose this when the goal is a
19
+ visual interface. Template: `app`.
20
+ - **Cloud component** — *server-side logic* with no UI of its own, running in the platform's
21
+ cloud and triggered by an app or an automation to do work on the project's data — e.g.
22
+ convert a file (IFC→fragments, point cloud→tiles), generate a report, run a calculation.
23
+ Choose this when the goal is processing/automation, not a screen. Template: `cloud-component`.
24
+
25
+ Steps 0–2 are identical for both; they diverge only at `create` (step 3) and how you run them
26
+ (step 4). This guide marks **[app]** / **[component]** where they differ.
27
+
28
+ ## 0. Prerequisites (check, don't assume)
29
+
30
+ - **Node.js ≥ 18** and **npm** — verify with `node -v`.
31
+ - A **That Open Platform API token**. The user creates it themselves:
32
+ → **https://platform.thatopen.com/dashboard/data → API Tokens → create → copy.**
33
+ Ask the user to paste it. **Never print it back, never write it into a file, never commit it.**
34
+
35
+ ## 1. Install the CLI
36
+
37
+ ```bash
38
+ npm install -g @thatopen/services@latest
39
+ ```
40
+
41
+ ## 2. Log in (do this BEFORE creating the project)
42
+
43
+ Get the token from the platform dashboard — **https://platform.thatopen.com/dashboard/data**
44
+ → **API Tokens** → create → copy. Ask the user to paste it, then run:
45
+
46
+ ```bash
47
+ thatopen login --token <platform-token>
48
+ ```
49
+
50
+ This validates the token and stores it in `~/.thatopen/config.json`. Login **must** come
51
+ first: the next step's install pulls the private `@thatopen-platform/*-beta` packages, and
52
+ `create` uses your logged-in token to write an authenticated `.npmrc` so that install can
53
+ resolve them. No npm account or manual npm token is involved.
54
+
55
+ ## 3. Scaffold a beta project
56
+
57
+ **[app]**
58
+ ```bash
59
+ thatopen create my-app --beta
60
+ cd my-app
61
+ ```
62
+
63
+ **[component]**
64
+ ```bash
65
+ thatopen create my-component -t cloud-component --beta
66
+ cd my-component
67
+ ```
68
+
69
+ `--beta` is required for now (the templates use engine APIs that currently live only in the
70
+ beta libraries; public support lands with the October release). `create` configures private
71
+ beta access from your platform token and runs `npm install` for you. The **app** scaffold is
72
+ a complete working viewer; the **cloud-component** scaffold is a `main()` entry point plus a
73
+ `declarations.json` (the parameters the component accepts) — read its `README.md`, which
74
+ explains the exactly-four globals the cloud engine injects (do NOT import them) and how to
75
+ read/write the project's data.
76
+
77
+ ## 4. Run it
78
+
79
+ **[app]**
80
+ ```bash
81
+ npm run dev
82
+ ```
83
+ Serves the app and opens it inside the platform. **You now have a complete, working viewer** —
84
+ model loading, spatial tree, properties, measurement, sectioning, and more.
85
+
86
+ **[component]**
87
+ ```bash
88
+ npm run run # executes the component locally against the platform (no browser)
89
+ ```
90
+ Runs `main()` in a local emulation of the cloud engine so you can iterate before publishing.
91
+
92
+ ## 5. Then build — read the in-project agent guide
93
+
94
+ The scaffold is real, working code — a complete viewer **[app]** or a runnable `main()`
95
+ **[component]** — not a blank page. **Before changing anything**, open and follow:
96
+
97
+ ```
98
+ node_modules/@thatopen/services/resources/AGENTS.md
99
+ ```
100
+
101
+ (The scaffolded project's own `AGENTS.md` points here too.) It is the canonical guide for
102
+ **both** project types: it indexes every platform built-in, the client API, the CLI, and the
103
+ engine / UI example sets. Load those indexes before writing code. For an **app**, **all UI
104
+ must be built with Lit + `@thatopen/ui` (`BUI`)** — consult the design system first. Run the
105
+ scaffold first, then extend it; don't rebuild from scratch.
106
+
107
+ ## 6. Publish (when ready)
108
+
109
+ ```bash
110
+ npm run publish
111
+ ```
112
+
113
+ Builds, zips (`dist/bundle.zip`), and uploads a new version to the platform — for an **app**
114
+ or a **component** (a component also ships its `declarations.json`). Re-run it any time to
115
+ push a new version.
116
+
117
+ Once published, it shows up at **https://platform.thatopen.com/dashboard/data** — an **app**
118
+ under **Apps**, a **cloud component** under **Components**. Either way it isn't running
119
+ anywhere yet: to actually use it, **add it to one of your projects** from there. (A cloud
120
+ component, once added to a project, is then triggered by an app or an automation in it.)
121
+
122
+ ---
123
+
124
+ ## Rules for you, the assistant
125
+
126
+ - **Platform token only.** Never introduce, request, or store an npm token.
127
+ - **Never echo or persist the user's token.** It belongs only in `~/.thatopen/config.json` /
128
+ `.npmrc`, both of which the CLI manages and git-ignores.
129
+ - **Propose a short plan and get the user's OK** before changing files.
130
+ - The scaffold already works — **extend it, don't replace it.**
@@ -1,29 +1,29 @@
1
- ---
2
- description: "Scaffold a new app or cloud component project from a template. Covers --template (app for browser BIM apps, cloud-component for server-side components), --beta for switching to private beta engine libraries at scaffold time, and using '.' as the project name to scaffold into the current directory."
3
- ---
4
-
5
- ## thatopen create
6
-
7
- Scaffolds a new ThatOpen project and runs `npm install` automatically.
8
-
9
- **Usage:**
10
- ```bash
11
- thatopen create <project-name> [flags]
12
- thatopen create . # scaffold into the current directory
13
- ```
14
-
15
- **Flags:**
16
-
17
- - `--template <template>`, `-t` — Template to use. Default: `app`.
18
- - `app` — Browser BIM app running inside the platform iframe.
19
- - `cloud-component` — Server-side component executed by the platform's cloud engine and consumed in apps and/or automations.
20
- - `--beta` — Use private beta engine libraries (`@thatopen-platform/*-beta`) instead of the public ones. Sets `beta: true` in `.thatopen` so `serve`, `local-server`, and `vite build` all resolve to beta packages automatically. Requires beta npm access configured (handled automatically once you `thatopen login`).
21
-
22
- > **`--beta` is currently required.** The templates depend on engine APIs that only exist in the beta libraries, so scaffolding without `--beta` errors out for now. Public (non-beta) support is coming with the October release.
23
-
24
- **Examples:**
25
- ```bash
26
- thatopen create my-app --beta
27
- thatopen create my-app -t cloud-component --beta
28
- thatopen create . --beta
29
- ```
1
+ ---
2
+ description: "Scaffold a new app or cloud component project from a template. Covers --template (app for browser BIM apps, cloud-component for server-side components), --beta for switching to private beta engine libraries at scaffold time, and using '.' as the project name to scaffold into the current directory."
3
+ ---
4
+
5
+ ## thatopen create
6
+
7
+ Scaffolds a new ThatOpen project and runs `npm install` automatically.
8
+
9
+ **Usage:**
10
+ ```bash
11
+ thatopen create <project-name> [flags]
12
+ thatopen create . # scaffold into the current directory
13
+ ```
14
+
15
+ **Flags:**
16
+
17
+ - `--template <template>`, `-t` — Template to use. Default: `app`.
18
+ - `app` — Browser BIM app running inside the platform iframe.
19
+ - `cloud-component` — Server-side component executed by the platform's cloud engine and consumed in apps and/or automations.
20
+ - `--beta` — Use private beta engine libraries (`@thatopen-platform/*-beta`) instead of the public ones. Sets `beta: true` in `.thatopen` so `serve`, `local-server`, and `vite build` all resolve to beta packages automatically. Requires beta npm access configured (handled automatically once you `thatopen login`).
21
+
22
+ > **`--beta` is currently required.** The templates depend on engine APIs that only exist in the beta libraries, so scaffolding without `--beta` errors out for now. Public (non-beta) support is coming with the October release.
23
+
24
+ **Examples:**
25
+ ```bash
26
+ thatopen create my-app --beta
27
+ thatopen create my-app -t cloud-component --beta
28
+ thatopen create . --beta
29
+ ```
@@ -1,38 +1,38 @@
1
- ---
2
- description: "Start a local HTTP + Socket.IO server that replicates the platform's cloud execution API on port 4001, with esbuild watch mode. Connect an app to it via EngineServicesClient's localServerUrl option to execute and monitor a local cloud component without publishing."
3
- ---
4
-
5
- ## thatopen local-server
6
-
7
- Starts a local server that mimics the platform's cloud execution API. Runs esbuild in watch mode and rebuilds the component on every save.
8
-
9
- Connect an app to it by passing `localServerUrl` to `EngineServicesClient`:
10
-
11
- ```ts
12
- const client = new EngineServicesClient(token, apiUrl, {
13
- localServerUrl: 'http://localhost:4001'
14
- });
15
- ```
16
-
17
- **Usage:**
18
- ```bash
19
- thatopen local-server [flags]
20
- ```
21
-
22
- **Flags:**
23
-
24
- - `--port <port>` — Port to run the server on. Default: `4001`.
25
- - `--skip-build` — Skip the initial build and use the existing `dist/bundle.js`.
26
-
27
- **Endpoints:**
28
-
29
- - `POST /api/processor/:componentId/execute`
30
- - `GET /api/processor/progress/:executionId`
31
- - `POST /api/processor/progress/:executionId/abort`
32
- - `GET /api/processor/:componentId/progress`
33
-
34
- **Example:**
35
- ```bash
36
- thatopen local-server
37
- thatopen local-server --port 5000
38
- ```
1
+ ---
2
+ description: "Start a local HTTP + Socket.IO server that replicates the platform's cloud execution API on port 4001, with esbuild watch mode. Connect an app to it via EngineServicesClient's localServerUrl option to execute and monitor a local cloud component without publishing."
3
+ ---
4
+
5
+ ## thatopen local-server
6
+
7
+ Starts a local server that mimics the platform's cloud execution API. Runs esbuild in watch mode and rebuilds the component on every save.
8
+
9
+ Connect an app to it by passing `localServerUrl` to `EngineServicesClient`:
10
+
11
+ ```ts
12
+ const client = new EngineServicesClient(token, apiUrl, {
13
+ localServerUrl: 'http://localhost:4001'
14
+ });
15
+ ```
16
+
17
+ **Usage:**
18
+ ```bash
19
+ thatopen local-server [flags]
20
+ ```
21
+
22
+ **Flags:**
23
+
24
+ - `--port <port>` — Port to run the server on. Default: `4001`.
25
+ - `--skip-build` — Skip the initial build and use the existing `dist/bundle.js`.
26
+
27
+ **Endpoints:**
28
+
29
+ - `POST /api/processor/:componentId/execute`
30
+ - `GET /api/processor/progress/:executionId`
31
+ - `POST /api/processor/progress/:executionId/abort`
32
+ - `GET /api/processor/:componentId/progress`
33
+
34
+ **Example:**
35
+ ```bash
36
+ thatopen local-server
37
+ thatopen local-server --port 5000
38
+ ```
package/docs/cli/login.md CHANGED
@@ -1,32 +1,32 @@
1
- ---
2
- description: "Authenticate with the ThatOpen platform by validating an access token against the API. Saves credentials globally (~/.thatopen/config.json) by default, or locally to the project's .thatopen file with --local. Local config takes priority over global."
3
- ---
4
-
5
- ## thatopen login
6
-
7
- Validates an access token against the platform API and saves the credentials. Run this once globally before using any other command, or per-project with `--local`.
8
-
9
- To get a token:
10
- 1. Go to [https://platform.thatopen.com](https://platform.thatopen.com)
11
- 2. In the header, click **Data**
12
- 3. Find the **Tokens** card and create a new token
13
- 4. Enable the permissions: **Apps**, **Components**, and **Storage**
14
- 5. Copy the token
15
-
16
- **Usage:**
17
- ```bash
18
- thatopen login --token <token> [flags]
19
- ```
20
-
21
- **Flags:**
22
-
23
- - `--token <token>` — Access token from the dashboard. Required.
24
- - `--api-url <url>` — Platform API URL. Default: `https://platform.thatopen.com` (production). Pass `https://dev.platform.thatopen.com` to target the dev environment.
25
- - `--local` — Save credentials to `.thatopen` in the current directory instead of the global config. Use this inside a project to override the global token for that project only.
26
-
27
- **Examples:**
28
- ```bash
29
- thatopen login --token my-token
30
- thatopen login --token my-token --local
31
- npm run login -- --token my-token # from inside a scaffolded project
32
- ```
1
+ ---
2
+ description: "Authenticate with the ThatOpen platform by validating an access token against the API. Saves credentials globally (~/.thatopen/config.json) by default, or locally to the project's .thatopen file with --local. Local config takes priority over global."
3
+ ---
4
+
5
+ ## thatopen login
6
+
7
+ Validates an access token against the platform API and saves the credentials. Run this once globally before using any other command, or per-project with `--local`.
8
+
9
+ To get a token:
10
+ 1. Go to [https://platform.thatopen.com](https://platform.thatopen.com)
11
+ 2. In the header, click **Data**
12
+ 3. Find the **Tokens** card and create a new token
13
+ 4. Enable the permissions: **Apps**, **Components**, and **Storage**
14
+ 5. Copy the token
15
+
16
+ **Usage:**
17
+ ```bash
18
+ thatopen login --token <token> [flags]
19
+ ```
20
+
21
+ **Flags:**
22
+
23
+ - `--token <token>` — Access token from the dashboard. Required.
24
+ - `--api-url <url>` — Platform API URL. Default: `https://platform.thatopen.com` (production). Pass `https://dev.platform.thatopen.com` to target the dev environment.
25
+ - `--local` — Save credentials to `.thatopen` in the current directory instead of the global config. Use this inside a project to override the global token for that project only.
26
+
27
+ **Examples:**
28
+ ```bash
29
+ thatopen login --token my-token
30
+ thatopen login --token my-token --local
31
+ npm run login -- --token my-token # from inside a scaffolded project
32
+ ```
@@ -1,31 +1,31 @@
1
- ---
2
- description: "Build and upload the project to the platform. Automatically detects app vs cloud component from the local .thatopen config. On first publish, saves the assigned item ID back to .thatopen so subsequent runs update the same item instead of creating a new one."
3
- ---
4
-
5
- ## thatopen publish
6
-
7
- Builds the project and uploads it to the platform. Works for both apps and cloud components — the project type is read from `.thatopen` (`itemType: APP | COMPONENT`).
8
-
9
- First publish creates the item and auto-saves its ID to `.thatopen`. Subsequent publishes update that same item.
10
-
11
- **Usage:**
12
- ```bash
13
- thatopen publish [flags]
14
- ```
15
-
16
- **Flags:**
17
-
18
- - `--name <name>` — Item name on the platform. Defaults to `name` in `package.json`.
19
- - `--version-tag <tag>` — Version tag. Defaults to `version` in `package.json`.
20
- - `--app-id <id>` — Target an existing app by ID (overrides `.thatopen`).
21
- - `--component-id <id>` — Target an existing cloud component by ID (overrides `.thatopen`).
22
- - `--skip-build` — Skip the build step and upload the existing `dist/bundle.js`.
23
- - `--icon <path>` — Path to an icon file (PNG, WebP, or ICO, max 512 KB). Saved to `.thatopen` for future publishes.
24
-
25
- **Examples:**
26
- ```bash
27
- thatopen publish
28
- thatopen publish --version-tag 2.0.0
29
- thatopen publish --skip-build
30
- thatopen publish --icon assets/icon.png
31
- ```
1
+ ---
2
+ description: "Build and upload the project to the platform. Automatically detects app vs cloud component from the local .thatopen config. On first publish, saves the assigned item ID back to .thatopen so subsequent runs update the same item instead of creating a new one."
3
+ ---
4
+
5
+ ## thatopen publish
6
+
7
+ Builds the project and uploads it to the platform. Works for both apps and cloud components — the project type is read from `.thatopen` (`itemType: APP | COMPONENT`).
8
+
9
+ First publish creates the item and auto-saves its ID to `.thatopen`. Subsequent publishes update that same item.
10
+
11
+ **Usage:**
12
+ ```bash
13
+ thatopen publish [flags]
14
+ ```
15
+
16
+ **Flags:**
17
+
18
+ - `--name <name>` — Item name on the platform. Defaults to `name` in `package.json`.
19
+ - `--version-tag <tag>` — Version tag. Defaults to `version` in `package.json`.
20
+ - `--app-id <id>` — Target an existing app by ID (overrides `.thatopen`).
21
+ - `--component-id <id>` — Target an existing cloud component by ID (overrides `.thatopen`).
22
+ - `--skip-build` — Skip the build step and upload the existing `dist/bundle.js`.
23
+ - `--icon <path>` — Path to an icon file (PNG, WebP, or ICO, max 512 KB). Saved to `.thatopen` for future publishes.
24
+
25
+ **Examples:**
26
+ ```bash
27
+ thatopen publish
28
+ thatopen publish --version-tag 2.0.0
29
+ thatopen publish --skip-build
30
+ thatopen publish --icon assets/icon.png
31
+ ```
package/docs/cli/run.md CHANGED
@@ -1,26 +1,26 @@
1
- ---
2
- description: "Build and run a cloud component locally as a child process, mirroring the backend execution environment. Accepts execution parameters as JSON via --params, validates them against declarations.json, and streams progress output to the terminal."
3
- ---
4
-
5
- ## thatopen run
6
-
7
- Builds and executes a cloud component locally, replicating what the platform's cloud engine does. Useful for testing component logic and parameters before publishing.
8
-
9
- Execution output (`MESSAGE`, `PROGRESS`, `SUCCESS`, `FAIL`) is streamed to the terminal with elapsed time.
10
-
11
- **Usage:**
12
- ```bash
13
- thatopen run [flags]
14
- ```
15
-
16
- **Flags:**
17
-
18
- - `--params <json>` — Execution parameters as a JSON string. Default: `'{}'`. Validated against `declarations.json` if present (warns, does not fail).
19
- - `--skip-build` — Skip the build step and run the existing `dist/bundle.js`.
20
-
21
- **Examples:**
22
- ```bash
23
- thatopen run
24
- thatopen run --params '{"fileId": "abc123"}'
25
- thatopen run --skip-build
26
- ```
1
+ ---
2
+ description: "Build and run a cloud component locally as a child process, mirroring the backend execution environment. Accepts execution parameters as JSON via --params, validates them against declarations.json, and streams progress output to the terminal."
3
+ ---
4
+
5
+ ## thatopen run
6
+
7
+ Builds and executes a cloud component locally, replicating what the platform's cloud engine does. Useful for testing component logic and parameters before publishing.
8
+
9
+ Execution output (`MESSAGE`, `PROGRESS`, `SUCCESS`, `FAIL`) is streamed to the terminal with elapsed time.
10
+
11
+ **Usage:**
12
+ ```bash
13
+ thatopen run [flags]
14
+ ```
15
+
16
+ **Flags:**
17
+
18
+ - `--params <json>` — Execution parameters as a JSON string. Default: `'{}'`. Validated against `declarations.json` if present (warns, does not fail).
19
+ - `--skip-build` — Skip the build step and run the existing `dist/bundle.js`.
20
+
21
+ **Examples:**
22
+ ```bash
23
+ thatopen run
24
+ thatopen run --params '{"fileId": "abc123"}'
25
+ thatopen run --skip-build
26
+ ```