scribase 0.2.0 → 0.3.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 (56) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/LICENSE +202 -0
  3. package/README.md +36 -15
  4. package/dist/cli/add.d.ts.map +1 -1
  5. package/dist/cli/add.js +2 -10
  6. package/dist/cli/add.js.map +1 -1
  7. package/dist/cli/branch.d.ts +73 -0
  8. package/dist/cli/branch.d.ts.map +1 -0
  9. package/dist/cli/branch.js +351 -0
  10. package/dist/cli/branch.js.map +1 -0
  11. package/dist/cli/capabilities/ota.d.ts.map +1 -1
  12. package/dist/cli/capabilities/ota.js +2 -10
  13. package/dist/cli/capabilities/ota.js.map +1 -1
  14. package/dist/cli/capabilities/railyard/index.d.ts.map +1 -1
  15. package/dist/cli/capabilities/railyard/index.js +2 -10
  16. package/dist/cli/capabilities/railyard/index.js.map +1 -1
  17. package/dist/cli/connect.d.ts +100 -0
  18. package/dist/cli/connect.d.ts.map +1 -0
  19. package/dist/cli/connect.js +338 -0
  20. package/dist/cli/connect.js.map +1 -0
  21. package/dist/cli/doctor.js +1 -1
  22. package/dist/cli/doctor.js.map +1 -1
  23. package/dist/cli/envfile.d.ts +7 -2
  24. package/dist/cli/envfile.d.ts.map +1 -1
  25. package/dist/cli/envfile.js +31 -6
  26. package/dist/cli/envfile.js.map +1 -1
  27. package/dist/cli/environments.d.ts +46 -0
  28. package/dist/cli/environments.d.ts.map +1 -0
  29. package/dist/cli/environments.js +128 -0
  30. package/dist/cli/environments.js.map +1 -0
  31. package/dist/cli/index.d.ts +2 -2
  32. package/dist/cli/index.js +118 -8
  33. package/dist/cli/index.js.map +1 -1
  34. package/dist/cli/init.d.ts +24 -6
  35. package/dist/cli/init.d.ts.map +1 -1
  36. package/dist/cli/init.js +60 -17
  37. package/dist/cli/init.js.map +1 -1
  38. package/dist/cli/mcp.d.ts +18 -0
  39. package/dist/cli/mcp.d.ts.map +1 -0
  40. package/dist/cli/mcp.js +107 -0
  41. package/dist/cli/mcp.js.map +1 -0
  42. package/dist/cli/migrate.d.ts.map +1 -1
  43. package/dist/cli/migrate.js +6 -16
  44. package/dist/cli/migrate.js.map +1 -1
  45. package/dist/cli/project.d.ts +25 -0
  46. package/dist/cli/project.d.ts.map +1 -0
  47. package/dist/cli/project.js +44 -0
  48. package/dist/cli/project.js.map +1 -0
  49. package/dist/cli/sql.d.ts.map +1 -1
  50. package/dist/cli/sql.js +6 -16
  51. package/dist/cli/sql.js.map +1 -1
  52. package/dist/cli/token.d.ts +44 -0
  53. package/dist/cli/token.d.ts.map +1 -0
  54. package/dist/cli/token.js +96 -0
  55. package/dist/cli/token.js.map +1 -0
  56. package/package.json +15 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0 (2026-11-16, not yet published)
