@octonote/cli 0.1.3 → 0.1.4

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
@@ -6,7 +6,7 @@ mermaid flowcharts, organise them in notebooks, publish and share — all
6
6
  through the same API the app uses, with your permissions.
7
7
 
8
8
  ```bash
9
- npm i -g https://octonote.ai/cli/octonote-cli.tgz && octonote # installs, then shows getting started
9
+ npm i -g @octonote/cli && octonote # installs, then shows getting started
10
10
  octonote login # opens the browser; click Authorize
11
11
  octonote setup claude # or: octonote setup codex — teaches your agent
12
12
  ```
@@ -49,15 +49,23 @@ export function registerProject(program) {
49
49
  ...(opts.description ? { description: opts.description } : {}),
50
50
  ...(notebookId ? { notebookId } : {}),
51
51
  });
52
- await ctx.api.patch(`/projects/${p.id}`, {
53
- settings: { defaultView: view },
54
- });
55
- if (noteMd?.trim() && p.noteId)
56
- await ctx.api.put(`/pages/${p.noteId}/markdown`, {
57
- markdown: noteMd,
52
+ try {
53
+ await ctx.api.patch(`/projects/${p.id}`, {
54
+ settings: { defaultView: view },
58
55
  });
59
- if (mermaid?.trim() && p.canvasId)
60
- await ctx.api.put(`/canvases/${p.canvasId}/mermaid`, { mermaid });
56
+ if (noteMd?.trim() && p.noteId)
57
+ await ctx.api.put(`/pages/${p.noteId}/markdown`, {
58
+ markdown: noteMd,
59
+ });
60
+ if (mermaid?.trim() && p.canvasId)
61
+ await ctx.api.put(`/canvases/${p.canvasId}/mermaid`, { mermaid });
62
+ }
63
+ catch (err) {
64
+ // The server only checks the note and diagram once the project
65
+ // exists: remove it again rather than leave it half made.
66
+ await ctx.api.delete(`/projects/${p.id}`).catch(() => { });
67
+ throw err;
68
+ }
61
69
  const out = {
62
70
  ...item(ctx, "project", p),
63
71
  noteId: p.noteId,
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /** The CLI's version — keep in step with package.json (a test checks). */
2
- export const VERSION = "0.1.3";
2
+ export const VERSION = "0.1.4";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octonote/cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "The octonote command-line tool: lets you — and agents like Claude Code and Codex — create, edit, publish and share Octonote notes, canvases, projects and notebooks.",
5
5
  "homepage": "https://octonote.ai/cli",
6
6
  "repository": {
@@ -20,12 +20,12 @@
20
20
  "node": ">=20"
21
21
  },
22
22
  "scripts": {
23
- "build": "tsc -p tsconfig.json && node scripts/gen-reference.mjs",
23
+ "build": "tsc -p tsconfig.json && node scripts/gen-reference.mjs && node scripts/gen-docs.mjs",
24
24
  "dev": "tsx src/index.ts",
25
25
  "lint": "echo \"lint pending\"",
26
26
  "typecheck": "tsc -p tsconfig.json --noEmit",
27
27
  "test": "vitest run",
28
- "check:reference": "node scripts/gen-reference.mjs --check"
28
+ "check:reference": "node scripts/gen-reference.mjs --check && node scripts/gen-docs.mjs --check"
29
29
  },
30
30
  "dependencies": {
31
31
  "commander": "^12.1.0"