@craftrpgs/cli 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.
Files changed (3) hide show
  1. package/README.md +63 -0
  2. package/dist/bin.js +31512 -0
  3. package/package.json +34 -0
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # Craft CLI
2
+
3
+ Sync [Craft](https://craftrpgs.com) projects with a local folder: clone a
4
+ world, edit it with your editor or any coding agent, and push the changes
5
+ back — git-style, with three-way sync and conflict handling.
6
+
7
+ ```sh
8
+ npm install -g @craftrpgs/cli
9
+ craft login
10
+ craft create "My World"
11
+ cd my-world
12
+ # edit files, then:
13
+ craft status
14
+ craft push -m "first pass at the heroes"
15
+ ```
16
+
17
+ ## What you get locally
18
+
19
+ A cloned project is a plain folder of files: markdown with frontmatter for
20
+ notes and JSON for typed records (`aragorn.character.json`), organized in
21
+ real directories that mirror the project's folders. `.craft/` holds the sync
22
+ state — leave it alone. `AGENTS.md` / `CLAUDE.md` and a skill are included
23
+ so coding agents know how to work with the project the moment you open it.
24
+
25
+ ## Commands
26
+
27
+ | Command | What it does |
28
+ |---|---|
29
+ | `craft login` / `logout` | Browser sign-in (credentials stored per server) |
30
+ | `craft create <name>` | Create a new project and clone it |
31
+ | `craft clone <idOrUrl>` | Download a project as a local workspace |
32
+ | `craft projects` | List projects your account owns |
33
+ | `craft status` / `diff` | Show local changes (add `--remote` for drift) |
34
+ | `craft check` | Local completeness audit against the worldbuilding quality bar |
35
+ | `craft pull` | Apply remote changes; conflicts become sidecar files |
36
+ | `craft push [path ...] -m "..."` | Send local changes as one transactional batch (optional pathspecs — file paths or directory prefixes — scope it) |
37
+ | `craft log <path>` | A file's version history |
38
+ | `craft publish -m "..."` | Snapshot the server state as a numbered release |
39
+ | `craft mv <from> <to>` | Rename/move a file, keeping its identity |
40
+ | `craft type new <Name>` | Author a new file type locally |
41
+ | `craft image generate/upload` | Generate (opt-in in Settings) or upload images |
42
+ | `craft env [name]` | Show or pin the environment for a directory |
43
+
44
+ Every command takes `--json` for machine-readable output. Auth is via
45
+ `craft login` (browser OAuth); credentials are stored locally and refreshed
46
+ automatically.
47
+
48
+ Run `craft help <command>` for details on any of them.
49
+
50
+ ## Environments
51
+
52
+ The CLI talks to production (`craftrpgs.com`) by default. `craft env <name-or-url>`
53
+ pins the current directory tree to another server via a one-line
54
+ `.craft-env` file — handy for keeping a testing folder pointed at a dev
55
+ server while the rest of your machine uses production. `--remote` and
56
+ `CRAFT_REMOTE` accept an environment name or any origin URL. A cloned
57
+ workspace always syncs with the server it was cloned from. (Craft
58
+ developers: set `CRAFT_DEV=1` to enable the internal `local` and `staging`
59
+ environment names.)
60
+
61
+ ## Requirements
62
+
63
+ Node.js 20 or newer.