myclaude-code 8.8.8
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 +925 -0
- package/dist/cli.js +16667 -0
- package/install.sh +87 -0
- package/package.json +39 -0
package/install.sh
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
REPO="${MYCLAUDE_REPO:-mycode699/myclaude-code}"
|
|
5
|
+
INSTALL_ROOT="${MYCLAUDE_INSTALL_ROOT:-$HOME/.local/share/myclaude}"
|
|
6
|
+
BIN_DIR="${MYCLAUDE_BIN_DIR:-$HOME/.local/bin}"
|
|
7
|
+
VERSION_INPUT="${1:-${MYCLAUDE_VERSION:-latest}}"
|
|
8
|
+
|
|
9
|
+
need_cmd() {
|
|
10
|
+
if ! command -v "$1" >/dev/null 2>&1; then
|
|
11
|
+
printf 'Missing required command: %s\n' "$1" >&2
|
|
12
|
+
exit 1
|
|
13
|
+
fi
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
detect_version() {
|
|
17
|
+
if [[ "$VERSION_INPUT" != "latest" ]]; then
|
|
18
|
+
printf '%s' "${VERSION_INPUT#v}"
|
|
19
|
+
return 0
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest" \
|
|
23
|
+
| sed -n 's/.*"tag_name"[[:space:]]*:[[:space:]]*"v\([^"]*\)".*/\1/p' \
|
|
24
|
+
| head -n 1
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
check_node() {
|
|
28
|
+
need_cmd node
|
|
29
|
+
|
|
30
|
+
local node_major
|
|
31
|
+
node_major="$(node -p "process.versions.node.split('.')[0]")"
|
|
32
|
+
if [[ -z "$node_major" || "$node_major" -lt 18 ]]; then
|
|
33
|
+
printf 'myclaude requires Node.js 18 or newer. Found: %s\n' "$(node -v)" >&2
|
|
34
|
+
exit 1
|
|
35
|
+
fi
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
main() {
|
|
39
|
+
need_cmd curl
|
|
40
|
+
need_cmd tar
|
|
41
|
+
need_cmd sed
|
|
42
|
+
check_node
|
|
43
|
+
|
|
44
|
+
case "$(uname -s)" in
|
|
45
|
+
Darwin|Linux) ;;
|
|
46
|
+
*)
|
|
47
|
+
printf 'This installer currently supports macOS and Linux only.\n' >&2
|
|
48
|
+
exit 1
|
|
49
|
+
;;
|
|
50
|
+
esac
|
|
51
|
+
|
|
52
|
+
local version
|
|
53
|
+
version="$(detect_version)"
|
|
54
|
+
if [[ -z "$version" ]]; then
|
|
55
|
+
printf 'Unable to determine the myclaude release version from %s.\n' "$REPO" >&2
|
|
56
|
+
exit 1
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
local asset="myclaude-v${version}-node.tar.gz"
|
|
60
|
+
local download_url="https://github.com/${REPO}/releases/download/v${version}/${asset}"
|
|
61
|
+
local tmp_dir
|
|
62
|
+
tmp_dir="$(mktemp -d)"
|
|
63
|
+
trap 'rm -rf "$tmp_dir"' EXIT
|
|
64
|
+
|
|
65
|
+
printf 'Downloading myclaude %s...\n' "$version"
|
|
66
|
+
curl -fL "$download_url" -o "$tmp_dir/$asset"
|
|
67
|
+
|
|
68
|
+
tar -xzf "$tmp_dir/$asset" -C "$tmp_dir"
|
|
69
|
+
|
|
70
|
+
mkdir -p "$INSTALL_ROOT/versions" "$BIN_DIR"
|
|
71
|
+
rm -rf "$INSTALL_ROOT/versions/$version"
|
|
72
|
+
mv "$tmp_dir/myclaude" "$INSTALL_ROOT/versions/$version"
|
|
73
|
+
|
|
74
|
+
ln -sfn "$INSTALL_ROOT/versions/$version" "$INSTALL_ROOT/current"
|
|
75
|
+
ln -sfn "$INSTALL_ROOT/current/bin/myclaude" "$BIN_DIR/myclaude"
|
|
76
|
+
|
|
77
|
+
printf 'Installed myclaude %s to %s\n' "$version" "$INSTALL_ROOT/current"
|
|
78
|
+
|
|
79
|
+
if [[ ":$PATH:" != *":$BIN_DIR:"* ]]; then
|
|
80
|
+
printf 'Add %s to your PATH if needed:\n' "$BIN_DIR"
|
|
81
|
+
printf ' export PATH="%s:$PATH"\n' "$BIN_DIR"
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
"$BIN_DIR/myclaude" --version || true
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
main "$@"
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "myclaude-code",
|
|
3
|
+
"version": "8.8.8",
|
|
4
|
+
"description": "myclaude v8.8.8 - 我的code · 第一版",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"myclaude": "dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/cli.js",
|
|
11
|
+
"README.md",
|
|
12
|
+
"install.sh"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/mycode699/myclaude-code",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/mycode699/myclaude-code/issues"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/mycode699/myclaude-code.git"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"prepare-src": "node scripts/prepare-src.mjs",
|
|
27
|
+
"build": "npm run prepare-src && node scripts/build.mjs",
|
|
28
|
+
"check": "npm run prepare-src && tsc --noEmit",
|
|
29
|
+
"start": "node dist/cli.js",
|
|
30
|
+
"package:release": "node scripts/package-release.mjs"
|
|
31
|
+
},
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=18.0.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"esbuild": "^0.27.4",
|
|
37
|
+
"typescript": "^6.0.2"
|
|
38
|
+
}
|
|
39
|
+
}
|