@teable/create-app 1.0.0 → 1.0.2

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/README.md CHANGED
@@ -13,8 +13,10 @@ cd my-app && bun install && bun run check
13
13
  which must be absent or empty (a lone `.git` is fine), and `teable.json`
14
14
  naming the app on Teable; without `--app-id` it names none. The app's
15
15
  `AGENTS.md` (read by Claude Code through `CLAUDE.md`, and by other agents)
16
- holds its rules, commands and how to publish it with `teable app publish`.
17
- It needs [Bun](https://bun.sh).
16
+ holds its rules, commands and how to publish it with `teable-next publish`
17
+ ([`@teable/next-cli`](https://www.npmjs.com/package/@teable/next-cli), which
18
+ also starts an app in a project on Teable: `teable-next init <dir> --project
19
+ <projectId>`). It needs [Bun](https://bun.sh).
18
20
 
19
21
  ## The Agent Skill
20
22
 
@@ -4,7 +4,7 @@ This repository is one Teable app: a Drizzle schema plus read, write and task
4
4
  methods, written with `@teable/app`. Teable runs it on Cloudflare in a Durable
5
5
  Object with its own SQLite database, and makes an HTTP API and MCP tools from
6
6
  its methods. Change it here, run the checks, and publish it with
7
- `teable app publish`.
7
+ `teable-next publish`.
8
8
 
9
9
  It starts as an example (a `notes` table, `listNotes`, `addNote`, a page, a
10
10
  test at each level) that shows the whole shape. Replace it with the app the
@@ -17,10 +17,11 @@ user needs.
17
17
  | `src/server/schema.ts` | Tables, with their rules (Drizzle). drizzle-kit loads it in Node: it imports only `drizzle-orm` and `@teable/app/schema`. |
18
18
  | `src/server/index.ts` | Methods. `export const App = app.define({ ... })` names them; Teable runs this module. |
19
19
  | `drizzle/` | Migrations written by `bun run db:generate`, and `migrations.js`, which lists them. |
20
- | `src/web/` | Pages: React, TanStack Router and Query, Tailwind on shadcn's tokens. `app.ts` holds the client and the query cache. |
20
+ | `src/web/` | Pages: React, TanStack Router and Query, shadcn's components. `app.ts` holds the client and the query cache. |
21
+ | `src/components/ui/` | shadcn's components on UI SDK, as `bunx shadcn add <name>` writes them (`components.json`); the app's own. |
21
22
  | `test/` | Method tests. They run in workerd, against a real SQLite database. |
22
23
  | `src/**/*.test.tsx` | Page tests, in jsdom, against a stubbed client. |
23
- | `teable.json` | `appId`: which app on Teable this is. The `teable` CLI and the pages read it; leave it as it is. |
24
+ | `teable.json` | `appId`: which app on Teable this is. `teable-next` and the pages read it; leave it as it is. |
24
25
  | `dist/` | What `bun run build` writes: `server.js`, which publishing uploads, and `pages/`. Not committed. |
25
26
 
26
27
  ## Commands
@@ -31,13 +32,15 @@ bun run check # typecheck, tests, migration checks; befor
31
32
  bun run build # dist/server.js (what publish uploads) and dist/pages/
32
33
  bun run db:generate --name <change> # after changing schema.ts: the next migration
33
34
  bun run test [file] [-t <name>] # tests only, or some of them
34
- teable app push -m "<what changed>" # commit, and save the source to Teable
35
- teable app publish # deploy dist/server.js, with its commit, as the next version
36
- teable app versions # published versions, newest first: when, by whom, which commit
37
- teable app rollback --version <n> # deploy version n's code again, as the next version
35
+ teable-next pull # before you start: the latest from Teable
36
+ teable-next push -m "<what changed>" # commit, and save the source to Teable
37
+ teable-next publish # check, build and deploy dist/server.js, with its commit, as the next version
38
+ teable-next versions # published versions, newest first: when, by whom, which commit
39
+ teable-next rollback --version <n> # deploy version n's code again, as the next version
38
40
  ```
39
41
 
40
- `teable app <command> --help` lists every option. There is no local server
42
+ `teable-next <command> --help` lists every option; without the CLI
43
+ installed, `npx @teable/next-cli <command>` runs it. There is no local server
41
44
  (`dev`): the runtime that hosts apps is not published. Tests are the loop:
42
45
  methods against a real database, pages against a stubbed client. Publish to
43
46
  see the app running.
@@ -156,10 +159,22 @@ export const App = app.define({ listInvoices, markPaid });
156
159
  not callable.
157
160
  2. Add its route in `src/web/main.tsx` (`createRoute`, then
158
161
  `rootRoute.addChildren`).
159
- 3. Style it with Tailwind classes on shadcn's tokens (`bg-primary`,
162
+ 3. Build it from shadcn's components on UI SDK (style `ui-sdk-rhea`), as the
163
+ notes page does with `Button`, `Input` and `Alert`:
164
+ `bunx shadcn add <name>` writes one to `src/components/ui/`. Before using
165
+ one, read `node_modules/@ui-sdk/react/docs/llms.txt` and the component's
166
+ page next to it (`docs/components/<name>.md`), which match the installed
167
+ version; UI SDK's guide for agents is
168
+ `node_modules/@ui-sdk/core/skills/ui-sdk/SKILL.md`. Never hand-roll what
169
+ it ships: a `role="listbox"`, `"menu"` or `"dialog"` is a component to
170
+ add. UI SDK needs no providers, takes `render={<Button />}` where Radix
171
+ took `asChild`, and renders popups in place, in the top layer (no portals,
172
+ no `z-50`).
173
+ 4. Lay it out with Tailwind classes on shadcn's tokens (`bg-primary`,
160
174
  `text-muted-foreground`, `border-border`, `text-destructive`); they are in
161
- `styles.css`. Write the text in the user's language.
162
- 4. Test it next to it (`<page>.test.tsx`), with a client whose `fetch` the
175
+ `styles.css`, whose first rule stays `@layer ui-sdk;`. Write the text in
176
+ the user's language.
177
+ 5. Test it next to it (`<page>.test.tsx`), with a client whose `fetch` the
163
178
  test answers, as `notes.test.tsx` does.
164
179
 
165
180
  ### Add a task or a schedule
@@ -242,8 +257,10 @@ the migrations.
242
257
  | `Declare capabilities: [...] in createApp`, or `not permitted to access the internet` | Declare the capability; use it in a task. |
243
258
  | `must export the class from define() as "App"` (build) | `export const App = app.define({ ... })` in `src/server/index.ts`. |
244
259
  | `Stripping types is currently unsupported for files under node_modules` | Vite or Vitest ran on Node; run them through `bun run test` and `bun run build`. |
245
- | `FORBIDDEN` from `teable app publish` or `rollback` | Publishing takes the `creator` or `owner` role in the app's space; ask the user. |
246
- | `CONFLICT` from `teable app rollback` | That version lacks a migration the live database has run: roll forward with a new version instead. |
260
+ | `uncommitted changes` or `is not pushed yet` from `teable-next publish` | Publishing deploys only what is pushed: `teable-next push -m "<what changed>"`, then publish again. |
261
+ | `moved to ... since your last pull` from `teable-next push` | Someone else pushed: `teable-next pull` (rebase on `teable/main` if your commits diverged), then push again. |
262
+ | `FORBIDDEN` from `teable-next publish` or `rollback` | Publishing takes the `creator` or `owner` role in the app's space; ask the user. |
263
+ | `CONFLICT` from `teable-next rollback` | That version lacks a migration the live database has run: roll forward with a new version instead. |
247
264
  | `RATE_LIMITED` (HTTP 429) | Wait as long as `Retry-After` says, then try again. |
248
265
  | `Deploy rejected: built for app protocol N; this runtime speaks M` (publish) | `bun add @teable/app@latest`, then check, build and publish again. |
249
266
  | `Deploy rejected` with `Migration ... failed: ...` (publish) | The migration does not fit the live rows (a NOT NULL column without a default, a CHECK some rows break): make it handle them (a default, an `UPDATE` first). A rejected migration never ran: edit it. |
@@ -251,19 +268,20 @@ the migrations.
251
268
  ## Publishing
252
269
 
253
270
  Once `bun run check` and `bun run build` pass, push and publish:
254
- `teable app push -m "<what changed>"`, then `teable app publish`. Do not wait
255
- to be asked: publishing is how the user gets the change, and a publish that
256
- fails changes nothing. It takes the `creator` or `owner` role in the app's
257
- space. Teable starts the new version on a copy of the live data first,
258
- running its migrations, then on the live data, and makes it live only if both
259
- work; open pages read everything again. Every version records when it was
260
- published, by whom, and from which commit. Then tell the user what changed.
261
- The methods are live at once through the API
271
+ `teable-next push -m "<what changed>"`, then `teable-next publish`, which
272
+ deploys exactly the commit pushed: it runs the check and the build again,
273
+ and prints the app's URLs. Do not wait to be asked: publishing is how the
274
+ user gets the change, and a publish that fails changes nothing. It takes the
275
+ `creator` or `owner` role in the app's space. Teable starts the new version
276
+ on a copy of the live data first, running its migrations, then on the live
277
+ data, and makes it live only if both work; open pages read everything again.
278
+ Every version records when it was published, by whom, and from which commit.
279
+ Then tell the user what changed. The methods are live at once through the API
262
280
  (`/api/v4/apps/<appId>/methods/<name>`, described at `.../openapi.json`), MCP
263
281
  (`/api/v4/apps/<appId>/mcp`) and the app on Teable; Teable does not serve
264
282
  `dist/pages` yet.
265
283
 
266
- `teable app rollback` deploys an earlier version's code again, as the next
284
+ `teable-next rollback` deploys an earlier version's code again, as the next
267
285
  version. It cannot go back past a migration: the live database has run it,
268
286
  and code without it does not start, so the rollback is refused (`CONFLICT`);
269
287
  undo a schema change with a new migration. A rollback changes only what
@@ -1,14 +1,17 @@
1
1
  {
2
2
  "$schema": "https://ui.shadcn.com/schema.json",
3
- "style": "new-york",
3
+ "style": "ui-sdk-rhea",
4
4
  "rsc": false,
5
5
  "tsx": true,
6
6
  "tailwind": {
7
7
  "config": "",
8
8
  "css": "src/web/styles.css",
9
9
  "baseColor": "neutral",
10
- "cssVariables": true
10
+ "cssVariables": true,
11
+ "prefix": ""
11
12
  },
13
+ "iconLibrary": "lucide",
14
+ "rtl": false,
12
15
  "aliases": {
13
16
  "components": "@/components",
14
17
  "utils": "@/lib/utils",
@@ -16,6 +19,8 @@
16
19
  "lib": "@/lib",
17
20
  "hooks": "@/hooks"
18
21
  },
22
+ "menuColor": "default",
23
+ "menuAccent": "subtle",
19
24
  "registries": {
20
25
  "@teable": "https://teable.ai/r/{name}.json"
21
26
  }
@@ -11,10 +11,16 @@
11
11
  "test": "vitest run"
12
12
  },
13
13
  "dependencies": {
14
+ "@fontsource-variable/inter": "5.3.0",
14
15
  "@tanstack/react-query": "5.108.4",
15
16
  "@tanstack/react-router": "1.170.46",
16
- "@teable/app": "^5.0.0",
17
+ "@teable/app": "^5.0.2",
18
+ "@ui-sdk/core": "0.1.0-beta.24",
19
+ "@ui-sdk/react": "0.1.0-beta.24",
20
+ "class-variance-authority": "0.7.1",
21
+ "cn": "0.5.2",
17
22
  "drizzle-orm": "0.45.4",
23
+ "lucide-react": "1.87.0",
18
24
  "react": "19.3.1",
19
25
  "react-dom": "19.3.1"
20
26
  },
@@ -29,7 +35,7 @@
29
35
  "@vitejs/plugin-react": "6.3.1",
30
36
  "drizzle-kit": "0.31.11",
31
37
  "jsdom": "31.0.1",
32
- "shadcn": "4.23.1",
38
+ "shadcn": "4.24.0",
33
39
  "tailwindcss": "4.3.5",
34
40
  "tw-animate-css": "1.4.0",
35
41
  "typescript": "7.0.2",
@@ -0,0 +1,72 @@
1
+ import { cva, type VariantProps } from "class-variance-authority";
2
+ import { cn } from "cn";
3
+ import type * as React from "react";
4
+
5
+ const alertVariants = cva(
6
+ "group/alert relative grid w-full gap-0.5 rounded-2xl border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",
7
+ {
8
+ variants: {
9
+ variant: {
10
+ default: "bg-card text-card-foreground",
11
+ destructive:
12
+ "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current",
13
+ },
14
+ },
15
+ defaultVariants: {
16
+ variant: "default",
17
+ },
18
+ },
19
+ );
20
+
21
+ function Alert({
22
+ className,
23
+ variant,
24
+ ...props
25
+ }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
26
+ return (
27
+ <div
28
+ data-slot="alert"
29
+ role="alert"
30
+ className={cn(alertVariants({ variant }), className)}
31
+ {...props}
32
+ />
33
+ );
34
+ }
35
+
36
+ function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
37
+ return (
38
+ <div
39
+ data-slot="alert-title"
40
+ className={cn(
41
+ "font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",
42
+ className,
43
+ )}
44
+ {...props}
45
+ />
46
+ );
47
+ }
48
+
49
+ function AlertDescription({ className, ...props }: React.ComponentProps<"div">) {
50
+ return (
51
+ <div
52
+ data-slot="alert-description"
53
+ className={cn(
54
+ "text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
55
+ className,
56
+ )}
57
+ {...props}
58
+ />
59
+ );
60
+ }
61
+
62
+ function AlertAction({ className, ...props }: React.ComponentProps<"div">) {
63
+ return (
64
+ <div
65
+ data-slot="alert-action"
66
+ className={cn("absolute top-2.5 right-3", className)}
67
+ {...props}
68
+ />
69
+ );
70
+ }
71
+
72
+ export { Alert, AlertAction, AlertDescription, AlertTitle };
@@ -0,0 +1,52 @@
1
+ import { Button as ButtonPrimitive } from "@ui-sdk/react/button";
2
+ import { cva, type VariantProps } from "class-variance-authority";
3
+ import { cn } from "cn";
4
+ import type * as React from "react";
5
+
6
+ const buttonVariants = cva(
7
+ "group/button inline-flex shrink-0 items-center justify-center rounded-2xl border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
12
+ outline:
13
+ "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-transparent dark:hover:bg-input/30",
14
+ secondary:
15
+ "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
16
+ ghost:
17
+ "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
18
+ destructive:
19
+ "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
20
+ link: "text-primary underline-offset-4 hover:underline",
21
+ },
22
+ size: {
23
+ default:
24
+ "h-8 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5",
25
+ xs: "h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3",
26
+ sm: "h-7 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
27
+ lg: "h-9 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
28
+ icon: "size-8",
29
+ "icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
30
+ "icon-sm": "size-7",
31
+ "icon-lg": "size-9",
32
+ },
33
+ },
34
+ defaultVariants: {
35
+ variant: "default",
36
+ size: "default",
37
+ },
38
+ },
39
+ );
40
+
41
+ function Button({
42
+ className,
43
+ variant = "default",
44
+ size = "default",
45
+ ...props
46
+ }: React.ComponentProps<typeof ButtonPrimitive> & VariantProps<typeof buttonVariants>) {
47
+ return (
48
+ <ButtonPrimitive className={cn(buttonVariants({ variant, size, className }))} {...props} />
49
+ );
50
+ }
51
+
52
+ export { Button, buttonVariants };
@@ -0,0 +1,18 @@
1
+ import { Input as InputPrimitive } from "@ui-sdk/react/input";
2
+ import { cn } from "cn";
3
+ import type * as React from "react";
4
+
5
+ function Input({ className, type, ...props }: React.ComponentProps<typeof InputPrimitive>) {
6
+ return (
7
+ <InputPrimitive
8
+ type={type}
9
+ className={cn(
10
+ "h-8 w-full min-w-0 rounded-2xl border border-transparent bg-input/50 px-2.5 py-1 text-base transition-[color,box-shadow] duration-200 outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
11
+ className,
12
+ )}
13
+ {...props}
14
+ />
15
+ );
16
+ }
17
+
18
+ export { Input };
@@ -1,5 +1,8 @@
1
1
  import { useMutation, useQuery } from "@tanstack/react-query";
2
2
  import { useState } from "react";
3
+ import { Alert, AlertDescription } from "@/components/ui/alert";
4
+ import { Button } from "@/components/ui/button";
5
+ import { Input } from "@/components/ui/input";
3
6
  import { client, queryClient } from "./app";
4
7
 
5
8
  /** The notes, newest first, and a box to add one. */
@@ -29,24 +32,20 @@ export function NotesPage() {
29
32
  add.mutate(text);
30
33
  }}
31
34
  >
32
- <input
35
+ <Input
33
36
  aria-label="New note"
34
37
  value={text}
35
38
  onChange={(event) => setText(event.target.value)}
36
- className="flex-1 rounded-md border border-input bg-background px-3 py-2 text-sm"
39
+ className="flex-1"
37
40
  />
38
- <button
39
- type="submit"
40
- disabled={text.trim() === "" || add.isPending}
41
- className="rounded-md bg-primary px-4 py-2 text-primary-foreground text-sm disabled:opacity-50"
42
- >
41
+ <Button type="submit" disabled={text.trim() === "" || add.isPending}>
43
42
  Add
44
- </button>
43
+ </Button>
45
44
  </form>
46
45
  {error && (
47
- <p role="alert" className="text-destructive text-sm">
48
- {error.message}
49
- </p>
46
+ <Alert variant="destructive">
47
+ <AlertDescription>{error.message}</AlertDescription>
48
+ </Alert>
50
49
  )}
51
50
  {notes.data ? (
52
51
  <ul className="divide-y divide-border rounded-md border border-border">
@@ -1,19 +1,23 @@
1
- @import "tailwindcss";
2
-
3
1
  /*
4
- * shadcn's standard stylesheet for style new-york, base color neutral, CSS
5
- * variables, Tailwind v4 (what the shop template's components.json declares),
6
- * as the shadcn CLI writes it: tw-animate-css (enter and exit animations),
7
- * shadcn/tailwind.css (the data-open: style variants that dialogs, popovers
8
- * and menus use) and the tokens. Registry components style themselves with
2
+ * shadcn's stylesheet for style ui-sdk-rhea (components on UI SDK, the Rhea
3
+ * preset: base color neutral, Lucide icons, the Inter font), CSS variables,
4
+ * Tailwind v4 (what components.json declares), as
5
+ * `shadcn init --base ui-sdk --preset rhea` writes it: the ui-sdk layer,
6
+ * declared before everything so any class beats the few styles UI SDK adds to
7
+ * it at runtime (hiding closed parts); tw-animate-css (enter and exit
8
+ * animations); shadcn/tailwind.css (the data-open: style variants that popups
9
+ * use); the font; and the tokens. Registry components style themselves with
9
10
  * these.
10
11
  *
11
- * From this comment to the end, templates/shop/src/web/styles.css and
12
- * apps/web/src/styles.css are identical, so the builder looks like the apps it
13
- * builds.
12
+ * From this comment to the end, every Teable template's stylesheet and the
13
+ * builder's are identical, so the builder looks like the apps it builds.
14
14
  */
15
+ @layer ui-sdk;
16
+
17
+ @import "tailwindcss";
15
18
  @import "tw-animate-css";
16
19
  @import "shadcn/tailwind.css";
20
+ @import "@fontsource-variable/inter";
17
21
 
18
22
  @custom-variant dark (&:is(.dark *));
19
23
 
@@ -125,6 +129,8 @@
125
129
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
126
130
  --color-sidebar-border: var(--sidebar-border);
127
131
  --color-sidebar-ring: var(--sidebar-ring);
132
+ --font-heading: var(--font-sans);
133
+ --font-sans: "Inter Variable", sans-serif;
128
134
  }
129
135
 
130
136
  @layer base {
@@ -134,4 +140,7 @@
134
140
  body {
135
141
  @apply bg-background text-foreground;
136
142
  }
143
+ html {
144
+ @apply font-sans;
145
+ }
137
146
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teable/create-app",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Start a Teable app: a blank app, the instructions agents read in it, and the teable-next-app Agent Skill",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -10,7 +10,7 @@ write and task methods (`src/server/index.ts`, with `@teable/app`), migrations
10
10
  (`drizzle/`), pages (`src/web/`) and tests. Teable runs it on Cloudflare, one
11
11
  Durable Object with its own SQLite database per app, and makes an HTTP API
12
12
  and MCP tools from its methods. You build it in a shell, like any project,
13
- and publish it with the `teable` CLI.
13
+ and publish it with `teable-next`, the CLI for Teable apps.
14
14
 
15
15
  ## When to use it
16
16
 
@@ -24,17 +24,23 @@ and publish it with the `teable` CLI.
24
24
 
25
25
  ## Start
26
26
 
27
+ An app is a project on Teable that runs in teable-next: the app's id is the
28
+ project's (`bseXXX`), the project the user is working in.
29
+
27
30
  ```sh
28
- teable app init --name "<app name>" # a new app: creates it on Teable, checks out its repository
29
- teable app clone --app-id <appId> # an app that exists: checks out its repository
30
- teable app pull # in a checkout you have: bring it up to date first
31
+ teable-next init <dir> --project <projectId> # a new app: writes it, pushes it to the project's repository
32
+ teable-next clone <projectId> [dir] # an app that has code: checks out its repository
33
+ teable-next pull # in a checkout you have: bring it up to date first
31
34
  ```
32
35
 
33
- Without the `teable` CLI (Claude Code on someone's own machine, say),
34
- `npx @teable/create-app <dir> --app-id <appId>` (or `bunx`) writes the same
35
- blank app; leave out `--app-id` to try one locally, and `git init` it. Then
36
- `bun install`, and read the app's `AGENTS.md` before changing anything: it is
37
- the app's own instructions, current for the SDK the app uses.
36
+ `teable-next` acts as the user, with their token: `TEABLE_TOKEN` (a Teable
37
+ sandbox sets it, and `TEABLE_ENDPOINT`), or the one `teable-next login
38
+ --token <token>` saved. Where it is not installed (Claude Code on someone's
39
+ own machine, say), `npx @teable/next-cli <command>` (or `bunx`) runs it. To
40
+ try an app with no project yet, `npx @teable/create-app <dir>` writes the
41
+ same blank app, without an app id; `git init` it. Then `bun install`, and
42
+ read the app's `AGENTS.md` before changing anything: it is the app's own
43
+ instructions, current for the SDK the app uses.
38
44
 
39
45
  ## The loop
40
46
 
@@ -42,16 +48,17 @@ the app's own instructions, current for the SDK the app uses.
42
48
  2. `bun run check`: typecheck, tests (methods in workerd against a real
43
49
  database, pages in jsdom), migration checks.
44
50
  3. `bun run build`: `dist/server.js`, which publishing uploads.
45
- 4. `teable app push -m "<what changed>"`: commit and save the source to
46
- Teable as a new version.
47
- 5. `teable app publish`: Teable runs the new version's migrations on a copy
48
- of the live data, then on the live data, and makes it live only if both
49
- work. Publish as soon as the checks pass; do not wait to be asked. It
50
- takes the `creator` or `owner` role in the app's space. Then tell the user
51
- what changed.
52
-
53
- `teable app versions` lists published versions, with who published each and
54
- from which commit. `teable app rollback --version <n>` deploys an earlier
51
+ 4. `teable-next push -m "<what changed>"`: commit and save the source to the
52
+ app's repository on Teable.
53
+ 5. `teable-next publish`: the check and the build run again, then Teable
54
+ runs the new version's migrations on a copy of the live data, then on the
55
+ live data, and makes it live only if both work. Publish as soon as the
56
+ checks pass; do not wait to be asked. It takes the `creator` or `owner`
57
+ role in the app's space. Then tell the user what changed, with the URLs
58
+ it prints.
59
+
60
+ `teable-next versions` lists published versions, with who published each and
61
+ from which commit. `teable-next rollback --version <n>` deploys an earlier
55
62
  version's code again, as the next version; it is refused past a migration
56
63
  (roll forward instead), and it leaves the repository as it is, so fix or
57
64
  revert the code before the next publish. There is no local server: tests are