4
+
5
+ - The claim line `init` prints, `init --help`, `doctor` and the README now
6
+ match the live sign-up: free for 14 days, no card, and one project stays
7
+ free after that. The old "sign up + card check" wording is gone.
8
+ - `init` prints the UTC time a temporary project is deleted next to its claim
9
+ link (`deleted_at_utc` and `keep` in `--json`).
10
+ - Fixed: an exported `SCRIBASE_ACCESS_TOKEN` no longer overrides the token in
11
+ this folder's env file. `sql`, `migrate`, `add`, `ota`, `env` and `branch`
12
+ act on this folder's project, so the token `init` wrote here wins, then the
13
+ exported one, then `scribase login`. Before, a token exported for another
14
+ project made `npx scribase sql` answer `403 access is denied`. When the two
15
+ differ, one line on stderr says which was used;
16
+ `SCRIBASE_TOKEN_SOURCE=shell|file|login` forces one; `--verbose` (any
17
+ command) always prints the source, never the token. A `401`/`403` now names
18
+ the source of the refused token.
19
+ - New in the npm package: `npx scribase env [list|get]` lists this project's
20
+ environments, and `npx scribase branch [list|create|url|reset|delete]`
21
+ manages database branches (they were only in the full CLI before). Both
22
+ read the project from `.scribase/project.json`, so no ids are typed.
23
+ `branch create|url` write the branch's public URL and publishable key to
24
+ `.scribase/branches/<branch>.env`. `branch reset|delete` ask first (or take
25
+ `--yes`) and refuse `production`.
26
+ - Fixed: `init --temp` no longer fails with `401` when the saved login has
27
+ expired; it creates the temporary project without it.
28
+
29
+ - `npx scribase connect [tool...]` writes the Scribase MCP server into every
30
+ AI coding tool this machine has (Claude Code via `claude mcp add`, Cursor,
31
+ VS Code, Codex, Windsurf, Zed) in one idempotent command. `--dry-run` shows
32
+ what would change; `--tool <id>` (repeatable) configures exactly those
33
+ tools regardless of detection. Never writes a token or secret — every
34
+ client's own MCP OAuth flow runs on first use instead.
35
+
3
36
  ## 0.2.0 (2026-11-11)
4
37
 
5
38
  - `npx scribase init` is temporary-first: with no sign-in it creates a 72-hour
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,7 +1,15 @@
1
1
  # scribase
2
2
 
