@zenku/cli 0.1.6 → 0.1.7
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 +41 -3
- package/install.sh +67 -0
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -4,22 +4,60 @@ Multi-service CLI for managing PocketBase-backed applications from the terminal.
|
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
+
### npm (requires Node.js)
|
|
8
|
+
|
|
7
9
|
```bash
|
|
8
10
|
npm install -g @zenku/cli
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
### Shell script (no Node.js required)
|
|
14
|
+
|
|
15
|
+
Downloads the standalone binary to `/usr/local/bin` (override with `ZENKU_INSTALL_DIR`):
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
curl -fsSL https://unpkg.com/@zenku/cli/install.sh | sh
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### npx (no install, runs latest)
|
|
12
22
|
|
|
13
23
|
```bash
|
|
14
24
|
npx @zenku/cli --help
|
|
15
25
|
```
|
|
16
26
|
|
|
17
|
-
|
|
27
|
+
## Update
|
|
28
|
+
|
|
29
|
+
### npm
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm update -g @zenku/cli
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Shell script
|
|
36
|
+
|
|
37
|
+
Re-run the install command — it overwrites the existing binary:
|
|
18
38
|
|
|
19
39
|
```bash
|
|
20
|
-
curl -fsSL https://
|
|
40
|
+
curl -fsSL https://unpkg.com/@zenku/cli/install.sh | sh
|
|
21
41
|
```
|
|
22
42
|
|
|
43
|
+
## Uninstall
|
|
44
|
+
|
|
45
|
+
### npm
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npm uninstall -g @zenku/cli
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Shell script
|
|
52
|
+
|
|
53
|
+
Remove the binary from where it was installed:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
rm /usr/local/bin/zenku
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
If you used a custom `ZENKU_INSTALL_DIR`, remove it from there instead.
|
|
60
|
+
|
|
23
61
|
## Features
|
|
24
62
|
|
|
25
63
|
- **Profile Management** — Named connection profiles pointing to PocketBase instances and service APIs
|
package/install.sh
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
INSTALL_DIR="${ZENKU_INSTALL_DIR:-/usr/local/bin}"
|
|
5
|
+
SCOPE="@zenku"
|
|
6
|
+
|
|
7
|
+
get_platform() {
|
|
8
|
+
os=$(uname -s | tr '[:upper:]' '[:lower:]')
|
|
9
|
+
arch=$(uname -m)
|
|
10
|
+
|
|
11
|
+
case "$os" in
|
|
12
|
+
darwin) ;;
|
|
13
|
+
linux) ;;
|
|
14
|
+
*)
|
|
15
|
+
echo "Error: Unsupported OS: $os" >&2
|
|
16
|
+
echo "Supported: darwin, linux" >&2
|
|
17
|
+
exit 1
|
|
18
|
+
;;
|
|
19
|
+
esac
|
|
20
|
+
|
|
21
|
+
case "$arch" in
|
|
22
|
+
x86_64|amd64) arch="x64" ;;
|
|
23
|
+
aarch64|arm64) arch="arm64" ;;
|
|
24
|
+
*)
|
|
25
|
+
echo "Error: Unsupported architecture: $arch" >&2
|
|
26
|
+
echo "Supported: x64, arm64" >&2
|
|
27
|
+
exit 1
|
|
28
|
+
;;
|
|
29
|
+
esac
|
|
30
|
+
|
|
31
|
+
echo "${os}-${arch}"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
main() {
|
|
35
|
+
platform=$(get_platform)
|
|
36
|
+
pkg_name="cli-${platform}"
|
|
37
|
+
full_name="${SCOPE}/${pkg_name}"
|
|
38
|
+
|
|
39
|
+
echo "Installing zenku for ${platform}..."
|
|
40
|
+
|
|
41
|
+
version=$(curl -fsSL "https://registry.npmjs.org/${full_name}/latest" | grep -o '"version":"[^"]*"' | head -1 | cut -d'"' -f4)
|
|
42
|
+
if [ -z "$version" ]; then
|
|
43
|
+
echo "Error: Could not fetch latest version of ${full_name}" >&2
|
|
44
|
+
echo "Is the package published? Check: https://www.npmjs.com/package/${full_name}" >&2
|
|
45
|
+
exit 1
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
tarball_name="${pkg_name}-${version}.tgz"
|
|
49
|
+
url="https://registry.npmjs.org/${full_name}/-/${tarball_name}"
|
|
50
|
+
|
|
51
|
+
tmpdir=$(mktemp -d)
|
|
52
|
+
trap 'rm -rf "$tmpdir"' EXIT
|
|
53
|
+
|
|
54
|
+
curl -fsSL "$url" -o "${tmpdir}/${tarball_name}"
|
|
55
|
+
tar xzf "${tmpdir}/${tarball_name}" -C "$tmpdir"
|
|
56
|
+
|
|
57
|
+
if [ ! -w "$INSTALL_DIR" ]; then
|
|
58
|
+
echo "Need sudo to install to ${INSTALL_DIR}"
|
|
59
|
+
sudo install -m 755 "${tmpdir}/package/zenku" "${INSTALL_DIR}/zenku"
|
|
60
|
+
else
|
|
61
|
+
install -m 755 "${tmpdir}/package/zenku" "${INSTALL_DIR}/zenku"
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
echo "Installed zenku v${version} to ${INSTALL_DIR}/zenku"
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
main
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenku/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Zenku CLI — manage PocketBase services from the terminal.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"bin": {
|
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"bin",
|
|
11
|
+
"install.sh",
|
|
11
12
|
"LICENSE",
|
|
12
13
|
"README.md"
|
|
13
14
|
],
|
|
14
15
|
"optionalDependencies": {
|
|
15
|
-
"@zenku/cli-darwin-arm64": "0.1.
|
|
16
|
-
"@zenku/cli-darwin-x64": "0.1.
|
|
17
|
-
"@zenku/cli-linux-arm64": "0.1.
|
|
18
|
-
"@zenku/cli-linux-x64": "0.1.
|
|
16
|
+
"@zenku/cli-darwin-arm64": "0.1.7",
|
|
17
|
+
"@zenku/cli-darwin-x64": "0.1.7",
|
|
18
|
+
"@zenku/cli-linux-arm64": "0.1.7",
|
|
19
|
+
"@zenku/cli-linux-x64": "0.1.7"
|
|
19
20
|
}
|
|
20
21
|
}
|