@vivary/create 0.1.0 → 0.2.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 (3) hide show
  1. package/README.md +26 -3
  2. package/index.js +49 -27
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -2,16 +2,30 @@
2
2
 
3
3
  **The `create-t3-app` for agent-native workspaces.** Scaffold a complete Vivary
4
4
  workspace — typed knowledge graph (tropo), agent OS (strato), and starter graph — in
5
- one command.
5
+ one command. Generated modules use `modules/<id>/index.md` routers so agents load
6
+ context progressively.
6
7
 
7
8
  ```bash
8
9
  npm create @vivary my-workspace -- --preset coding
10
+ npm create @vivary my-codebase -- --preset coding --active-context cocoindex-code
9
11
  # or
10
12
  npx @vivary/create my-workspace --preset coding
13
+
14
+ # Agent-mode (no prompts, machine-readable output):
15
+ npx @vivary/create init . --preset coding --auto --size large --yes --json
16
+
17
+ # Reconfigure storage on an existing workspace:
18
+ npx @vivary/create wizard my-workspace --auto --storage embedded --yes --json
11
19
  ```
12
20
 
13
21
  Presets: `coding` · `second-brain` · `writing`.
14
22
 
23
+ A bare `npm create @vivary <name>` maps to the `init` subcommand; you can also pass
24
+ `init` / `doctor` / `wizard` explicitly (e.g. `npm create @vivary doctor my-workspace`).
25
+
26
+ On a terminal that supports input, `init` runs a short wizard to pick a storage tier.
27
+ Skip it with `--no-wizard`, or use `--auto` for fully non-interactive agent use.
28
+
15
29
  ## How it works
16
30
 
17
31
  This package is a thin launcher: it runs the Python `create-vivary` scaffolder via
@@ -19,9 +33,18 @@ This package is a thin launcher: it runs the Python `create-vivary` scaffolder v
19
33
  scaffolder stays one source of truth in Python while you get a Node-native entry
20
34
  point. **Python 3.11+ and uv (or pipx) must be installed.**
21
35
 
22
- Prefer Python directly? `uvx create-vivary my-workspace --preset coding` or
23
- `pip install create-vivary`.
36
+ Prefer Python directly? `uvx create-vivary my-workspace --preset coding` — a bare
37
+ target defaults to `init` there too (the PyPI `create-vivary` is versioned in lockstep
38
+ with this launcher) — or `pip install create-vivary`.
39
+
40
+ For coding workspaces, `--active-context cocoindex-code` scaffolds optional
41
+ CocoIndex-code guidance and ignored sidecar state. It does not auto-install, index, or
42
+ enable MCP; the generated docs give the approved `ccc init` / `ccc index` path.
24
43
 
25
44
  ## License
26
45
 
27
46
  MIT.
47
+
48
+ ---
49
+
50
+ Website & docs: <https://vivary.vercel.app/>
package/index.js CHANGED
@@ -7,35 +7,57 @@
7
7
 
8
8
  const { spawnSync } = require("node:child_process");
9
9
 
10
- const args = process.argv.slice(2);
11
- const onWindows = process.platform === "win32";
12
-
13
- // VIVARY_FROM lets dev/CI point at a local wheel or path instead of PyPI.
14
- const from = process.env.VIVARY_FROM;
15
-
16
- function run(cmd, cmdArgs) {
17
- return spawnSync(cmd, cmdArgs, { stdio: "inherit", shell: onWindows });
10
+ // The documented UX is `npm create @vivary my-workspace` (create-t3-app style),
11
+ // but the Python CLI expects an explicit `init`/`doctor` subcommand. Default a
12
+ // bare target to `init` so the documented form works; an explicit subcommand or a
13
+ // leading flag (e.g. `-h`/`--help`) passes through unchanged.
14
+ const SUBCOMMANDS = new Set(["init", "doctor"]);
15
+
16
+ function mapArgs(args) {
17
+ const first = args[0];
18
+ if (first && !first.startsWith("-") && !SUBCOMMANDS.has(first)) {
19
+ return ["init", ...args];
20
+ }
21
+ return args;
18
22
  }
19
23
 
20
- // 1) uv (uvx) — preferred, fast, no global install.
21
- let result = run("uvx", from
22
- ? ["--from", from, "create-vivary", ...args]
23
- : ["create-vivary", ...args]);
24
-
25
- // 2) pipx fallback if uv is not installed.
26
- if (result.error && result.error.code === "ENOENT") {
27
- result = run("pipx", from
28
- ? ["run", "--spec", from, "create-vivary", ...args]
29
- : ["run", "create-vivary", ...args]);
24
+ function main() {
25
+ const args = mapArgs(process.argv.slice(2));
26
+ const onWindows = process.platform === "win32";
27
+
28
+ // VIVARY_FROM lets dev/CI point at a local wheel or path instead of PyPI.
29
+ const from = process.env.VIVARY_FROM;
30
+
31
+ function run(cmd, cmdArgs) {
32
+ return spawnSync(cmd, cmdArgs, { stdio: "inherit", shell: onWindows });
33
+ }
34
+
35
+ // 1) uv (uvx) — preferred, fast, no global install.
36
+ let result = run("uvx", from
37
+ ? ["--from", from, "create-vivary", ...args]
38
+ : ["create-vivary", ...args]);
39
+
40
+ // 2) pipx fallback if uv is not installed.
41
+ if (result.error && result.error.code === "ENOENT") {
42
+ result = run("pipx", from
43
+ ? ["run", "--spec", from, "create-vivary", ...args]
44
+ : ["run", "create-vivary", ...args]);
45
+ }
46
+
47
+ // 3) Neither runner present — guide the user.
48
+ if (result.error && result.error.code === "ENOENT") {
49
+ console.error(
50
+ "create-vivary needs Python tooling to run the scaffolder.\n" +
51
+ "Install uv (https://docs.astral.sh/uv/) or pipx, then re-run `npm create vivary`."
52
+ );
53
+ process.exit(1);
54
+ }
55
+
56
+ process.exit(result.status == null ? 1 : result.status);
30
57
  }
31
58
 
32
- // 3) Neither runner present — guide the user.
33
- if (result.error && result.error.code === "ENOENT") {
34
- console.error(
35
- "create-vivary needs Python tooling to run the scaffolder.\n" +
36
- "Install uv (https://docs.astral.sh/uv/) or pipx, then re-run `npm create vivary`."
37
- );
38
- process.exit(1);
39
- }
59
+ module.exports = { mapArgs };
40
60
 
41
- process.exit(result.status == null ? 1 : result.status);
61
+ if (require.main === module) {
62
+ main();
63
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vivary/create",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Scaffold a complete Vivary agent workspace — the create-t3-app for agent-native workspaces. Runs the Python create-vivary via uv/pipx.",
5
5
  "bin": {
6
6
  "create-vivary": "index.js"
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "license": "MIT",
24
24
  "author": "Jeff Kazzee",
25
- "homepage": "https://github.com/vivary-dev/vivary",
25
+ "homepage": "https://vivary.vercel.app/",
26
26
  "repository": {
27
27
  "type": "git",
28
28
  "url": "git+https://github.com/vivary-dev/vivary.git"