@heylatch/cli 0.2.2 → 0.2.5

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 +112 -100
  2. package/dist/latch.js +34 -31
  3. package/package.json +6 -2
package/README.md CHANGED
@@ -1,100 +1,112 @@
1
- # @heylatch/cli
2
-
3
- Publish protected scripts, manage versions and grant access on [Latch](https://heylatch.app) from your terminal, your CI, or your AI agent (MCP).
4
-
5
- ## Setup
6
-
7
- Create an API key on your workspace's **API** page on heylatch.app, then set it in your environment, or in a git-ignored `.env` file in your project:
8
-
9
- ```sh
10
- export LATCH_API_KEY=ltk_your_key
11
- npx @heylatch/cli whoami
12
- ```
13
-
14
- ## Publish a version
15
-
16
- ```sh
17
- # Check what happens to each file first (uploads nothing)
18
- npx @heylatch/cli preview ./my-resource
19
-
20
- # Upload, publish and wait for the build
21
- npx @heylatch/cli publish ./my-resource --script my-script --version 1.2.0 --changelog "Fixed spawn bug"
22
- ```
23
-
24
- `<path>` can be a resource folder, a `.zip` or a `.jar` (default: the current folder). Folders are zipped without `.git` and `.env` files.
25
- The script's slug, version, name and description come from the manifest unless you pass `--script`, `--version`, `--name` or `--description`.
26
- The first publish of a new script also needs `--ecosystem hogwartsmp|kcdc|hytale` (or `"latch": { "ecosystem": "hogwartsmp" }` in `package.json`).
27
-
28
- ## Publish a whole project
29
-
30
- ```sh
31
- npx @heylatch/cli publish-all ./resources --ecosystem hogwartsmp --dry-run # changes nothing
32
- npx @heylatch/cli publish-all ./resources --ecosystem hogwartsmp
33
- ```
34
-
35
- Safe to rerun: published versions are skipped, resources with no server code are left out, and one failure doesn't stop the others.
36
-
37
- ## Install on your own server
38
-
39
- ```sh
40
- npx @heylatch/cli pull my-script --to /path/to/server/resources
41
- npx @heylatch/cli pull --all --to /path/to/server/resources
42
- ```
43
-
44
- `pull` won't write through a symlink or junction, or over a folder that isn't a Latch package (unless you pass `--force`), so linked source folders stay safe. Use `--keep config.json` for files that shouldn't be replaced. The server still needs a license key.
45
-
46
- ## Manage access
47
-
48
- ```sh
49
- npx @heylatch/cli grant my-script LA-7K2M-9QXD # safe to retry
50
- npx @heylatch/cli grant my-script LA-AAAA-BBBB LA-CCCC-DDDD # several at once (Studio)
51
- npx @heylatch/cli revoke my-script LA-7K2M-9QXD
52
- npx @heylatch/cli access my-script
53
- ```
54
-
55
- Add `--json` to any command for machine-readable output. Commands exit with code 1 on failure.
56
-
57
- ## Use it from an AI agent
58
-
59
- Tell your agent to read the guide. It covers the whole setup, from preparing packages to installing on a server:
60
-
61
- ```
62
- Read https://heylatch.app/agents.md and use it to set up Latch for this project.
63
- ```
64
-
65
- The same guide ships with the package: `latch guide`, or the MCP tool `get_guide`.
66
-
67
- ### MCP
68
-
69
- Claude Code:
70
-
71
- ```sh
72
- claude mcp add latch -e LATCH_API_KEY=ltk_your_key -- npx -y @heylatch/cli mcp
73
- ```
74
-
75
- Cursor, Claude Desktop and other MCP clients:
76
-
77
- ```json
78
- {
79
- "mcpServers": {
80
- "latch": {
81
- "command": "npx",
82
- "args": ["-y", "@heylatch/cli", "mcp"],
83
- "env": { "LATCH_API_KEY": "ltk_your_key" }
84
- }
85
- }
86
- }
87
- ```
88
-
89
- Tools: `get_guide`, `whoami`, `list_scripts`, `get_script`, `preview_package`, `publish_version`, `publish_all`, `pull_version`, `get_version_status`, `withdraw_version`, `list_access`, `grant_access`, `revoke_access`, `list_activations`, `list_flags`, `resolve_flag`.
90
-
91
- ## GitHub Actions
92
-
93
- ```yaml
94
- # on a tag like v1.2.0
95
- - run: npx -y @heylatch/cli publish ./dist --script my-script --version "${GITHUB_REF_NAME#v}"
96
- env:
97
- LATCH_API_KEY: ${{ secrets.LATCH_API_KEY }}
98
- ```
99
-
100
- Docs: https://heylatch.app/docs/automation · API reference: https://heylatch.app/docs/api
1
+ # @heylatch/cli
2
+
3
+ Publish protected scripts, manage versions and grant access on [Latch](https://heylatch.app) from your terminal, your CI, or your AI agent (MCP).
4
+
5
+ ## Setup
6
+
7
+ Create an API key on your workspace's **API** page on heylatch.app, then set it in your environment, or in a git-ignored `.env` file in your project:
8
+
9
+ ```sh
10
+ export LATCH_API_KEY=ltk_your_key
11
+ npx @heylatch/cli whoami
12
+ ```
13
+
14
+ ## Publish a version
15
+
16
+ ```sh
17
+ # Check what happens to each file first (uploads nothing)
18
+ npx @heylatch/cli preview ./my-resource
19
+
20
+ # Upload, publish and wait for the build
21
+ npx @heylatch/cli publish ./my-resource --script my-script --version 1.2.0 --changelog "Fixed spawn bug"
22
+ ```
23
+
24
+ `<path>` can be a resource folder, a `.zip` or a `.jar` (default: the current folder). Folders are zipped without `.git` and `.env` files.
25
+ The script's slug, version, name and description come from the manifest unless you pass `--script`, `--version`, `--name` or `--description`.
26
+ The first publish of a new script also needs `--ecosystem mafiahub|hytale` (or `"latch": { "ecosystem": "mafiahub" }` in `package.json`). `mafiahub` covers Arcane MP, Kingdoms Connected, Mafia 2 Online and Fallout MP.
27
+
28
+ ## Publish a whole project
29
+
30
+ ```sh
31
+ npx @heylatch/cli publish-all ./resources --ecosystem mafiahub --dry-run # changes nothing
32
+ npx @heylatch/cli publish-all ./resources --ecosystem mafiahub
33
+ ```
34
+
35
+ Safe to rerun: published versions are skipped, resources with no server code are left out, and one failure doesn't stop the others.
36
+
37
+ ## Install on your own server
38
+
39
+ ```sh
40
+ npx @heylatch/cli pull my-script --to /path/to/server/resources
41
+ npx @heylatch/cli pull --all --to /path/to/server/resources
42
+ ```
43
+
44
+ `pull` won't write through a symlink or junction, or over a folder that isn't a Latch package (unless you pass `--force`), so linked source folders stay safe. Use `--keep config.json` for files that shouldn't be replaced. The server still needs a license key.
45
+
46
+ Scripts already on their newest version are skipped, so it's safe to run every time the server starts.
47
+
48
+ ### Server owners: keep your Library up to date
49
+
50
+ If a developer gave your account access to scripts, create an account key (`lta_…`) in Settings > API keys on heylatch.app and set it as `LATCH_API_KEY` (or put it in the server's `.env`). The same command then installs and updates everything in your Library:
51
+
52
+ ```sh
53
+ npx @heylatch/cli pull --all --to /path/to/server/resources # mods/ on Hytale
54
+ ```
55
+
56
+ An account key can only list and download your Library. Run it at the top of your start script, from cron, or from a scheduled GitHub Actions job: https://heylatch.app/docs/updates
57
+
58
+ ## Manage access
59
+
60
+ ```sh
61
+ npx @heylatch/cli grant my-script LA-7K2M-9QXD # safe to retry
62
+ npx @heylatch/cli grant my-script LA-AAAA-BBBB LA-CCCC-DDDD # several at once (Studio)
63
+ npx @heylatch/cli revoke my-script LA-7K2M-9QXD
64
+ npx @heylatch/cli access my-script
65
+ ```
66
+
67
+ Add `--json` to any command for machine-readable output. Commands exit with code 1 on failure.
68
+
69
+ ## Use it from an AI agent
70
+
71
+ Tell your agent to read the guide. It covers the whole setup, from preparing packages to installing on a server:
72
+
73
+ ```
74
+ Read https://heylatch.app/agents.md and use it to set up Latch for this project.
75
+ ```
76
+
77
+ The same guide ships with the package: `latch guide`, or the MCP tool `get_guide`.
78
+
79
+ ### MCP
80
+
81
+ Claude Code:
82
+
83
+ ```sh
84
+ claude mcp add latch -e LATCH_API_KEY=ltk_your_key -- npx -y @heylatch/cli mcp
85
+ ```
86
+
87
+ Cursor, Claude Desktop and other MCP clients:
88
+
89
+ ```json
90
+ {
91
+ "mcpServers": {
92
+ "latch": {
93
+ "command": "npx",
94
+ "args": ["-y", "@heylatch/cli", "mcp"],
95
+ "env": { "LATCH_API_KEY": "ltk_your_key" }
96
+ }
97
+ }
98
+ }
99
+ ```
100
+
101
+ Tools: `get_guide`, `whoami`, `list_scripts`, `get_script`, `preview_package`, `publish_version`, `publish_all`, `pull_version`, `get_version_status`, `withdraw_version`, `list_access`, `grant_access`, `revoke_access`, `list_activations`, `list_flags`, `resolve_flag`.
102
+
103
+ ## GitHub Actions
104
+
105
+ ```yaml
106
+ # on a tag like v1.2.0
107
+ - run: npx -y @heylatch/cli publish ./dist --script my-script --version "${GITHUB_REF_NAME#v}"
108
+ env:
109
+ LATCH_API_KEY: ${{ secrets.LATCH_API_KEY }}
110
+ ```
111
+
112
+ Docs: https://heylatch.app/docs/automation · API reference: https://heylatch.app/docs/api