You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/getting-started/build-with-claude-code.mdx
+55-5Lines changed: 55 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ hand-edits generated glue, and no metadata mistake reaches the browser unchecked
41
41
42
42
| You need | Why |
43
43
|:---|:---|
44
-
|**Node.js 18+** and **pnpm**| Runs the scaffolder and the dev server (see [prerequisites](/docs/getting-started#prerequisites)). |
44
+
|**Node.js 18+** and npm (pnpm / yarn / bun also work)| Runs the scaffolder and the dev server (see [prerequisites](/docs/getting-started#prerequisites)). |
45
45
|**[Claude Code](https://claude.com/claude-code)** (or Cursor / Copilot) | Your agent reads `AGENTS.md` + the ObjectStack skills and authors the metadata. |
46
46
47
47
## 1. Scaffold the project
@@ -63,10 +63,6 @@ The scaffolder does more than copy files. It:
63
63
`npm run validate` after every metadata change*.
64
64
65
65
```
66
-
╔═══════════════════════════════════╗
67
-
║ ◆ Create ObjectStack v6.x ║
68
-
╚═══════════════════════════════════╝
69
-
70
66
◆ New Environment
71
67
────────────────────────────────────────
72
68
Environment: support-desk
@@ -75,6 +71,12 @@ The scaffolder does more than copy files. It:
The agent also **wires the new files into `objectstack.config.ts`** — the object
198
+
through the `src/objects/index.ts` barrel, and the action and view via the
199
+
`actions:` / `views:` arrays in `defineStack()`. There is no filename-suffix
200
+
magic: metadata exists in the app only if the config imports it, so if a
201
+
freshly-authored action doesn't show up, the wiring is the first thing to check.
202
+
195
203
This is the same metadata that powers the REST API, the Console UI, **and the MCP
196
204
tools exposed to AI** — define it once, and ObjectStack derives the rest.
197
205
206
+
<Callouttype="info">
207
+
Every example on this page was authored against `@objectstack/spec` 16.x and
208
+
passes `os validate` verbatim in a freshly scaffolded project.
209
+
</Callout>
210
+
198
211
## 4. The gate: `os validate` catches AI mistakes
199
212
200
213
The most common way AI-authored metadata goes wrong is a mistake that **type-checks
@@ -289,6 +302,43 @@ tightening on each pass until the app is right. See
289
302
[How AI development works](/docs/getting-started/how-ai-development-works) for why
290
303
this stays fast and safe as the app grows.
291
304
305
+
<Callouttype="tip">
306
+
Beyond the pass/fail gate there's a **quality rubric**: `npx os lint --score`
307
+
prints a 0–100 metadata-quality score (relationship patterns, missing options,
308
+
roll-ups, name fields). Ask the agent to keep the project lint-clean — "run
309
+
`os lint` and fix the warnings" is a perfectly good prompt.
310
+
</Callout>
311
+
312
+
## Beyond the first app — one skill per metadata domain
313
+
314
+
The loop above never changes; what changes is **which skill the agent loads**.
315
+
The bundle ships nine, one per metadata domain, and the agent picks by task
316
+
context (the trigger table lives in your project's `AGENTS.md`). To grow the
317
+
support desk into a full application, keep describing — each row is a real
318
+
prompt you can give verbatim:
319
+
320
+
| You want | Skill the agent loads | Say something like |
321
+
|:---|:---|:---|
322
+
| Data model — objects, fields, relationships, validations, seeds |`objectstack-data`| "Add an `account` object and link tickets to it with a required lookup. Seed three demo accounts." |
323
+
| Queries & reports over records |`objectstack-query`| "Show me the count of open tickets per priority, using an aggregation." |
324
+
| Views, dashboards, apps, record pages |`objectstack-ui`| "Add a dashboard with a metric for open tickets and a bar chart of tickets by priority." |
325
+
| Business automation — flows, approvals, schedules |`objectstack-automation`| "Every day at 9:00, escalate tickets that have been open more than 48 hours." |
326
+
| Permissions & row-level security |`objectstack-data` (security sections) | "Members should only see their own tickets; support managers see everything." |
327
+
| Formula / conditional-field logic (CEL) |`objectstack-formula`| "Make `resolved_at` required and visible only when status is resolved." |
328
+
| AI agents & tools inside your app |`objectstack-ai`| "Add an AI skill that triages new tickets into a priority." |
329
+
| REST/auth surface tuning |`objectstack-api`| "Restrict the ticket API to read-only for non-members." |
330
+
| Translations |`objectstack-i18n`| "Add a zh-CN translation bundle for the ticket object and app navigation." |
331
+
332
+
Two habits keep this reliable as the app grows:
333
+
334
+
-**The gate applies to every domain.** Flows, dashboards, permissions, and
335
+
translations all go through the same `npm run validate` — the agent should run
336
+
it after each change, exactly as `AGENTS.md` instructs.
337
+
-**Keep the skills current.** After upgrading `@objectstack/spec`, re-run
338
+
`npx skills add objectstack-ai/framework/skills --all` so the agent authors
339
+
against the schemas you actually run. The full catalog is documented in the
340
+
[AI Skills Reference](/docs/ai/skills-reference).
341
+
292
342
## 7. Your app is natively AI-operable (MCP)
293
343
294
344
Here's the payoff that a hand-built CRUD app doesn't give you for free: because
Copy file name to clipboardExpand all lines: content/docs/getting-started/cli.mdx
+60-26Lines changed: 60 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ os generate flow onboarding # Add an automation flow
42
42
os dev --ui
43
43
```
44
44
45
-
Open [http://localhost:3000/_console/](http://localhost:3000/_console/) — you'll see the Console UI with a data browser, metadata explorer, and API documentation.
45
+
Open [http://localhost:3000/_console/](http://localhost:3000/_console/) — you'll see the Console UI with a data browser, metadata explorer, and API documentation. Sign in with the seeded dev admin (`admin@objectos.ai` / `admin123`) — `os dev` provisions it automatically on an empty database. The boot banner also prints the app's MCP endpoint (`/api/v1/mcp`) so a coding agent can connect to the running app.
46
46
47
47
### Validate & Build
48
48
@@ -138,8 +138,14 @@ os dev --database file:./data/test.db --auth-secret $(openssl rand -hex 32)
138
138
|`-p, --port <n>`|`OS_PORT` / `PORT`| Listen port (default `3000`). In dev a busy port auto-hops to the next free one; the banner shows the actual port. |
139
139
|`--ui`| — | Force Console UI on (already on by default in dev) |
140
140
|`--compile`| — | Force compiling `objectstack.config.ts` → `dist/objectstack.json` before starting (auto when the artifact is missing; ignored with `--artifact`) |
141
+
|`--fresh`| — | Ephemeral `OS_HOME` in the OS tempdir (clean DB, uploads, storage), auto-deleted on exit; implies `--seed-admin`|
142
+
|`--seed-admin` / `--no-seed-admin`| — | Seed a dev admin (`admin@objectos.ai` / `admin123`) on an empty DB — default on; override with `--admin-email` / `--admin-password`|
141
143
|`-v, --verbose`| — | Verbose output |
142
144
145
+
By default `os dev` keeps your data between restarts in a project-local SQLite
146
+
file at `.objectstack/data/dev.db` (created on first run). Pass `--database`,
147
+
set `OS_DATABASE_URL`, or use `--fresh` for a throwaway run.
148
+
143
149
With a file-backed SQLite database, dev also provisions a sibling
144
150
`<db>.telemetry.<ext>` file registered as the `telemetry` datasource —
145
151
lifecycle-classed system data (activity streams, job runs, notifications,
@@ -194,7 +200,8 @@ only gate the **automatic** registration of optional plugins.
194
200
195
201
The `auth` tier requires `OS_AUTH_SECRET` to be set; otherwise `AuthPlugin`
196
202
is skipped with a yellow warning and the `/api/v1/auth/*` endpoints will
197
-
return 404. To take full control, set `tiers` on the stack config:
203
+
return 404. (In `--dev` mode the CLI falls back to an insecure local secret so
204
+
login works out of the box.) To take full control, set `tiers` on the stack config:
|`--database-driver <kind>`|`OS_DATABASE_DRIVER`| Force `sqlite`\|`turso`\|`postgres`\|`mongodb`\|`memory` when the URL is ambiguous |
299
308
|`--database-auth-token <token>`|`OS_DATABASE_AUTH_TOKEN`| Auth token for libsql/Turso |
300
-
|`--auth-secret <secret>`|`OS_AUTH_SECRET`| Secret for `@objectstack/plugin-auth`; without it `/api/v1/auth/*` is skipped (server still runs) |
309
+
|`--auth-secret <secret>`|`OS_AUTH_SECRET` / `AUTH_SECRET`| Secret for `@objectstack/plugin-auth`. If neither the flag nor the env var is set, `os start`**auto-generates one** and persists it at `<home>/auth-secret`|
310
+
|`--home <dir>`|`OS_HOME`| Home directory for persistent state (default `<cwd>/.objectstack` when an `objectstack.config.ts` is present, otherwise `~/.objectstack`) |
|`-p, --port <port>`|`OS_PORT` / `PORT`| Listen port (default `3000`). **Production fails loudly if the port is busy** — see note below. |
303
313
|`--ui` / `--no-ui`| — | Mount the Console portal at `/_console/`. Enabled by default (so you can install marketplace apps); pass `--no-ui` to disable it. |
@@ -310,7 +320,7 @@ os start
310
320
> (CORS). **Pin the port explicitly** (`OS_PORT=8080 os start`) and keep
311
321
> `OS_AUTH_URL` / `OS_TRUSTED_ORIGINS` in sync when you change it.
- Runs standalone boot mode with one active environment.
321
331
322
332
**Authentication:**
323
-
The `auth` capability is auto-loaded only when both (1) the artifact declares `requires: [..., 'auth']`**and** (2) a secret is provided via `--auth-secret` or `OS_AUTH_SECRET`. Without a secret, `AuthPlugin` is **silently skipped with a warning** — the server still boots and serves data/REST routes, only `/api/v1/auth/*` (login/register) is omitted. This is intentional: `os start` is happy to run an unauthenticated, internal-network deployment.
0 commit comments