3
- The typed TypeScript client for the [Scribase](https://scribase.com) control-plane
4
- `/v1` API — the agent-native, flat-priced, Supabase-compatible application cloud.
3
+ Supabase gives you a database and sign-in. Scribase is the whole backend for
4
+ your app: Postgres, Auth, Storage, Realtime, Functions and migrations behind
5
+ one flat price per project, with copy-on-write branching and an agent-native
6
+ CLI/SDK/MCP surface built in from day one.
7
+
8
+ This repo is the `npx scribase` CLI and the typed, fetch-based TypeScript
9
+ client for the [Scribase](https://scribase.com) management `/v1` API, both
10
+ shipped as the single `scribase` npm package. It talks to the same public
11
+ `https://api.scribase.com` endpoint the dashboard and console use — nothing
12
+ in this repo runs a database or a control plane itself.
5
13
 
6
14
  - **Zero runtime dependencies.** A thin, typed wrapper over `fetch`.
7
15
  - **Contract-first core.** `src/types.gen.ts` is emitted from
@@ -38,10 +46,23 @@ A new project's database is empty, so init's first next step creates a small
38
46
  the public key) and the second queries it with `supabase.from('notes')`.
39
47
  `sql` holds back statements that remove data until you add `--confirm`.
40
48
 
49
+ ```sh
50
+ npx scribase env # this project's environments; * marks this folder's
51
+ npx scribase branch create add-comments # a copy-on-write database with its own URL and keys
52
+ npx scribase branch # list branches
53
+ npx scribase branch delete add-comments --yes
54
+ ```
55
+
56
+ These commands act on this folder's project, so the token `init` wrote to the
57
+ env file here wins over an exported `SCRIBASE_ACCESS_TOKEN`, and that over
58
+ `scribase login`. If the two differ, one line says which was used
59
+ (`SCRIBASE_TOKEN_SOURCE=shell` uses the exported one); `--verbose` always
60
+ prints the token's source, never the token.
61
+
41
62
  Init prints "Live in N s" with the measured time. The claim link carries
42
63
  `?ref=<install id>`, a random id stored in `~/.config/scribase/install-id`
43
- (`SCRIBASE_NO_REF=1` sends none). Claiming (sign up + card check) keeps the
44
- same URL and keys.
64
+ (`SCRIBASE_NO_REF=1` sends none). Claiming is a sign-up: free for 14 days, no card, and one
65
+ project stays free after that. The URL and keys stay the same.
45
66
 
46
67
  It detects Next.js, Expo, Vite or plain Node, creates (or reuses) a project,
47
68
  writes the env file with that framework's variable names
@@ -67,13 +88,15 @@ npm install scribase
67
88
  pnpm add scribase
68
89
  ```
69
90
 
70
- Working on this repository directly (contributing to `scribase-js` itself)?
71
- Build it from source instead:
91
+ Working on this repository directly? Clone it and build from source instead:
72
92
 
73
93
  ```bash
74
- npm --prefix packages/scribase-js install
75
- npm --prefix packages/scribase-js run build
76
- npm install file:../path/to/scribase/packages/scribase-js # in your app
94
+ git clone https://github.com/caelum0x/scribase-cli.git
95
+ cd scribase-cli
96
+ npm install
97
+ npm run build
98
+ npx ./dist/cli/index.js --help # or: npm link, then `scribase --help`
99
+ npm install file:../path/to/scribase-cli # in your app, instead of the npm registry
77
100
  ```
78
101
 
79
102
 
@@ -226,12 +249,10 @@ try {
226
249
 
227
250
  ## Regenerating types
228
251
 
229
- `src/types.gen.ts` is generated; never edit it by hand. After the contract
230
- changes:
231
-
232
- ```bash
233
- pnpm generate # tsx scripts/generate.ts → reads ../../api/openapi.yaml
234
- ```
252
+ `src/types.gen.ts` is generated; never edit it by hand. `scripts/generate.ts`
253
+ reads the `api/openapi.yaml` contract from Scribase's main (private) repo, so
254
+ regenerating it is a Scribase-team-only step — it is not needed to build,
255
+ test or use this package, since `types.gen.ts` already ships checked in.
235
256
 
236
257
  ## License
237
258
 
@@ -1 +1 @@
1
- {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/cli/add.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAgBH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IAC1C,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,WAAW,EAAE,MAAM;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,KAAK;I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,CAAC,MAAM,CAAC,CAkBvG;AAYD,0GAA0G;AAC1G,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,KAAK,CAgB9C;AAED,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAE1D"}
package/dist/cli/add.js CHANGED
@@ -14,6 +14,7 @@
14
14
  * terminal, the chat, or the env file: only public values are written, and a
15
15
  * value that looks like a secret is refused by name.
16
16
  */
17
+ import { resolveToken } from './token.js';
17
18
  import { spawn } from 'node:child_process';
18
19
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
19
20
  import { dirname } from 'node:path';
@@ -96,16 +97,7 @@ function readProject(io) {
96
97
  return state;
97
98
  }
98
99
  function findToken(io) {
99
- const fromEnv = io.env.SCRIBASE_ACCESS_TOKEN?.trim();
100
- if (fromEnv)
101
- return fromEnv;
102
- for (const file of ENV_FILES) {
103
- const contents = io.readFile(join(io.cwd, file));
104
- const value = contents ? readEnvValue(contents, 'SCRIBASE_ACCESS_TOKEN')?.trim() : undefined;
105
- if (value)
106
- return value;
107
- }
108
- return io.credentials().token;
100
+ return resolveToken(io)?.token;
109
101
  }
110
102
  function apiUrlFor(io, project) {
111
103
  return (io.env.SCRIBASE_API_URL ?? project?.api_url ?? io.credentials().apiUrl ?? DEFAULT_API_URL).replace(/\/+$/, '');
@@ -1 +1 @@
1
- {"version":3,"file":"add.js","sourceRoot":"","sources":["../../src/cli/add.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAA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D,WAAW,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC;QAC/C,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAChE,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;QACrB,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;QAC7F,WAAW;KACZ,CAAC;AACJ,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,UAAU,CAAC,IAAc;IACvC,OAAO,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACjG,CAAC"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * `npx scribase branch`: hosted database branches of the project this folder
3
+ * is connected to. A branch is a copy-on-write database with its own URL and
4
+ * keys, for one task, agent or pull request.
5
+ *
6
+ * npx scribase branch [list]
7
+ * npx scribase branch create [<name>] [--from <branch>] [--from-time <RFC 3339>]
8
+ * [--data snapshot|schema_only|sanitized] [--ttl 24h|7d]
9
+ * npx scribase branch url <branch>
10
+ * npx scribase branch reset <branch> [--yes]
11
+ * npx scribase branch delete <branch> [--yes]
12
+ *
13
+ * The project comes from `.scribase/project.json`; `<org> <project>` before
14
+ * the branch name (the full CLI's form) targets another one. Each verb is one
15
+ * call to the tool a coding agent uses (`branches.list|create|reset|delete`,
16
+ * `keys.get`) on the hosted MCP server, so the terminal and the agent follow
17
+ * the same rules. Reset and delete ask first (or take `--yes`).
18
+ *
19
+ * After create, reset or url the branch's public URL and publishable key are
20
+ * written to `.scribase/branches/<branch>.env` (never a secret key), which a
21
+ * deploy of the same git branch reads. Delete removes the file.
22
+ */
23
+ import type { ProjectIo } from './project.js';
24
+ export declare const BRANCH_HELP = "Usage: npx scribase branch [list] [--json] [--verbose]\n npx scribase branch create [<name>] [--from <branch>] [--from-time <time>]\n [--data snapshot|schema_only|sanitized] [--ttl 24h|7d] [--json]\n npx scribase branch url <branch> [--json]\n npx scribase branch reset <branch> [--yes] [--json]\n npx scribase branch delete <branch> [--yes] [--json]\n\nDatabase branches of the project this folder is connected to (run\n`npx scribase init` here first). A branch is a copy-on-write database with\nits own URL and keys. `create` prints the branch's env lines once it is live\nand writes them to .scribase/branches/<branch>.env (public values only).\n`reset` throws away the branch's changes; `delete` removes it; both ask\nfirst, or take --yes. Production is protected. To target another project,\nput `<org> <project>` before the branch name. A temporary project branches\nits schema only; claim it to branch with data.\n";
25
+ declare const VERBS: readonly ["list", "create", "url", "reset", "delete"];
26
+ type Verb = (typeof VERBS)[number];
27
+ export interface BranchOptions {
28
+ verb: Verb;
29
+ organization?: string;
30
+ project?: string;
31
+ branch?: string;
32
+ from?: string;
33
+ fromTime?: string;
34
+ data?: 'snapshot' | 'schema_only' | 'sanitized';
35
+ ttlHours?: number;
36
+ yes: boolean;
37
+ json: boolean;
38
+ }
39
+ export interface BranchIo extends ProjectIo {
40
+ writeFile: (path: string, contents: string) => void;
41
+ removeFile: (path: string) => boolean;
42
+ exists: (path: string) => boolean;
43
+ /** Asks a yes/no question on a terminal; `null` when there is no terminal. */
44
+ confirm: (prompt: string) => Promise<boolean | null>;
45
+ log: (line: string) => void;
46
+ }
47
+ export interface BranchResult {
48
+ ok: true;
49
+ action: Verb;
50
+ organization_id: string;
51
+ project_id: string;
52
+ payload: Record<string, unknown>;
53
+ /** The settings file written or removed, relative to the folder. */
54
+ settings_file?: string;
55
+ }
56
+ /** `24h`, `7d` or a bare number of hours, 1 to 720. */
57
+ export declare function ttlHours(value: string): number;
58
+ export declare function parseBranchArgs(argv: string[]): BranchOptions;
59
+ /** The file name part for a branch: lowercase, other runs to `-`, trimmed. */
60
+ export declare function branchSlug(branch: string): string;
61
+ /** A publishable key or an `anon` JWT; anything else is treated as secret. */
62
+ export declare function isPublicKey(key: string): boolean;
63
+ /** The settings file for `branch` from the tool's `env` lines, or the reason there is none. */
64
+ export declare function renderBranchEnv(branch: string, answerEnv: string, appEnv: string): {
65
+ contents: string;
66
+ } | {
67
+ reason: string;
68
+ };
69
+ export declare function runBranch(options: BranchOptions, io: BranchIo): Promise<BranchResult>;
70
+ /** The human-readable output of {@link runBranch}. */
71
+ export declare function formatBranch(result: BranchResult): string;
72
+ export {};
73
+ //# sourceMappingURL=branch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branch.d.ts","sourceRoot":"","sources":["../../src/cli/branch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,eAAO,MAAM,WAAW,29BAevB,CAAC;AAIF,QAAA,MAAM,KAAK,uDAAwD,CAAC;AACpE,KAAK,IAAI,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,IAAI,CAAC;IACX,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,UAAU,GAAG,aAAa,GAAG,WAAW,CAAC;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,OAAO,CAA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