跳到主要内容

安装 Shoplazza CLI

本指南介绍如何在 macOS、Windows 或 Linux 上安装 Shoplazza CLI

系统要求

依赖版本
Node.js18.0.0 或更高
Git建议最新版
提示

Node.js 仅在扩展开发(Checkout 扩展、Theme 扩展)时需要。如果只使用 API 命令和快捷命令,独立二进制文件无需 Node.js。

通过 npm 安装(推荐)

npm install -g shoplazza-cli

通过脚本安装(macOS / Linux)

curl -fsSL https://raw.githubusercontent.com/shoplazza/shoplazza-cli/main/install.sh | bash

脚本会自动检测操作系统和架构,下载对应的二进制文件并放置在 /usr/local/bin

安装指定版本:

curl -fsSL https://raw.githubusercontent.com/shoplazza/shoplazza-cli/main/install.sh | bash -s -- --version v2.0.0

从 GitHub Releases 安装

GitHub Releases 页面下载对应平台的预编译二进制文件。

平台架构文件名
macOSIntel (x86_64)shoplazza-cli_darwin_amd64.tar.gz
macOSApple Silicon (arm64)shoplazza-cli_darwin_arm64.tar.gz
Linuxx86_64shoplazza-cli_linux_amd64.tar.gz
Linuxarm64shoplazza-cli_linux_arm64.tar.gz
Windowsx86_64shoplazza-cli_windows_amd64.zip

下载后解压并移动到 PATH 目录:

tar -xzf shoplazza-cli_darwin_arm64.tar.gz
sudo mv shoplazza /usr/local/bin/

验证安装

shoplazza version

Shell 自动补全

# Bash
shoplazza completion bash > /etc/bash_completion.d/shoplazza

# Zsh
shoplazza completion zsh > "${fpath[1]}/_shoplazza"

# Fish
shoplazza completion fish > ~/.config/fish/completions/shoplazza.fish

# PowerShell
shoplazza completion powershell > shoplazza.ps1

升级

# npm
npm update -g shoplazza-cli

# 脚本(重新执行安装脚本)
curl -fsSL https://raw.githubusercontent.com/shoplazza/shoplazza-cli/main/install.sh | bash

下一步