vibedgames 0.0.2 → 0.0.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 +9 -0
- package/dist/commands/init.d.ts +20 -0
- package/dist/commands/init.js +89 -0
- package/dist/index.js +5 -3
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -11,6 +11,7 @@ npm i -g vibedgames
|
|
|
11
11
|
## Commands
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
|
+
vg init [dir] # install Claude Code skills into ./.claude/skills
|
|
14
15
|
vg login # authenticate via browser
|
|
15
16
|
vg logout # clear credentials
|
|
16
17
|
vg whoami # show current user
|
|
@@ -18,6 +19,14 @@ vg deploy [dir] # deploy a game directory
|
|
|
18
19
|
vg deploy ./dist --slug my-game
|
|
19
20
|
```
|
|
20
21
|
|
|
22
|
+
`vg skills install` is an alias for `vg init`.
|
|
23
|
+
|
|
24
|
+
## Using with Claude Code
|
|
25
|
+
|
|
26
|
+
Run `vg init` in your project to drop the full set of game-building skills
|
|
27
|
+
(Phaser, Three.js, Aseprite, fal.ai, deploy, etc.) into `./.claude/skills/`.
|
|
28
|
+
Claude picks them up automatically on next session.
|
|
29
|
+
|
|
21
30
|
## How deploy works
|
|
22
31
|
|
|
23
32
|
1. Walks the directory, hashes files, validates `index.html` exists
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const initCommand: import("citty").CommandDef<{
|
|
2
|
+
agent: {
|
|
3
|
+
type: "string";
|
|
4
|
+
description: string;
|
|
5
|
+
alias: string;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
global: {
|
|
9
|
+
type: "boolean";
|
|
10
|
+
description: string;
|
|
11
|
+
default: false;
|
|
12
|
+
alias: string;
|
|
13
|
+
};
|
|
14
|
+
yes: {
|
|
15
|
+
type: "boolean";
|
|
16
|
+
description: string;
|
|
17
|
+
default: true;
|
|
18
|
+
alias: string;
|
|
19
|
+
};
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import consola from "consola";
|
|
3
|
+
import spawn from "cross-spawn";
|
|
4
|
+
const REPO = "kyh/vibedgames";
|
|
5
|
+
const PKG = "vibedgames";
|
|
6
|
+
const DEFAULT_AGENTS = "claude-code,cursor,codex";
|
|
7
|
+
const description = "Install/update vibedgames skills and the vg CLI";
|
|
8
|
+
const run = (cmd, args) => new Promise((resolve) => {
|
|
9
|
+
const chunks = [];
|
|
10
|
+
const child = spawn(cmd, args, { stdio: ["ignore", "pipe", "pipe"] });
|
|
11
|
+
child.stdout?.on("data", (c) => chunks.push(c));
|
|
12
|
+
child.stderr?.on("data", (c) => chunks.push(c));
|
|
13
|
+
child.on("error", (err) => resolve({ code: 1, output: `${err.message}\n` }));
|
|
14
|
+
child.on("close", (code) => resolve({ code: code ?? 1, output: Buffer.concat(chunks).toString("utf8") }));
|
|
15
|
+
});
|
|
16
|
+
const skillsAddArgs = (agents, global, yes) => {
|
|
17
|
+
const args = ["-y", "skills", "add", REPO];
|
|
18
|
+
for (const agent of agents)
|
|
19
|
+
args.push("-a", agent);
|
|
20
|
+
if (global)
|
|
21
|
+
args.push("-g");
|
|
22
|
+
if (yes)
|
|
23
|
+
args.push("-y");
|
|
24
|
+
return args;
|
|
25
|
+
};
|
|
26
|
+
const skillsUpdateArgs = (global, yes) => {
|
|
27
|
+
const args = ["-y", "skills", "update"];
|
|
28
|
+
if (global)
|
|
29
|
+
args.push("-g");
|
|
30
|
+
if (yes)
|
|
31
|
+
args.push("-y");
|
|
32
|
+
return args;
|
|
33
|
+
};
|
|
34
|
+
export const initCommand = defineCommand({
|
|
35
|
+
meta: { name: "init", description },
|
|
36
|
+
args: {
|
|
37
|
+
agent: {
|
|
38
|
+
type: "string",
|
|
39
|
+
description: "Comma-separated target agents. Default installs for Claude Code, Cursor, and Codex (symlinked from a shared .agents/skills/ dir). Pass '*' for every supported agent.",
|
|
40
|
+
alias: "a",
|
|
41
|
+
default: DEFAULT_AGENTS,
|
|
42
|
+
},
|
|
43
|
+
global: {
|
|
44
|
+
type: "boolean",
|
|
45
|
+
description: "Install to user directory instead of project",
|
|
46
|
+
default: false,
|
|
47
|
+
alias: "g",
|
|
48
|
+
},
|
|
49
|
+
yes: {
|
|
50
|
+
type: "boolean",
|
|
51
|
+
description: "Skip confirmation prompts",
|
|
52
|
+
default: true,
|
|
53
|
+
alias: "y",
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
run: async ({ args }) => {
|
|
57
|
+
const agents = args.agent
|
|
58
|
+
.split(",")
|
|
59
|
+
.map((s) => s.trim())
|
|
60
|
+
.filter(Boolean);
|
|
61
|
+
consola.start("Installing/updating vibedgames skills and the vg CLI...");
|
|
62
|
+
const [add, cli] = await Promise.all([
|
|
63
|
+
run("npx", skillsAddArgs(agents, args.global, args.yes)),
|
|
64
|
+
run("npm", ["install", "-g", PKG]),
|
|
65
|
+
]);
|
|
66
|
+
if (add.code !== 0) {
|
|
67
|
+
if (add.output.trim())
|
|
68
|
+
consola.error(add.output.trim());
|
|
69
|
+
throw new Error(`skills add exited with code ${add.code}`);
|
|
70
|
+
}
|
|
71
|
+
consola.success(`Installed vibedgames skills for ${agents.join(", ")}`);
|
|
72
|
+
const update = await run("npx", skillsUpdateArgs(args.global, args.yes));
|
|
73
|
+
if (update.code !== 0) {
|
|
74
|
+
if (update.output.trim())
|
|
75
|
+
consola.warn(update.output.trim());
|
|
76
|
+
consola.warn(`'skills update' exited with code ${update.code}. Skills were just installed via 'add', so they should already be current.`);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
consola.success("Refreshed installed skills to latest");
|
|
80
|
+
}
|
|
81
|
+
if (cli.code !== 0) {
|
|
82
|
+
if (cli.output.trim())
|
|
83
|
+
consola.warn(cli.output.trim());
|
|
84
|
+
consola.warn(`Couldn't install the vg CLI globally (npm exit ${cli.code}). Install manually: npm install -g ${PKG}`);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
consola.success("Installed/updated vg CLI globally");
|
|
88
|
+
},
|
|
89
|
+
});
|
package/dist/index.js
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
2
3
|
import { defineCommand, runMain } from "citty";
|
|
3
4
|
import { deployCommand } from "./commands/deploy.js";
|
|
5
|
+
import { initCommand } from "./commands/init.js";
|
|
4
6
|
import { loginCommand } from "./commands/login.js";
|
|
5
7
|
import { logoutCommand } from "./commands/logout.js";
|
|
6
|
-
import { skillsCommand } from "./commands/skills.js";
|
|
7
8
|
import { whoamiCommand } from "./commands/whoami.js";
|
|
9
|
+
const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
8
10
|
const main = defineCommand({
|
|
9
11
|
meta: {
|
|
10
12
|
name: "vg",
|
|
11
|
-
version:
|
|
13
|
+
version: pkg.version,
|
|
12
14
|
description: "vibedgames CLI",
|
|
13
15
|
},
|
|
14
16
|
subCommands: {
|
|
17
|
+
init: initCommand,
|
|
15
18
|
login: loginCommand,
|
|
16
19
|
logout: logoutCommand,
|
|
17
20
|
deploy: deployCommand,
|
|
18
|
-
skills: skillsCommand,
|
|
19
21
|
whoami: whoamiCommand,
|
|
20
22
|
},
|
|
21
23
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibedgames",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -13,12 +13,14 @@
|
|
|
13
13
|
"@trpc/client": "^11.16.0",
|
|
14
14
|
"citty": "^0.1.6",
|
|
15
15
|
"consola": "^3.4.2",
|
|
16
|
+
"cross-spawn": "^7.0.6",
|
|
16
17
|
"superjson": "^2.2.6"
|
|
17
18
|
},
|
|
18
19
|
"devDependencies": {
|
|
19
20
|
"@cloudflare/workers-types": "^4.20260408.1",
|
|
20
21
|
"@kyh/tsconfig": "^1.1.14",
|
|
21
22
|
"@trpc/server": "^11.16.0",
|
|
23
|
+
"@types/cross-spawn": "^6.0.6",
|
|
22
24
|
"@types/node": "^25.5.2",
|
|
23
25
|
"typescript": "^6.0.2",
|
|
24
26
|
"@repo/api": "^0.1.0"
|