@vivary/create 0.1.0 → 0.1.1
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 +9 -2
- package/index.js +49 -27
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -12,6 +12,9 @@ npx @vivary/create my-workspace --preset coding
|
|
|
12
12
|
|
|
13
13
|
Presets: `coding` · `second-brain` · `writing`.
|
|
14
14
|
|
|
15
|
+
A bare `npm create @vivary <name>` maps to the `init` subcommand; you can also pass
|
|
16
|
+
`init` / `doctor` explicitly (e.g. `npm create @vivary doctor my-workspace`).
|
|
17
|
+
|
|
15
18
|
## How it works
|
|
16
19
|
|
|
17
20
|
This package is a thin launcher: it runs the Python `create-vivary` scaffolder via
|
|
@@ -19,9 +22,13 @@ This package is a thin launcher: it runs the Python `create-vivary` scaffolder v
|
|
|
19
22
|
scaffolder stays one source of truth in Python while you get a Node-native entry
|
|
20
23
|
point. **Python 3.11+ and uv (or pipx) must be installed.**
|
|
21
24
|
|
|
22
|
-
Prefer Python directly?
|
|
23
|
-
`pip install create-vivary`.
|
|
25
|
+
Prefer Python directly? The Python CLI takes the explicit subcommand:
|
|
26
|
+
`uvx create-vivary init my-workspace --preset coding` or `pip install create-vivary`.
|
|
24
27
|
|
|
25
28
|
## License
|
|
26
29
|
|
|
27
30
|
MIT.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
//
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "0.1.1",
|
|
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://
|
|
25
|
+
"homepage": "https://vivary.vercel.app/",
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|
|
28
28
|
"url": "git+https://github.com/vivary-dev/vivary.git"
|