|
| 1 | +# That Open Platform — AI Quick Start (zero to a running app) |
| 2 | + |
| 3 | +You are an AI assistant. A user pointed you at this URL so you can scaffold and run a |
| 4 | +**BIM app** 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 | +## 0. Prerequisites (check, don't assume) |
| 13 | + |
| 14 | +- **Node.js ≥ 18** and **npm** — verify with `node -v`. |
| 15 | +- A **That Open Platform API token**. The user creates it themselves: |
| 16 | + → **https://platform.thatopen.com/dashboard/data → API Tokens → create → copy.** |
| 17 | + Ask the user to paste it. **Never print it back, never write it into a file, never commit it.** |
| 18 | + |
| 19 | +## 1. Install the CLI |
| 20 | + |
| 21 | +```bash |
| 22 | +npm install -g @thatopen/services@latest |
| 23 | +``` |
| 24 | + |
| 25 | +## 2. Log in (do this BEFORE creating the project) |
| 26 | + |
| 27 | +```bash |
| 28 | +thatopen login --token <platform-token> |
| 29 | +``` |
| 30 | + |
| 31 | +This validates the token and stores it in `~/.thatopen/config.json`. Login **must** come |
| 32 | +first: the next step's install pulls the private `@thatopen-platform/*-beta` packages, and |
| 33 | +`create` uses your logged-in token to write an authenticated `.npmrc` so that install can |
| 34 | +resolve them. No npm account or manual npm token is involved. |
| 35 | + |
| 36 | +## 3. Scaffold a beta app |
| 37 | + |
| 38 | +```bash |
| 39 | +thatopen create my-app --beta |
| 40 | +cd my-app |
| 41 | +``` |
| 42 | + |
| 43 | +`--beta` is required for now: the bundled viewer uses engine APIs that currently live only |
| 44 | +in the beta libraries (public engine support lands with the October release). `create` |
| 45 | +configures private beta access from your platform token and runs `npm install` for you. |
| 46 | + |
| 47 | +## 4. Run it |
| 48 | + |
| 49 | +```bash |
| 50 | +npm run dev |
| 51 | +``` |
| 52 | + |
| 53 | +This serves the app and opens it inside the platform. **You now have a complete, working |
| 54 | +viewer** — model loading, spatial tree, properties, measurement, sectioning, and more. |
| 55 | + |
| 56 | +## 5. Then build — read the in-project agent guide |
| 57 | + |
| 58 | +The scaffold is a real app, not a blank page. **Before changing anything**, open and follow: |
| 59 | + |
| 60 | +``` |
| 61 | +node_modules/@thatopen/services/resources/AGENTS.md |
| 62 | +``` |
| 63 | + |
| 64 | +(The scaffolded project's own `AGENTS.md` points here too.) It is the canonical guide: it |
| 65 | +indexes every platform built-in, the client API, the CLI, and the engine / UI example sets. |
| 66 | +Load those indexes before writing code. **All UI must be built with Lit + `@thatopen/ui` |
| 67 | +(`BUI`)** — consult the design system before writing any UI. Run the app first, then extend |
| 68 | +it; don't rebuild a viewer from scratch. |
| 69 | + |
| 70 | +## 6. Publish (when ready) |
| 71 | + |
| 72 | +```bash |
| 73 | +npm run publish |
| 74 | +``` |
| 75 | + |
| 76 | +Builds the app, zips it (`dist/bundle.zip`), and uploads a new version to the platform. |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +## Rules for you, the assistant |
| 81 | + |
| 82 | +- **Platform token only.** Never introduce, request, or store an npm token. |
| 83 | +- **Never echo or persist the user's token.** It belongs only in `~/.thatopen/config.json` / |
| 84 | + `.npmrc`, both of which the CLI manages and git-ignores. |
| 85 | +- **Propose a short plan and get the user's OK** before changing files. |
| 86 | +- The scaffold already works — **extend it, don't replace it.** |
0 commit comments