@pixelvibing/cli 0.0.1 → 0.1.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.
- package/README.md +32 -5
- package/dist/pixel-vibing-cli.js +4036 -0
- package/package.json +24 -3
- package/skills/pixelvibing/SKILL.md +124 -0
- package/skills/pixelvibing-style-guide/SKILL.md +42 -0
package/package.json
CHANGED
|
@@ -1,19 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixelvibing/cli",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "PixelVibing: pixel art game assets from the command line
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "PixelVibing: pixel art game assets from the command line, and the Skills that teach coding assistants to make them.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://pixelvibing.com",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/
|
|
9
|
+
"url": "git+https://github.com/Pixel-Vibing/pixel-vibing.git",
|
|
10
10
|
"directory": "cli"
|
|
11
11
|
},
|
|
12
|
+
"type": "module",
|
|
13
|
+
"bin": {
|
|
14
|
+
"pixel-vibing-cli": "dist/pixel-vibing-cli.js"
|
|
15
|
+
},
|
|
12
16
|
"files": [
|
|
17
|
+
"dist/",
|
|
18
|
+
"skills/",
|
|
13
19
|
"README.md",
|
|
14
20
|
"LICENSE"
|
|
15
21
|
],
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=20"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "npm run build --workspace=@pixelvibing/toolkit && node scripts/build.mjs",
|
|
27
|
+
"check": "node ../node_modules/typescript/bin/tsc -p tsconfig.json --noEmit",
|
|
28
|
+
"check:package": "node ../editor/src/main/package-guard.ts dist && node ../editor/src/main/package-guard.ts skills",
|
|
29
|
+
"test": "node --import ../editor/scripts/test-register.mjs --test \"src/**/*.test.ts\""
|
|
30
|
+
},
|
|
16
31
|
"publishConfig": {
|
|
17
32
|
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@napi-rs/keyring": "2.1.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@pixelvibing/toolkit": "0.1.0"
|
|
18
39
|
}
|
|
19
40
|
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pixelvibing
|
|
3
|
+
description: Make pixel art for this game with pixel-vibing-cli — objects, creatures, level designs and interface art (a HUD, skill and item icons) generated on the PixelVibing platform, listed and pulled into pixelvibing/out/, and sealed into the game's container. Use when the game needs a sprite, a prop, a creature, a level's art, its HUD or its icons, or art already made for it.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# PixelVibing art for this game
|
|
7
|
+
|
|
8
|
+
This repository is a PixelVibing local project. `pixelvibing.json` at its root names it
|
|
9
|
+
and the platform project it generates for; `pixelvibing/` holds its art. The platform
|
|
10
|
+
keeps every asset, and `pixelvibing/` holds only what was pulled from it. Nothing written
|
|
11
|
+
there is ever sent back: art enters the project only by being generated.
|
|
12
|
+
|
|
13
|
+
Every command below takes `--json`, which prints its answer as JSON on standard output.
|
|
14
|
+
Progress and errors go to standard error, and a failure exits 1.
|
|
15
|
+
|
|
16
|
+
## Before anything
|
|
17
|
+
|
|
18
|
+
1. `pixel-vibing-cli whoami --json` says who is signed in and which platform project
|
|
19
|
+
this folder generates for.
|
|
20
|
+
- Not signed in: ask the person to run `pixel-vibing-cli login`.
|
|
21
|
+
- Never ask for a token, and never write one into a file or a command you show.
|
|
22
|
+
- No platform project: `pixel-vibing-cli link <project>`, or `link --idea "<what the
|
|
23
|
+
game is>"` to make one.
|
|
24
|
+
2. Read `pixelvibing/style-guide.md`, or run `pixel-vibing-cli guide show`, before deciding
|
|
25
|
+
what to ask for. It says what the game is and how its art looks, and every generation is
|
|
26
|
+
held to it. Write instructions in its terms. The `pixelvibing-style-guide` Skill says
|
|
27
|
+
when the guide itself should change.
|
|
28
|
+
|
|
29
|
+
## Generating
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pixel-vibing-cli generate object --instruction "<what>" --size <cols>x<rows> --yes --json
|
|
33
|
+
pixel-vibing-cli generate creature --instruction "<what>" [--reference <png>]... --yes --json
|
|
34
|
+
pixel-vibing-cli generate level-design --instruction "<what>" --tiles <cols>x<rows> --yes --json
|
|
35
|
+
pixel-vibing-cli generate hud [--pieces <list>] [--instruction "<theme>"] --yes --json
|
|
36
|
+
pixel-vibing-cli generate icons --names "<name>,<name>,..." --purpose <skill|item> [--size <16|32|64>] --yes --json
|
|
37
|
+
pixel-vibing-cli generate hud-mockup --instruction "<the HUD>" --yes --json
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Each generation spends the account's credits.
|
|
41
|
+
- **The cost.** The command prints the cost and the balance before it starts. Without
|
|
42
|
+
`--yes` it asks, and with nobody at the terminal it starts nothing. Tell the person what
|
|
43
|
+
a batch will cost before you start one.
|
|
44
|
+
- **The instruction.** Describe the thing as a person would: its look, its material, what
|
|
45
|
+
it is for in the game. Describe the thing itself, not a prompt for a model.
|
|
46
|
+
- **The options.**
|
|
47
|
+
- `--size` is an object's footprint in whole tiles, `1x1` unless given.
|
|
48
|
+
- `--tiles` is how many tiles a level design is across, `6x4` unless given.
|
|
49
|
+
- `--quality` is `low`, `medium` (the default), `high`, `xhigh` or `max`; the higher,
|
|
50
|
+
the dearer.
|
|
51
|
+
- `--reference` is a PNG to draw from, repeated for several: at most 8 for an object,
|
|
52
|
+
3 for a creature, a level design or a HUD mockup, none for a HUD set or icons.
|
|
53
|
+
- **Interface art.** When the game shows the player something over the world, make it here
|
|
54
|
+
rather than drawing it in code:
|
|
55
|
+
- `hud` makes a matching set in one generation: `health-bar`, `mana-bar`, `button`,
|
|
56
|
+
`inventory-slot`, `panel-frame` and `minimap-frame`, all unless `--pieces` names some.
|
|
57
|
+
Frames, buttons, slots and the minimap frame come with nine-slice insets, so stretch
|
|
58
|
+
them with the engine's nine-slice sprite rather than scaling them.
|
|
59
|
+
- `icons` makes up to 16 icons that match, from `--names`: `--purpose skill` for a
|
|
60
|
+
hotbar or a skill tree (each on a square badge), `--purpose item` for an inventory,
|
|
61
|
+
potions or loot (each alone). `--size` is 16, 32 (the default) or 64 px.
|
|
62
|
+
- `hud-mockup` draws one screen with its whole HUD, to agree on the look first; take
|
|
63
|
+
its pieces out in the desktop editor.
|
|
64
|
+
- The art never carries text or numbers: draw labels, counts and values in the game.
|
|
65
|
+
- **Success.** The asset is pulled at once. The answer's `files` are where its pictures
|
|
66
|
+
are, relative to `pixelvibing/`.
|
|
67
|
+
- **Failure.** Too few credits starts nothing and names the page where the person buys
|
|
68
|
+
more: tell them, and do not retry. A failed job prints its reason.
|
|
69
|
+
|
|
70
|
+
## Listing and pulling
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pixel-vibing-cli list [<kind>] --json
|
|
74
|
+
pixel-vibing-cli pull <id|name> [--as <name>] --json
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
- **Listing.** `list` answers the newest 50 assets. When there are more, it gives a
|
|
78
|
+
`next` id for `--before`. A kind is the generation that made the asset: `object`,
|
|
79
|
+
`creature`, `level-design`, `rotate`, `animate`…
|
|
80
|
+
- **Pulling.** `pull` writes an asset of one picture as `pixelvibing/out/<name>.png`, and
|
|
81
|
+
one of several as `pixelvibing/out/<name>/<n>.png`; a HUD set's pieces as
|
|
82
|
+
`pixelvibing/out/ui/hud/<piece>.png` and an icon set's as `pixelvibing/out/ui/icon/<name>.png`.
|
|
83
|
+
It downloads again only when the platform's copy changed.
|
|
84
|
+
- **Collisions.** `pull` never writes over a picture it did not pull. When it refuses,
|
|
85
|
+
give the asset another name with `--as`.
|
|
86
|
+
- **Using the art.** Use the pictures where they are, or copy them into the game's own
|
|
87
|
+
asset folders. A copy is not tracked.
|
|
88
|
+
|
|
89
|
+
## Taking the art into the game
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
pixel-vibing-cli export <default|pixi|phaser|godot> [--out <dir>] --json
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
- **What it makes.** Every picture under `pixelvibing/out/`, packed into sprite sheets,
|
|
96
|
+
with the animations, and the map as placed sprites. It goes into
|
|
97
|
+
`pixelvibing/export/<engine>/`, or `--out`.
|
|
98
|
+
- **The formats.**
|
|
99
|
+
- `pixi`: a TexturePacker JSON Hash spritesheet per sheet, for `Assets.load`.
|
|
100
|
+
- `phaser`: a multi-atlas for `load.multiatlas`, and `animations.json` for
|
|
101
|
+
`anims.fromJSON`.
|
|
102
|
+
- `godot`: `AtlasTexture` and `SpriteFrames` resources, and `map.tscn`, under the
|
|
103
|
+
`res://` folder `--godot-root` names.
|
|
104
|
+
- `default`: plain JSON, for any other engine.
|
|
105
|
+
- **The map.** `map.json` lists each placed sprite, with its frame, its box in world
|
|
106
|
+
pixels, its level and its layer (`ground`, `object` or `foreground`), in draw order.
|
|
107
|
+
Place them in that order.
|
|
108
|
+
- **Interface art that stretches.** A HUD frame's nine-slice insets travel with it:
|
|
109
|
+
`nineGrid` on its frame in `sheets.json`, `borders` on its PixiJS frame (a
|
|
110
|
+
`NineSliceSprite` reads them), Phaser's `nine-slices.json` (the widths `nineslice()`
|
|
111
|
+
takes), and a `NinePatchRect` scene under Godot's `nine-patch/`.
|
|
112
|
+
- **Safety.** An export replaces only an earlier export or an empty directory, never a
|
|
113
|
+
folder of the game's own.
|
|
114
|
+
|
|
115
|
+
## Sealing
|
|
116
|
+
|
|
117
|
+
`pixel-vibing-cli seal` builds `pixelvibing/build/assets.eac` from every picture under
|
|
118
|
+
`pixelvibing/out/`, as the editor does, for a game that reads the container.
|
|
119
|
+
|
|
120
|
+
## By hand
|
|
121
|
+
|
|
122
|
+
`pixel-vibing-cli editor` opens the PixelVibing desktop app on this project, where a person
|
|
123
|
+
finishes art by hand. Suggest it when a result needs a person's eye rather than another
|
|
124
|
+
generation.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pixelvibing-style-guide
|
|
3
|
+
description: Keep this game's PixelVibing style guide true as the game grows — read it before generating, and change it when the game gains a place, a palette, a camera or a rule its art must follow. Use when the game's look or scope changes, or when generated art keeps missing the game in the same way.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# The style guide
|
|
7
|
+
|
|
8
|
+
`pixelvibing/style-guide.md` mirrors the platform project's style guide. The guide is the
|
|
9
|
+
game's source of truth: what the game is, its world, its camera, its palette, its outline
|
|
10
|
+
and shading, its scale in pixels, and what never belongs in it. Every generation the
|
|
11
|
+
platform makes for this project is held to it, so a guide that no longer describes the
|
|
12
|
+
game makes art that no longer fits it.
|
|
13
|
+
|
|
14
|
+
## When to change it
|
|
15
|
+
|
|
16
|
+
- The game gains a place, a biome, a faction, an era, or a kind of thing it did not have.
|
|
17
|
+
- The camera, the perspective, the tile size, the palette, the outline or the shading
|
|
18
|
+
changes.
|
|
19
|
+
- Generated art keeps coming back wrong in the same way.
|
|
20
|
+
- The game gets a rule its art must keep, such as a light that always comes from one side.
|
|
21
|
+
|
|
22
|
+
Do not change it for one asset: say that in the asset's instruction instead.
|
|
23
|
+
|
|
24
|
+
## How
|
|
25
|
+
|
|
26
|
+
1. `pixel-vibing-cli guide pull` writes the current version to `pixelvibing/style-guide.md`.
|
|
27
|
+
It refuses to write over changes that were never pushed.
|
|
28
|
+
2. Then change it, one of two ways:
|
|
29
|
+
- **Edit the file.** Keep it prose a person reads. Keep its first fenced block marked
|
|
30
|
+
`prompt`: that block is the guide's own sentence for an image model. When the rest
|
|
31
|
+
changes, bring it up to date too. The whole guide is at most 8000 characters.
|
|
32
|
+
- **Ask the platform.** `pixel-vibing-cli guide revise "<what changed in the game>"
|
|
33
|
+
--yes` revises the guide by that instruction, keeping what it does not change, and
|
|
34
|
+
pulls the result. It costs a credit.
|
|
35
|
+
3. `pixel-vibing-cli guide push` keeps the file as the guide's next version.
|
|
36
|
+
- If the platform's guide moved on since your pull, nothing is kept.
|
|
37
|
+
- Save your changes aside, run `pixel-vibing-cli guide pull --force`, make them again on
|
|
38
|
+
top, and push.
|
|
39
|
+
4. `pixel-vibing-cli guide versions` lists every version, with how and when each was made.
|
|
40
|
+
|
|
41
|
+
Tell the person what you changed and why, since the guide shapes every later generation.
|
|
42
|
+
Art made before the change was made under the old guide, and nothing remakes it by itself.
|