@heylatch/cli 0.0.0-stage → 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 +71 -3
- package/dist/latch.js +121 -0
- package/package.json +40 -6
package/README.md
CHANGED
|
@@ -1,3 +1,71 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
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:
|
|
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`. Folders are zipped without `.git` and `.env` files.
|
|
25
|
+
The first publish of a new script also needs `--name`, `--description` and `--ecosystem hogwartsmp|kcdc|hytale`.
|
|
26
|
+
|
|
27
|
+
## Manage access
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
npx @heylatch/cli grant my-script LA-7K2M-9QXD # safe to retry
|
|
31
|
+
npx @heylatch/cli grant my-script LA-AAAA-BBBB LA-CCCC-DDDD # several at once (Studio)
|
|
32
|
+
npx @heylatch/cli revoke my-script LA-7K2M-9QXD
|
|
33
|
+
npx @heylatch/cli access my-script
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Add `--json` to any command for machine-readable output. Commands exit with code 1 on failure.
|
|
37
|
+
|
|
38
|
+
## Use it from an AI agent (MCP)
|
|
39
|
+
|
|
40
|
+
Claude Code:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
claude mcp add latch -e LATCH_API_KEY=ltk_your_key -- npx -y @heylatch/cli mcp
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Cursor, Claude Desktop and other MCP clients:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"mcpServers": {
|
|
51
|
+
"latch": {
|
|
52
|
+
"command": "npx",
|
|
53
|
+
"args": ["-y", "@heylatch/cli", "mcp"],
|
|
54
|
+
"env": { "LATCH_API_KEY": "ltk_your_key" }
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Tools: `whoami`, `list_scripts`, `get_script`, `preview_package`, `publish_version`, `get_version_status`, `withdraw_version`, `list_access`, `grant_access`, `revoke_access`, `list_activations`, `list_flags`, `resolve_flag`.
|
|
61
|
+
|
|
62
|
+
## GitHub Actions
|
|
63
|
+
|
|
64
|
+
```yaml
|
|
65
|
+
# on a tag like v1.2.0
|
|
66
|
+
- run: npx -y @heylatch/cli publish ./dist --script my-script --version "${GITHUB_REF_NAME#v}"
|
|
67
|
+
env:
|
|
68
|
+
LATCH_API_KEY: ${{ secrets.LATCH_API_KEY }}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Docs: https://heylatch.app/docs/automation · API reference: https://heylatch.app/docs/api
|