@sys9/smith9-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.
package/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # @sys9/smith9-cli
2
+
3
+ Install:
4
+
5
+ ```sh
6
+ npm install -g @sys9/smith9-cli
7
+ ```
8
+
9
+ ```sh
10
+ bun install -g @sys9/smith9-cli
11
+ ```
12
+
13
+ The installed `smith9` launcher is a POSIX shell wrapper around the bundled
14
+ native binary, so `bun install -g` works even when `node` is not present.
15
+ This package only supports Linux/macOS on `x64`/`arm64`; npm metadata rejects Windows.
16
+
17
+ Run:
18
+
19
+ ```sh
20
+ smith9 auth login \
21
+ --endpoint https://<your-smith9-endpoint> \
22
+ --ak ak-... \
23
+ --sk sk-...
24
+ ```
package/bin/smith9 ADDED
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env sh
2
+
3
+ set -eu
4
+
5
+ resolve_script_path() {
6
+ script_path="$1"
7
+ while [ -L "$script_path" ]; do
8
+ link_target="$(readlink "$script_path")"
9
+ case "$link_target" in
10
+ /*) script_path="$link_target" ;;
11
+ *) script_path="$(dirname "$script_path")/$link_target" ;;
12
+ esac
13
+ done
14
+ printf '%s\n' "$script_path"
15
+ }
16
+
17
+ script_path="$(resolve_script_path "$0")"
18
+ script_dir="$(CDPATH= cd "$(dirname "$script_path")" && pwd)"
19
+
20
+ uname_s="$(uname -s)"
21
+ uname_m="$(uname -m)"
22
+
23
+ case "$uname_s" in
24
+ Linux)
25
+ case "$uname_m" in
26
+ x86_64|amd64) target_triple="x86_64-unknown-linux-musl" ;;
27
+ aarch64|arm64) target_triple="aarch64-unknown-linux-musl" ;;
28
+ *)
29
+ echo "Unsupported architecture: $uname_m" >&2
30
+ exit 1
31
+ ;;
32
+ esac
33
+ ;;
34
+ Darwin)
35
+ case "$uname_m" in
36
+ x86_64|amd64) target_triple="x86_64-apple-darwin" ;;
37
+ arm64|aarch64) target_triple="aarch64-apple-darwin" ;;
38
+ *)
39
+ echo "Unsupported architecture: $uname_m" >&2
40
+ exit 1
41
+ ;;
42
+ esac
43
+ ;;
44
+ *)
45
+ echo "Unsupported platform: $uname_s ($uname_m)" >&2
46
+ exit 1
47
+ ;;
48
+ esac
49
+
50
+ binary_path="${script_dir}/../vendor/${target_triple}/smith9/smith9"
51
+ if [ ! -x "$binary_path" ]; then
52
+ echo "Bundled smith9 binary not found at ${binary_path}" >&2
53
+ exit 1
54
+ fi
55
+
56
+ exec "$binary_path" "$@"
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@sys9/smith9-cli",
3
+ "version": "0.1.0",
4
+ "description": "smith9 CLI with bundled native binaries for Linux and macOS",
5
+ "license": "MIT",
6
+ "bin": {
7
+ "smith9": "bin/smith9"
8
+ },
9
+ "os": [
10
+ "darwin",
11
+ "linux"
12
+ ],
13
+ "cpu": [
14
+ "arm64",
15
+ "x64"
16
+ ],
17
+ "files": [
18
+ "bin",
19
+ "vendor",
20
+ "README.md"
21
+ ],
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://github.com/sys9-ai/smith9.git",
28
+ "directory": "npm"
29
+ }
30
+ }