Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 7 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,50 +22,20 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node: [20, 22, 24]
node: [22, 24]
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
persist-credentials: false

# pnpm 11 cannot run on node 20 (it requires node >= 22.13), so the
# node 20 jobs need the standalone build, which bundles its own
# runtime while project scripts still run on the matrix node. Both
# pnpm/action-setup standalone mode and `npm i -g @pnpm/exe` are
# broken for 11.13.0 — the @pnpm/* platform packages on npm were
# published without their binary (pnpm/action-setup#277) — so fetch
# the standalone binary straight from the GitHub release, versioned
# by package.json's packageManager field.
- name: Setup pnpm (standalone binary)
shell: bash
run: |
version="$(node -p "require('./package.json').packageManager.split('@').pop()")"
case "${RUNNER_OS}-${RUNNER_ARCH}" in
Linux-X64) asset="pnpm-linux-x64.tar.gz" ;;
Linux-ARM64) asset="pnpm-linux-arm64.tar.gz" ;;
macOS-ARM64) asset="pnpm-darwin-arm64.tar.gz" ;;
Windows-X64) asset="pnpm-win32-x64.zip" ;;
Windows-ARM64) asset="pnpm-win32-arm64.zip" ;;
*) echo "no pnpm standalone asset for ${RUNNER_OS}-${RUNNER_ARCH}" >&2; exit 1 ;;
esac
dest="${RUNNER_TEMP}/pnpm-standalone"
mkdir -p "$dest"
cd "$dest"
curl -fsSL --retry 3 -o "$asset" \
"https://github.com/pnpm/pnpm/releases/download/v${version}/${asset}"
if [[ "$asset" == *.zip ]]; then
powershell.exe -NoProfile -Command "Expand-Archive -Path '${asset}' -DestinationPath '.' -Force"
else
tar -xzf "$asset"
chmod +x pnpm
fi
rm "$asset"
./pnpm --version
echo "$dest" >> "$GITHUB_PATH"
# Must precede setup-node so its `cache: 'pnpm'` can find the binary.
# Version comes from package.json's packageManager field.
- name: Setup pnpm
uses: pnpm/action-setup@v6

- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ the actual downloading is performed by Motrix.

## Requirements

- **Node.js ≥ 20**
- **Node.js ≥ 22**
- A reachable, running **Motrix** instance (desktop app or server).

## Installation
Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CLI 是**客户端,而非下载引擎**——它自己不下载任何东西。

## 环境要求

- **Node.js ≥ 20**
- **Node.js ≥ 22**
- 一个可访问的、正在运行的 **Motrix** 实例(桌面端 app 或 server)。

## 安装
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@motrix/cli",
"version": "0.3.0",
"version": "0.4.0",
"description": "Command-line client for the Motrix download manager — speaks MDXP (JSON-RPC 2.0) to a running Motrix, for humans and AI agents.",
"license": "MIT",
"author": "Motrix",
Expand Down Expand Up @@ -28,7 +28,7 @@
"motrix": "dist/bin/motrix.js"
},
"engines": {
"node": ">=20"
"node": ">=22"
},
"files": [
"dist",
Expand Down
2 changes: 1 addition & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default defineConfig({
dts: false,
splitting: false,
clean: true,
target: 'node20',
target: 'node22',
platform: 'node',
// @motrix/mdxp is published on npm, but we inline it into the built CLI
// (a devDependency, not a runtime one) so the artifact stays self-contained
Expand Down