@columnus/api-cli 0.1.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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +71 -0
  3. package/dist/cli.js +8711 -0
  4. package/package.json +42 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Movement Overdrive / Columnus
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 ADDED
@@ -0,0 +1,71 @@
1
+ # `@columnus/api-cli`
2
+
3
+ `columnus-api pull` and `columnus-api dev` — live-sync Read API codegen for Columnus consumer apps.
4
+
5
+ Install alongside your Vite (or other) app, point at a Columnus deployment + API token, and generate typed Convex client hooks when Studio schema changes.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pnpm add -D @columnus/api-cli
11
+ # or: npm i -D @columnus/api-cli
12
+ ```
13
+
14
+ Peer dependency: [`convex`](https://www.npmjs.com/package/convex) (already required for `npx convex codegen`).
15
+
16
+ ## Setup
17
+
18
+ In the consumer app `.env.local`:
19
+
20
+ | Variable | Purpose |
21
+ | --- | --- |
22
+ | `VITE_CONVEX_URL` or `CONVEX_URL` | Columnus / Convex deployment URL |
23
+ | `VITE_COLUMNUS_API_TOKEN` or `COLUMNUS_API_TOKEN` | `col_…` token from Studio **API** profiles |
24
+
25
+ Create a profile and token under **`/api`** in Studio, then **Save & deploy** so generated read queries exist.
26
+
27
+ ## Commands
28
+
29
+ ### `columnus-api pull`
30
+
31
+ One-shot introspect + write generated files (`convex/schema.ts`, `src/generated/*`), then run `convex codegen` (unless `--skip-codegen`).
32
+
33
+ ```bash
34
+ columnus-api pull
35
+ # optional: --token col_… --url https://….convex.cloud --target .
36
+ ```
37
+
38
+ ### `columnus-api dev`
39
+
40
+ Subscribe to `api.columnus.read.introspect`. When Save & deploy finishes (`deployStatus` is `deployed` or `idle`) and `manifestHash` changes, re-runs pull automatically. Does not start Vite — run them in parallel.
41
+
42
+ ```json
43
+ {
44
+ "scripts": {
45
+ "dev:columnus": "columnus-api dev",
46
+ "dev": "npm-run-all --parallel dev:columnus dev:vite",
47
+ "pull": "columnus-api pull"
48
+ }
49
+ }
50
+ ```
51
+
52
+ While deploy is in progress or failed, the watcher waits and keeps your last good pull.
53
+
54
+ ## Flags
55
+
56
+ | Flag | Description |
57
+ | --- | --- |
58
+ | `--token` | `col_…` secret (or env) |
59
+ | `--target` | Consumer app root (default: `.`) |
60
+ | `--url` | Deployment URL (defaults to `VITE_CONVEX_URL` / `CONVEX_URL`) |
61
+ | `--skip-codegen` | `pull` only — skip `convex codegen` |
62
+ | `--require-codegen` | `pull` fails when codegen fails |
63
+
64
+ ## Docs
65
+
66
+ - [Read API guide](https://github.com/movement-overdrive/convex-studio/blob/main/content/docs/guide/api-read.md) (in-app Docs → Guide)
67
+ - Example app: [`examples/api-read-site`](https://github.com/movement-overdrive/convex-studio/tree/main/examples/api-read-site)
68
+
69
+ ## License
70
+
71
+ MIT