@teable/next-cli 0.0.0-stage → 1.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Teable, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,48 @@
1
- # Temporary Holding Version
1
+ # @teable/next-cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `teable-next`: start, check out, push and publish Teable apps (teable-next)
4
+ from their repositories. A teable-next project is its own app: a Drizzle
5
+ schema plus methods, written with [`@teable/app`](https://www.npmjs.com/package/@teable/app),
6
+ whose code is a git repository on Teable. This is how a person, or their
7
+ agent, gets it, changes it and publishes it.
8
+
9
+ ```sh
10
+ npx @teable/next-cli <command> # or: bunx @teable/next-cli, npm i -g @teable/next-cli
11
+ ```
12
+
13
+ It runs with Node 20 or later, or Bun, and installs nothing else. Publishing
14
+ runs the app's own `bun run check` and `bun run build`, so it needs
15
+ [Bun](https://bun.sh).
16
+
17
+ ## Commands
18
+
19
+ | Command | Does |
20
+ | ---------------------------------- | -------------------------------------------------------------------------------------------------- |
21
+ | `init <dir> --project <projectId>` | Writes a blank app into `<dir>` with `@teable/create-app`, commits it and pushes it to the project |
22
+ | `clone <projectId> [dir]` | Checks out the project's app |
23
+ | `pull` | Fast-forwards the checkout to the app's repository |
24
+ | `push [-m "<what changed>"]` | Commits (with `-m`) and pushes; deploys nothing |
25
+ | `publish` | Runs the app's check and build, then deploys the pushed commit, its pages too, as its next version |
26
+ | `versions` | The published versions, newest first: when, by whom, from which commit |
27
+ | `rollback --version <n>` | Deploys version `n`'s code again, as the next version |
28
+ | `whoami` | Who the token belongs to |
29
+ | `login --token <token>` | Saves the token for later commands |
30
+
31
+ Inside a checkout (a directory holding `teable.json`, or below one) commands
32
+ take the project from `teable.json`; outside one, `versions` and `rollback`
33
+ take `--project <projectId>`. Every command prints one JSON result on stdout
34
+ and exits with 1 when it fails; what the programs it runs print goes to
35
+ stderr. Nothing is ever asked for. `teable-next <command> --help` says more.
36
+
37
+ ## Signing in
38
+
39
+ Commands act as you, with your own token: `--token`, else `TEABLE_TOKEN`,
40
+ else the one `teable-next login --token <token>` saved (in
41
+ `teable-next/config.json` of your config directory, readable by you alone).
42
+ A personal access token works (Teable: Settings, Personal access tokens);
43
+ give it your projects with base read and update. Teable is
44
+ `https://app.teable.ai` unless `--endpoint`, `TEABLE_ENDPOINT` or the login
45
+ says otherwise; `TEABLE_NEXT_ENDPOINT` says where teable-next itself is
46
+ served (its runtime's API and the builder), when that is another address.
47
+
48
+ Publishing takes the creator or owner role in the project's space.
@@ -0,0 +1,22 @@
1
+ import type { Teable } from "./config.js";
2
+ import { type GitCredentials } from "./platform.js";
3
+ export declare const APP_FILE = "teable.json";
4
+ /** The app id `dir`'s teable.json names; undefined without one. */
5
+ export declare function appIdIn(dir: string): string | undefined;
6
+ /** Absent, or an empty directory. */
7
+ export declare function isEmptyOrMissing(dir: string): boolean;
8
+ /** The app around `cwd`: the nearest directory, `cwd` or above, whose teable.json names it. */
9
+ export declare function findApp(cwd: string): {
10
+ root: string;
11
+ appId: string;
12
+ };
13
+ /** The checkout around `cwd`: the app's directory, which is the root of its own git repository. */
14
+ export declare function openCheckout(cwd: string): Promise<{
15
+ root: string;
16
+ appId: string;
17
+ }>;
18
+ /**
19
+ * Credentials for the checkout's repository, with its `teable` remote
20
+ * pointed there: a checkout made with a plain `git clone` has none yet.
21
+ */
22
+ export declare function checkoutCredentials(root: string, appId: string, teable: Teable, ops: "fetch" | "push"): Promise<GitCredentials>;
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};