mercury-tech-cli 1.0.0-beta.2

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/LICENSE.md ADDED
@@ -0,0 +1,2 @@
1
+ This package is an installer for Mercury. Mercury and this installer are
2
+ distributed under the licence at https://github.com/Whq02/MercuryCLI/blob/main/LICENSE.md.
package/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # mercury-tech-cli
2
+
3
+ The `mercury` command from npm or bun.
4
+
5
+ ```sh
6
+ bun install -g mercury-tech-cli # or: npm install -g mercury-tech-cli
7
+ mercury
8
+ ```
9
+
10
+ Mercury runs on its own bundled runtime, never on npm's or bun's engine. The
11
+ first `mercury` run downloads the release archive for your machine from
12
+ [GitHub Releases](https://github.com/Whq02/MercuryCLI/releases), verifies its
13
+ SHA-256, and runs the archive's own user-local installer (no administrator
14
+ access: `~/.mercury/versions/` and `~/.local/bin/mercury`). Later runs go
15
+ straight to the installed command; `mercury update` moves between versions.
16
+
17
+ macOS and Linux. On Windows use PowerShell:
18
+
19
+ ```powershell
20
+ irm https://mercury-cli.ai/install.ps1 | iex
21
+ ```
22
+
23
+ Website: https://mercury-cli.ai · Source and issues: https://github.com/Whq02/MercuryCLI
package/bin/mercury ADDED
@@ -0,0 +1,55 @@
1
+ #!/bin/sh
2
+ # mercury-tech-cli — the `mercury` command from npm or bun.
3
+ #
4
+ # Mercury runs on its own bundled runtime, never on npm's or bun's engine, so
5
+ # this file is a plain shell script: on first run it downloads the release
6
+ # archive for this machine from GitHub Releases, verifies its SHA-256, and
7
+ # runs the archive's own `mercury install` (user-local, no administrator
8
+ # access: ~/.mercury/versions/ + ~/.local/bin/mercury). Every later run
9
+ # hands straight to the installed command. Rerunning is safe.
10
+ set -eu
11
+ PKG_VERSION="1.0.0-beta.2"
12
+ REPO="Whq02/MercuryCLI"
13
+ home=${MERCURY_CONFIG_DIR:-"$HOME/.mercury"}
14
+ current="$home/versions/current.txt"
15
+ installed=""
16
+ if [ -f "$current" ]; then installed=$(head -1 "$current" 2>/dev/null | tr -d '[:space:]'); fi
17
+ stable="$HOME/.local/bin/mercury"
18
+
19
+ if [ "$installed" = "$PKG_VERSION" ] && [ -x "$stable" ]; then
20
+ exec "$stable" "$@"
21
+ fi
22
+ if [ -n "$installed" ] && [ -x "$stable" ] && [ "${MERCURYCLI_PIN:-}" != "1" ]; then
23
+ # A different version is installed and active: run it — `mercury update`
24
+ # moves versions; this package never downgrades what you have. Set
25
+ # MERCURYCLI_PIN=1 to force this package's version.
26
+ exec "$stable" "$@"
27
+ fi
28
+
29
+ die() { printf 'mercury: %s\n' "$*" >&2; exit 1; }
30
+ command -v curl >/dev/null 2>&1 || die "first run needs 'curl'"
31
+ command -v tar >/dev/null 2>&1 || die "first run needs 'tar'"
32
+ os=$(uname -s); arch=$(uname -m)
33
+ case "$os/$arch" in
34
+ Darwin/arm64) target=macos-arm64 ;;
35
+ Darwin/x86_64) die "no Intel Mac build in this release (Apple silicon, Linux x64 and Windows x64 ship) — build from source: https://github.com/$REPO" ;;
36
+ Linux/x86_64|Linux/amd64) target=linux-x64 ;;
37
+ *) die "no build for $os $arch — Windows: irm https://mercury-cli.ai/install.ps1 | iex ; others: build from source at https://github.com/$REPO" ;;
38
+ esac
39
+ version="v$PKG_VERSION"
40
+ asset="mercury-$version-$target.tar.gz"
41
+ base=${MERCURY_INSTALL_BASE_URL:-"https://github.com/$REPO/releases/download/$version"}
42
+ tmp=$(mktemp -d "${TMPDIR:-/tmp}/mercury-tech-cli.XXXXXX")
43
+ trap 'rm -rf "$tmp"' EXIT
44
+ printf 'mercury: first run — installing Mercury %s for %s\n' "$version" "$target" >&2
45
+ curl -fsSL --retry 3 -o "$tmp/$asset" "$base/$asset" || die "download failed: $base/$asset"
46
+ curl -fsSL --retry 3 -o "$tmp/SHA256SUMS.txt" "$base/SHA256SUMS.txt" || die "download failed: $base/SHA256SUMS.txt"
47
+ want=$(grep " $asset\$" "$tmp/SHA256SUMS.txt" | awk '{print $1}' | head -1)
48
+ [ -n "$want" ] || die "$asset is not listed in SHA256SUMS.txt"
49
+ if command -v sha256sum >/dev/null 2>&1; then got=$(sha256sum "$tmp/$asset" | awk '{print $1}'); else got=$(shasum -a 256 "$tmp/$asset" | awk '{print $1}'); fi
50
+ [ "$got" = "$want" ] || die "checksum mismatch for $asset — nothing installed"
51
+ tar -xzf "$tmp/$asset" -C "$tmp"
52
+ [ -x "$tmp/mercury/mercury" ] || die "the archive has no launcher"
53
+ "$tmp/mercury/mercury" install >&2
54
+ [ -x "$stable" ] || die "installed, but $stable is missing — run: $tmp/mercury/mercury install --force"
55
+ exec "$stable" "$@"
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "mercury-tech-cli",
3
+ "version": "1.0.0-beta.2",
4
+ "description": "Mercury \u2014 a terminal harness for software development. This package installs Mercury's own runtime on first run; it never runs Mercury on npm's or bun's engine.",
5
+ "homepage": "https://mercury-cli.ai",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/Whq02/MercuryCLI.git"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/Whq02/MercuryCLI/issues"
12
+ },
13
+ "license": "SEE LICENSE IN LICENSE.md",
14
+ "bin": {
15
+ "mercury": "bin/mercury"
16
+ },
17
+ "os": [
18
+ "darwin",
19
+ "linux"
20
+ ],
21
+ "files": [
22
+ "bin",
23
+ "README.md",
24
+ "LICENSE.md"
25
+ ],
26
+ "keywords": [
27
+ "mercury",
28
+ "cli",
29
+ "terminal",
30
+ "agent",
31
+ "harness"
32
+ ]
33
+ }