@notis_ai/cli 0.2.1 → 0.2.3
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 +106 -170
- package/config/notis_app_boundary_rules.json +50 -0
- package/dist/scaffolds/notis-database/app/globals.css +44 -0
- package/dist/scaffolds/notis-database/app/layout.tsx +6 -0
- package/dist/scaffolds/notis-database/app/page.tsx +1091 -0
- package/dist/scaffolds/notis-database/components/ui/badge.tsx +28 -0
- package/dist/scaffolds/notis-database/components/ui/button.tsx +53 -0
- package/dist/scaffolds/notis-database/components/ui/card.tsx +56 -0
- package/dist/scaffolds/notis-database/components/ui/table.tsx +120 -0
- package/dist/scaffolds/notis-database/components.json +20 -0
- package/dist/scaffolds/notis-database/index.html +12 -0
- package/dist/scaffolds/notis-database/lib/types.ts +134 -0
- package/dist/scaffolds/notis-database/lib/utils.ts +6 -0
- package/dist/scaffolds/notis-database/metadata/cover.png +0 -0
- package/dist/scaffolds/notis-database/metadata/screenshot-1.png +0 -0
- package/dist/scaffolds/notis-database/metadata/screenshot-2.png +0 -0
- package/dist/scaffolds/notis-database/metadata/screenshot-3.png +0 -0
- package/dist/scaffolds/notis-database/notis.config.ts +27 -0
- package/dist/scaffolds/notis-database/package.json +31 -0
- package/dist/scaffolds/notis-database/postcss.config.mjs +8 -0
- package/dist/scaffolds/notis-database/src/dev-main.tsx +23 -0
- package/dist/scaffolds/notis-database/src/mock-runtime.ts +557 -0
- package/dist/scaffolds/notis-database/tailwind.config.ts +59 -0
- package/dist/scaffolds/notis-database/tsconfig.json +23 -0
- package/dist/scaffolds/notis-database/vite.config.ts +22 -0
- package/dist/scaffolds/notis-notes/app/globals.css +3 -0
- package/dist/scaffolds/notis-notes/app/layout.tsx +6 -0
- package/dist/scaffolds/notis-notes/app/page.tsx +2168 -0
- package/dist/scaffolds/notis-notes/components/ui/badge.tsx +28 -0
- package/dist/scaffolds/notis-notes/components/ui/button.tsx +53 -0
- package/dist/scaffolds/notis-notes/components/ui/card.tsx +56 -0
- package/dist/scaffolds/notis-notes/components.json +20 -0
- package/dist/scaffolds/notis-notes/lib/utils.ts +6 -0
- package/dist/scaffolds/notis-notes/metadata/cover.png +0 -0
- package/dist/scaffolds/notis-notes/metadata/screenshot-1.png +0 -0
- package/dist/scaffolds/notis-notes/metadata/screenshot-2.png +0 -0
- package/dist/scaffolds/notis-notes/metadata/screenshot-3.png +0 -0
- package/dist/scaffolds/notis-notes/notis.config.ts +36 -0
- package/dist/scaffolds/notis-notes/package.json +31 -0
- package/dist/scaffolds/notis-notes/postcss.config.mjs +8 -0
- package/dist/scaffolds/notis-notes/tailwind.config.ts +58 -0
- package/dist/scaffolds/notis-notes/tsconfig.json +23 -0
- package/dist/scaffolds/notis-notes/vite.config.ts +10 -0
- package/dist/scaffolds/notis-random/README.md +33 -0
- package/dist/scaffolds/notis-random/app/globals.css +11 -0
- package/dist/scaffolds/notis-random/app/history/page.tsx +66 -0
- package/dist/scaffolds/notis-random/app/layout.tsx +7 -0
- package/dist/scaffolds/notis-random/app/page.tsx +222 -0
- package/dist/scaffolds/notis-random/index.html +12 -0
- package/dist/scaffolds/notis-random/lib/notis-tools.ts +109 -0
- package/dist/scaffolds/notis-random/lib/rng.ts +42 -0
- package/dist/scaffolds/notis-random/lib/roll-record.ts +102 -0
- package/dist/scaffolds/notis-random/lib/utils.ts +25 -0
- package/dist/scaffolds/notis-random/metadata/cover.png +0 -0
- package/dist/scaffolds/notis-random/metadata/screenshot-1.png +0 -0
- package/dist/scaffolds/notis-random/metadata/screenshot-2.png +0 -0
- package/dist/scaffolds/notis-random/metadata/screenshot-3.png +0 -0
- package/dist/scaffolds/notis-random/notis.config.ts +43 -0
- package/dist/scaffolds/notis-random/package.json +32 -0
- package/dist/scaffolds/notis-random/postcss.config.mjs +6 -0
- package/dist/scaffolds/notis-random/src/dev-main.tsx +70 -0
- package/dist/scaffolds/notis-random/src/mock-runtime.ts +128 -0
- package/dist/scaffolds/notis-random/tailwind.config.ts +43 -0
- package/dist/scaffolds/notis-random/tsconfig.json +23 -0
- package/dist/scaffolds/notis-random/vite.config.ts +11 -0
- package/dist/scaffolds.json +36 -0
- package/package.json +8 -3
- package/skills/notis-apps/SKILL.md +162 -0
- package/skills/notis-apps/cli.md +208 -0
- package/skills/notis-cli/SKILL.md +260 -0
- package/skills/notis-query/cli.md +39 -0
- package/src/cli.js +31 -3
- package/src/command-specs/apps.js +248 -56
- package/src/command-specs/helpers.js +72 -104
- package/src/command-specs/index.js +0 -6
- package/src/command-specs/meta.js +14 -13
- package/src/command-specs/tools.js +196 -115
- package/src/runtime/app-boundary-validator.js +65 -14
- package/src/runtime/app-dev-server.js +32 -4
- package/src/runtime/app-platform.js +404 -24
- package/src/runtime/profiles.js +12 -6
- package/src/runtime/transport.js +124 -39
- package/template/.harness/index.html.tmpl +1 -50
- package/template/app/page.tsx +41 -6
- package/template/metadata/cover.png +0 -0
- package/template/metadata/screenshot-1.png +0 -0
- package/template/metadata/screenshot-2.png +0 -0
- package/template/metadata/screenshot-3.png +0 -0
- package/template/notis.config.ts +10 -6
- package/template/package.json +2 -2
- package/template/packages/{notis-sdk → sdk}/package.json +6 -0
- package/template/packages/{notis-sdk → sdk}/src/components/MultiSelectActionBar.tsx +2 -1
- package/template/packages/{notis-sdk → sdk}/src/components/MultiSelectCheckbox.tsx +2 -2
- package/template/packages/{notis-sdk → sdk}/src/components/MultiSelectDragOverlay.tsx +2 -2
- package/template/packages/{notis-sdk → sdk}/src/config.ts +1 -1
- package/template/packages/{notis-sdk → sdk}/src/hooks/useDatabase.ts +1 -13
- package/template/packages/{notis-sdk → sdk}/src/hooks/useMultiSelect.ts +4 -3
- package/template/packages/{notis-sdk → sdk}/src/hooks/useNotis.ts +4 -3
- package/template/packages/{notis-sdk → sdk}/src/hooks/useNotisNavigation.ts +3 -3
- package/template/packages/{notis-sdk → sdk}/src/hooks/useTool.ts +22 -7
- package/template/packages/{notis-sdk → sdk}/src/hooks/useUpsertDocument.ts +0 -8
- package/template/packages/{notis-sdk → sdk}/src/index.ts +2 -15
- package/template/packages/{notis-sdk → sdk}/src/provider.tsx +1 -1
- package/template/packages/{notis-sdk → sdk}/src/runtime.ts +5 -26
- package/src/command-specs/auth.js +0 -178
- package/src/command-specs/db.js +0 -163
- package/template/packages/notis-sdk/src/helpers.ts +0 -131
- package/template/packages/notis-sdk/src/hooks/useAppState.ts +0 -50
- package/template/packages/notis-sdk/src/hooks/useCollectionItem.ts +0 -58
- package/template/packages/notis-sdk/src/hooks/useDocument.ts +0 -61
- /package/template/packages/{notis-sdk → sdk}/src/hooks/useBackend.ts +0 -0
- /package/template/packages/{notis-sdk → sdk}/src/hooks/useTools.ts +0 -0
- /package/template/packages/{notis-sdk → sdk}/src/hooks/useTopBarSearch.ts +0 -0
- /package/template/packages/{notis-sdk → sdk}/src/styles.css +0 -0
- /package/template/packages/{notis-sdk → sdk}/src/ui.ts +0 -0
- /package/template/packages/{notis-sdk → sdk}/src/vite.ts +0 -0
- /package/template/packages/{notis-sdk → sdk}/tsconfig.json +0 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: notis-cli
|
|
3
|
+
description: Use when agents should work through the Notis CLI, especially to develop Notis apps locally or to access Notis, Composio, or MCP tools they do not currently have loaded directly.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Notis CLI Skill
|
|
7
|
+
|
|
8
|
+
Use this skill when the user wants work done through the Notis CLI.
|
|
9
|
+
|
|
10
|
+
This skill covers two main CLI workflows:
|
|
11
|
+
|
|
12
|
+
1. Developing Notis apps locally.
|
|
13
|
+
2. Accessing Notis, Composio, and MCP tools through the CLI.
|
|
14
|
+
|
|
15
|
+
## When to use this skill
|
|
16
|
+
|
|
17
|
+
Activate this skill when:
|
|
18
|
+
|
|
19
|
+
- the user wants to init, develop, build, verify, link, pull, or deploy a Notis app through the CLI
|
|
20
|
+
- the current agent does not have the tool it needs in its direct tool list
|
|
21
|
+
- the user wants direct MCP access through Notis
|
|
22
|
+
- the user wants to use an integration-backed capability through Notis rather than a first-class local tool
|
|
23
|
+
- the task mentions the `notis` CLI directly
|
|
24
|
+
|
|
25
|
+
Use the registry-resolved published npm package everywhere:
|
|
26
|
+
|
|
27
|
+
- `npx --package @notis_ai/cli@latest -- notis ...`
|
|
28
|
+
|
|
29
|
+
Always use this NPX command form so the agent runs the current published CLI. In hosted shells, the CLI is pre-authenticated through `NOTIS_JWT`; locally, Notis Desktop keeps the CLI auth profile current for NPX invocations.
|
|
30
|
+
|
|
31
|
+
Notis Desktop keeps the CLI auth profile current for NPX runs. This `notis-cli` skill is delivered through normal Notis skill sync for the signed-in user, alongside other curated skills.
|
|
32
|
+
|
|
33
|
+
## Critical rule for missing tools
|
|
34
|
+
|
|
35
|
+
If the tool you need is not already available in your current tool surface, do not stop and do not assume the task is blocked.
|
|
36
|
+
|
|
37
|
+
Use the Notis CLI as the fallback access layer.
|
|
38
|
+
|
|
39
|
+
This is especially important when:
|
|
40
|
+
|
|
41
|
+
- you need direct MCP tools
|
|
42
|
+
- you need a Composio-backed integration tool
|
|
43
|
+
- you need a Notis tool that is not exposed as a first-class command in your current environment
|
|
44
|
+
- you need to discover the canonical tool name before execution
|
|
45
|
+
|
|
46
|
+
Treat the Notis CLI the same way you would treat a Composio-style tool router flow: discover what is available first, then execute the right tool through the CLI.
|
|
47
|
+
|
|
48
|
+
## Section 1: Developing Notis Apps
|
|
49
|
+
|
|
50
|
+
Use this section when the goal is to create or update a Notis app from a local workspace.
|
|
51
|
+
|
|
52
|
+
Notis apps are Vite + React projects using `@notis/sdk`. The workflow is init or pull, dev, build, verify, create/link, deploy.
|
|
53
|
+
|
|
54
|
+
Important: `deploy` means updating the installed app artifact for the current user or team. To list an app in the public Notis App Store, the owner opens the app details page in the Notis Portal, sets visibility to Team or Public, then uses Publish/Update. The CLI does not publish to the store; the backend opens the registry PR using a service token.
|
|
55
|
+
|
|
56
|
+
### App development workflow
|
|
57
|
+
|
|
58
|
+
1. Scaffold a new app:
|
|
59
|
+
- `npx --package @notis_ai/cli@latest -- notis apps init`
|
|
60
|
+
2. Or pull an existing app's source to edit it locally (the project is linked automatically):
|
|
61
|
+
- `npx --package @notis_ai/cli@latest -- notis apps pull <app-id>`
|
|
62
|
+
- then run `npm install`, `npx --package @notis_ai/cli@latest -- notis apps dev`, edit, build, and deploy
|
|
63
|
+
3. Develop locally with live reload:
|
|
64
|
+
- `npx --package @notis_ai/cli@latest -- notis apps dev`
|
|
65
|
+
4. Build the production artifact:
|
|
66
|
+
- `npx --package @notis_ai/cli@latest -- notis apps build`
|
|
67
|
+
5. Verify the built artifact headlessly:
|
|
68
|
+
- `npx --package @notis_ai/cli@latest -- notis apps verify`
|
|
69
|
+
6. For a brand-new app, create the remote app and link the project in one step:
|
|
70
|
+
- `npx --package @notis_ai/cli@latest -- notis apps create "My App" .`
|
|
71
|
+
7. Or link the project to an existing remote app (skip if you used `pull` or `create`):
|
|
72
|
+
- `npx --package @notis_ai/cli@latest -- notis apps link`
|
|
73
|
+
8. Deploy the artifact to Notis:
|
|
74
|
+
- `npx --package @notis_ai/cli@latest -- notis apps deploy`
|
|
75
|
+
9. Check project health:
|
|
76
|
+
- `npx --package @notis_ai/cli@latest -- notis apps doctor`
|
|
77
|
+
|
|
78
|
+
### App development rules
|
|
79
|
+
|
|
80
|
+
- Always `build` before `deploy`; run `verify` before deploy when validating an app change.
|
|
81
|
+
- Prefer `npx --package @notis_ai/cli@latest -- notis apps create "Name" .` for the first deploy of a new app.
|
|
82
|
+
- Link before `deploy`, or pass `--app-id <id>` when intentionally deploying without writing local link state.
|
|
83
|
+
- Use `npx --package @notis_ai/cli@latest -- notis apps doctor` to diagnose configuration or dependency issues.
|
|
84
|
+
- Use `npx --package @notis_ai/cli@latest -- notis apps list` to discover existing app IDs before linking.
|
|
85
|
+
- For App Store publishing, do not use the CLI. The user opens the app details page in the Notis Portal, sets visibility to Team or Public, then uses Publish/Update. The backend opens the registry PR on their behalf using a service token. Do not invent any CLI store-publish command.
|
|
86
|
+
|
|
87
|
+
### App development command reference
|
|
88
|
+
|
|
89
|
+
- `npx --package @notis_ai/cli@latest -- notis apps list` -- list accessible apps
|
|
90
|
+
- `npx --package @notis_ai/cli@latest -- notis apps init` -- scaffold a new Vite + React + `@notis/sdk` project
|
|
91
|
+
- `npx --package @notis_ai/cli@latest -- notis apps pull <app-id> [dir] [--force] [--version <n>]` -- download the persisted source snapshot for an installed app and link the local directory to that app/version; legacy apps must be redeployed once with the current CLI before they can be pulled
|
|
92
|
+
- `npx --package @notis_ai/cli@latest -- notis apps dev` -- discover local apps, register desktop-local dev sessions, and load them in the Electron Portal Local development sidebar group
|
|
93
|
+
- `npx --package @notis_ai/cli@latest -- notis apps build` -- compile the production artifact
|
|
94
|
+
- `npx --package @notis_ai/cli@latest -- notis apps verify` -- headless render-smoke packaged routes before deploy
|
|
95
|
+
- `npx --package @notis_ai/cli@latest -- notis apps create` -- create a fresh remote app and optionally link the local project
|
|
96
|
+
- `npx --package @notis_ai/cli@latest -- notis apps link` -- associate the project with a remote app
|
|
97
|
+
- `npx --package @notis_ai/cli@latest -- notis apps deploy` -- upload the artifact and editable source snapshot to the linked installed app in Notis
|
|
98
|
+
- `npx --package @notis_ai/cli@latest -- notis apps deploy --direct` -- deploy directly to Supabase storage, bypassing the backend server (auto-fallback when server is down)
|
|
99
|
+
- `npx --package @notis_ai/cli@latest -- notis apps doctor` -- run project diagnostics
|
|
100
|
+
|
|
101
|
+
App Store publishing is portal-only — there is no CLI publish command.
|
|
102
|
+
|
|
103
|
+
If the task is specifically about app structure, runtime behavior, or database/view packaging, pair this skill with the `notis-apps` skill. Use `notis-cli` for the command workflow and `notis-apps` for the product/runtime contract.
|
|
104
|
+
|
|
105
|
+
## IMPORTANT: When NOT to use tool access for app development
|
|
106
|
+
|
|
107
|
+
When building or deploying a Notis app, do NOT use `npx --package @notis_ai/cli@latest -- notis tools exec` for any of these operations:
|
|
108
|
+
|
|
109
|
+
- Creating databases -- declare them in `notis.config.ts` instead
|
|
110
|
+
- Loading or saving app files -- use `npx --package @notis_ai/cli@latest -- notis apps build` and `npx --package @notis_ai/cli@latest -- notis apps deploy`
|
|
111
|
+
- Linting app files -- use `npx --package @notis_ai/cli@latest -- notis apps build` which validates automatically
|
|
112
|
+
- Managing app routes -- write standard Vite + React pages in `app/`, not raw JS files
|
|
113
|
+
|
|
114
|
+
The only `npx --package @notis_ai/cli@latest -- notis tools exec` calls that are valid during app development are for testing the app's runtime behavior after deployment (e.g., querying a database to verify data was created).
|
|
115
|
+
|
|
116
|
+
## Section 2: Accessing Tools Through the Notis CLI
|
|
117
|
+
|
|
118
|
+
Use this section when the current agent does not already have the right tool and needs to reach tools through Notis.
|
|
119
|
+
|
|
120
|
+
This is the main escape hatch for:
|
|
121
|
+
|
|
122
|
+
- direct MCP access
|
|
123
|
+
- Composio-backed integrations
|
|
124
|
+
- native Notis tools that are available through the generic CLI tool bridge
|
|
125
|
+
- any task where you need to discover the canonical tool name and schema before execution
|
|
126
|
+
|
|
127
|
+
### Tool access workflow
|
|
128
|
+
|
|
129
|
+
1. List available toolkit namespaces:
|
|
130
|
+
- `npx --package @notis_ai/cli@latest -- notis tools toolkits`
|
|
131
|
+
2. Search for the capability you need using natural language:
|
|
132
|
+
- `npx --package @notis_ai/cli@latest -- notis tools search "<query>"`
|
|
133
|
+
- optionally add known field hints with `--known-fields "<key:value>"`
|
|
134
|
+
3. If needed, inspect the exact tool and parameter schema:
|
|
135
|
+
- `npx --package @notis_ai/cli@latest -- notis tools describe <tool-name>`
|
|
136
|
+
- `npx --package @notis_ai/cli@latest -- notis tools exec <tool-name> --get-schema`
|
|
137
|
+
4. Validate arguments before execution when the tool is mutating or the schema is non-trivial:
|
|
138
|
+
- `npx --package @notis_ai/cli@latest -- notis tools exec <tool-name> --dry-run --arguments '<json>'`
|
|
139
|
+
5. Execute the tool:
|
|
140
|
+
- `npx --package @notis_ai/cli@latest -- notis tools exec <tool-name> --arguments '<json>'`
|
|
141
|
+
6. If multiple independent calls are needed, use:
|
|
142
|
+
- `npx --package @notis_ai/cli@latest -- notis tools exec-parallel '<json-array>'`
|
|
143
|
+
7. If the toolkit is not connected yet, generate the connection URL:
|
|
144
|
+
- `npx --package @notis_ai/cli@latest -- notis tools link <toolkit>`
|
|
145
|
+
|
|
146
|
+
### Tool access rules
|
|
147
|
+
|
|
148
|
+
- Never guess tool names. Discover them with `npx --package @notis_ai/cli@latest -- notis tools search` first.
|
|
149
|
+
- Prefer first-class CLI commands when they exist, but use `npx --package @notis_ai/cli@latest -- notis tools ...` whenever the capability is not covered by a dedicated command.
|
|
150
|
+
- When you know the tool name but not the argument shape, use `npx --package @notis_ai/cli@latest -- notis tools describe` or `--get-schema` before execution.
|
|
151
|
+
- Use `--dry-run` before mutating calls when you want schema validation without execution.
|
|
152
|
+
- If a toolkit is missing, use `npx --package @notis_ai/cli@latest -- notis tools link <toolkit>` to start the connection flow.
|
|
153
|
+
|
|
154
|
+
### Toolkit mental model
|
|
155
|
+
|
|
156
|
+
Typical toolkit namespaces include:
|
|
157
|
+
|
|
158
|
+
- `notis` for native Notis tools
|
|
159
|
+
- `composio-*` for Composio-backed integrations
|
|
160
|
+
- `mcp-*` for MCP-backed tools
|
|
161
|
+
|
|
162
|
+
The pattern is:
|
|
163
|
+
|
|
164
|
+
1. discover toolkits
|
|
165
|
+
2. search tools
|
|
166
|
+
3. inspect schema if needed
|
|
167
|
+
4. execute the canonical tool
|
|
168
|
+
|
|
169
|
+
### Tool access examples
|
|
170
|
+
|
|
171
|
+
Find a tool:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
npx --package @notis_ai/cli@latest -- notis tools toolkits
|
|
175
|
+
npx --package @notis_ai/cli@latest -- notis tools search "list today's calendar events"
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Inspect a tool before execution:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
npx --package @notis_ai/cli@latest -- notis tools describe composio-googlecalendar-list_events
|
|
182
|
+
npx --package @notis_ai/cli@latest -- notis tools exec composio-googlecalendar-list_events --get-schema
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Dry-run a tool call:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_GET_DATABASE --dry-run --arguments '{"database_slug":"tasks"}'
|
|
189
|
+
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_QUERY --dry-run --arguments '{"database_id":"tasks-db-id","query":{"page_size":10}}'
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Execute a tool call:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_GET_DATABASE --arguments '{"database_slug":"tasks"}'
|
|
196
|
+
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_QUERY --arguments '{"database_id":"tasks-db-id","query":{"page_size":10}}'
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Connect a missing toolkit:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
npx --package @notis_ai/cli@latest -- notis tools link github
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Native database access
|
|
206
|
+
|
|
207
|
+
Native Notis databases are accessed through the generic tool workflow, not a first-class database command group. Use these canonical tool names:
|
|
208
|
+
|
|
209
|
+
- `LOCAL_NOTIS_DATABASE_LIST_DATABASES` -- list databases accessible to the current profile
|
|
210
|
+
- `LOCAL_NOTIS_DATABASE_GET_DATABASE` -- inspect read-only metadata and schema detail
|
|
211
|
+
- `LOCAL_NOTIS_DATABASE_QUERY` -- query documents from a database
|
|
212
|
+
- `LOCAL_NOTIS_DATABASE_UPSERT_DATABASE` -- create or update a database schema
|
|
213
|
+
|
|
214
|
+
Example workflow before building an app:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
npx --package @notis_ai/cli@latest -- notis tools search "list Notis databases"
|
|
218
|
+
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_LIST_DATABASES --arguments '{}'
|
|
219
|
+
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_GET_DATABASE --get-schema
|
|
220
|
+
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_GET_DATABASE --arguments '{"database_slug":"social_media_calendar"}'
|
|
221
|
+
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_QUERY --arguments '{"database_id":"social-media-calendar-db-id","query":{"page_size":1}}'
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
When `LOCAL_NOTIS_DATABASE_LIST_DATABASES` or `LOCAL_NOTIS_DATABASE_GET_DATABASE` returns a database ID, prefer `database_id` for `LOCAL_NOTIS_DATABASE_QUERY`; `database_slug` remains supported as a fallback.
|
|
225
|
+
|
|
226
|
+
## Supporting commands
|
|
227
|
+
|
|
228
|
+
- `npx --package @notis_ai/cli@latest -- notis doctor` — verify CLI config, auth, and API reachability before relying on the CLI
|
|
229
|
+
- `npx --package @notis_ai/cli@latest -- notis describe <command...>` — get the exact command contract for first-class CLI commands
|
|
230
|
+
|
|
231
|
+
## Summary
|
|
232
|
+
|
|
233
|
+
Use `notis-cli` for two things:
|
|
234
|
+
|
|
235
|
+
1. local app development through `npx --package @notis_ai/cli@latest -- notis apps ...`
|
|
236
|
+
2. tool discovery and execution through `npx --package @notis_ai/cli@latest -- notis tools ...`
|
|
237
|
+
|
|
238
|
+
Most importantly: if you do not currently have the tool you need, especially for direct MCP or integration work, use the Notis CLI instead of treating the task as blocked.
|
|
239
|
+
|
|
240
|
+
## Troubleshooting
|
|
241
|
+
|
|
242
|
+
### Deploy fails with "network_error" or "fetch failed"
|
|
243
|
+
|
|
244
|
+
The backend server at `http://localhost:3001` is not running. Solutions:
|
|
245
|
+
|
|
246
|
+
1. Use `--direct` flag: `npx --package @notis_ai/cli@latest -- notis apps deploy --direct` uploads to Supabase storage directly
|
|
247
|
+
2. Start the backend server: `cd server && python3 main.py`
|
|
248
|
+
3. Check the API base: `npx --package @notis_ai/cli@latest -- notis doctor` shows the configured `api_base`
|
|
249
|
+
|
|
250
|
+
### `npx --package @notis_ai/cli@latest -- notis doctor` shows health/tool_roundtrip errors
|
|
251
|
+
|
|
252
|
+
The CLI health check pings the backend server. If it's not running, these checks fail. App development commands that are `backend_call: local` (`init`, `build`, `verify`, `link`, `doctor`) work without the server. `dev`, `pull`, `create`, `list`, and normal `deploy` need the backend; `deploy --direct` can bypass it when Supabase credentials are available.
|
|
253
|
+
|
|
254
|
+
### Stale bundle in the portal after deploy
|
|
255
|
+
|
|
256
|
+
The portal caches app bundles by version. If you re-deploy to the same version, the portal may serve the cached old bundle. Solutions:
|
|
257
|
+
|
|
258
|
+
1. Hard refresh the portal page (Cmd+Shift+R)
|
|
259
|
+
2. Open browser DevTools > Application > Storage > Clear site data
|
|
260
|
+
3. The bundle cache key includes version number -- incrementing the version forces a fresh load
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Notis CLI — Database Tool Workflow
|
|
2
|
+
|
|
3
|
+
Use the generic `notis tools` workflow through NPX for native Notis Database operations from the terminal. The dedicated database command group has been removed.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
Install and sign into Notis Desktop to keep the CLI profile current. Run the CLI through NPX, for example `npx --package @notis_ai/cli@latest -- notis tools search "list Notis databases"`.
|
|
8
|
+
|
|
9
|
+
For CI, hosted agents, or internal scripts, pass a non-persisted token with `NOTIS_JWT=<token>` and use `--api-base <server-url>` when targeting a non-default server.
|
|
10
|
+
|
|
11
|
+
## Canonical database tools
|
|
12
|
+
|
|
13
|
+
- `LOCAL_NOTIS_DATABASE_LIST_DATABASES` — list native databases.
|
|
14
|
+
- `LOCAL_NOTIS_DATABASE_GET_DATABASE` — inspect one database schema.
|
|
15
|
+
- `LOCAL_NOTIS_DATABASE_QUERY` — query native database documents.
|
|
16
|
+
- `LOCAL_NOTIS_DATABASE_UPSERT_DATABASE` — create or update database schema.
|
|
17
|
+
|
|
18
|
+
## Workflow
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx --package @notis_ai/cli@latest -- notis tools search "list Notis databases"
|
|
22
|
+
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_LIST_DATABASES --arguments '{}'
|
|
23
|
+
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_GET_DATABASE --get-schema
|
|
24
|
+
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_GET_DATABASE --arguments '{"database_slug":"tasks"}'
|
|
25
|
+
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_QUERY --dry-run --arguments '{"database_slug":"tasks","query":{"page_size":10}}'
|
|
26
|
+
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_QUERY --arguments '{"database_slug":"tasks","query":{"page_size":10}}'
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Supporting command
|
|
30
|
+
|
|
31
|
+
### `npx --package @notis_ai/cli@latest -- notis doctor`
|
|
32
|
+
|
|
33
|
+
Run a quick CLI health check for config, auth, and API reachability.
|
|
34
|
+
|
|
35
|
+
When to use: Use this before relying on the CLI in automation or after changing environments.
|
|
36
|
+
|
|
37
|
+
Examples:
|
|
38
|
+
- `npx --package @notis_ai/cli@latest -- notis doctor`
|
|
39
|
+
- `npx --package @notis_ai/cli@latest -- notis doctor --json`
|
package/src/cli.js
CHANGED
|
@@ -1,10 +1,29 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
1
4
|
import { Command } from 'commander';
|
|
2
5
|
import { COMMAND_SPECS, GROUP_SUMMARIES } from './command-specs/index.js';
|
|
3
6
|
import { OutputManager } from './runtime/output.js';
|
|
4
7
|
import { asCliError } from './runtime/errors.js';
|
|
5
8
|
import { resolveRuntimeProfile, workspacePath } from './runtime/profiles.js';
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
// Read the version from package.json: the publish pipeline bumps the manifest
|
|
11
|
+
// (scripts/release-utils.js applyVersion), so a hardcoded string here goes
|
|
12
|
+
// stale on every release.
|
|
13
|
+
function readCliVersion() {
|
|
14
|
+
try {
|
|
15
|
+
const manifestPath = join(dirname(fileURLToPath(import.meta.url)), '..', 'package.json');
|
|
16
|
+
const version = JSON.parse(readFileSync(manifestPath, 'utf-8')).version;
|
|
17
|
+
if (typeof version === 'string' && version.trim()) {
|
|
18
|
+
return version.trim();
|
|
19
|
+
}
|
|
20
|
+
} catch {
|
|
21
|
+
// Fall through to the placeholder below.
|
|
22
|
+
}
|
|
23
|
+
return '0.0.0';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const CLI_VERSION = readCliVersion();
|
|
8
27
|
|
|
9
28
|
function buildHelpFooter(spec) {
|
|
10
29
|
const lines = [
|
|
@@ -64,7 +83,16 @@ function attachSpec(program, parentMap, spec, specs) {
|
|
|
64
83
|
}
|
|
65
84
|
|
|
66
85
|
for (const option of spec.args_schema?.options || []) {
|
|
67
|
-
|
|
86
|
+
if (option.collect) {
|
|
87
|
+
command.option(
|
|
88
|
+
option.flags,
|
|
89
|
+
option.description,
|
|
90
|
+
(value, previous) => [...(previous || []), value],
|
|
91
|
+
[],
|
|
92
|
+
);
|
|
93
|
+
} else {
|
|
94
|
+
command.option(option.flags, option.description);
|
|
95
|
+
}
|
|
68
96
|
}
|
|
69
97
|
|
|
70
98
|
command.action(async (...raw) => {
|
|
@@ -112,7 +140,7 @@ export function createProgram() {
|
|
|
112
140
|
|
|
113
141
|
program
|
|
114
142
|
.name('notis')
|
|
115
|
-
.description('Agent-first Notis CLI for apps
|
|
143
|
+
.description('Agent-first Notis CLI for apps and generic tool execution')
|
|
116
144
|
.version(CLI_VERSION)
|
|
117
145
|
.showHelpAfterError()
|
|
118
146
|
.option('--json', 'Shortcut for --output json')
|