@amplitude/ampli

中文文档
1.36.6发布于 2026/07/11UNLICENSEDTypeScriptCommonJS近 30 天下载 80.7万

振幅 CLI

中文使用文档
文档目录14 节
  1. ampli autocomplete [SHELL]
  2. ampli branch
  3. ampli checkout [<branch>]
  4. ampli configure [--deprecated-runtimes]
  5. ampli help [COMMAND]
  6. ampli init
  7. ampli login
  8. ampli logout
  9. ampli pull [<source>] [-p <path>] [-b <branch>]
  10. ampli refresh
  11. ampli setup
  12. ampli source
  13. ampli status
  14. ampli whoami

语义

振幅 CLI

oclif Version Downloads/week License

所需资源

高度 CLI 需要节点 12+

使用量

$ npm install -g @amplitude/ampli
$ ampli COMMAND
running command...
$ ampli (-v|--version|version)
@amplitude/ampli/1.36.6 linux-x64 node-v24.18.0
$ ampli --help [COMMAND]
USAGE
  $ ampli COMMAND
...

图标

ampli autocomplete [SHELL]

显示自动完成安装指令

USAGE
  $ ampli autocomplete [SHELL]

ARGUMENTS
  SHELL  shell type

OPTIONS
  -r, --refresh-cache  Refresh cache (ignores displaying instructions)

EXAMPLES
  $ ampli autocomplete
  $ ampli autocomplete bash
  $ ampli autocomplete zsh
  $ ampli autocomplete --refresh-cache

参见代码 : @oclif/ plugin- auto 完成

ampli branch

列出所有分支

USAGE
  $ ampli branch

OPTIONS
  -t, --token=token  personal API token to authenticate with

ampli checkout [<branch>]

检查当前源的分支

USAGE
  $ ampli checkout [<branch>]

OPTIONS
  -t, --token=token      personal API token to authenticate with
  -v, --version=version  the version to checkout

EXAMPLES
  $ ampli checkout develop
  $ ampli checkout

ampli configure [--deprecated-runtimes]

配置并更新源运行时间

USAGE
  $ ampli configure [--deprecated-runtimes]

OPTIONS
  -t, --token=token      personal API token to authenticate with
  --deprecated-runtimes  show deprecated SDK options for source configuration (for Itly users).

EXAMPLES
  $ ampli configure
  $ ampli configure --deprecated-runtimes

ampli help [COMMAND]

显示 anpli 的帮助

USAGE
  $ ampli help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

参见代码 : @oclif/plugin-帮助

ampli init

初始化您的工作空间

USAGE
  $ ampli init

OPTIONS
  -o, --org=org              organization
  -w, --workspace=workspace  workspace
  -z, --zone=us|eu           regional zone
  --user=user                user email

EXAMPLES
  $ ampli init [--org ORGANIZATION] [--workspace WORKSPACE]
  $ ampli init [--user [email protected]]

ampli login

登录到高度

USAGE
  $ ampli login

OPTIONS
  -z, --zone=us|eu  regional zone

EXAMPLE
  $ ampli login

ampli logout

从宽度记录

USAGE
  $ ampli logout

OPTIONS
  -z, --zone=us|eu  regional zone
  --user=user       user email

EXAMPLES
  $ ampli logout
  $ ampli logout --user [email protected]

ampli pull [<source>] [-p <path>] [-b <branch>]

降低最新的跟踪计划并创建跟踪库

USAGE
  $ ampli pull [<source>] [-p <path>] [-b <branch>]

OPTIONS
  -b, --branch=branch    the branch to pull
  -p, --path=path        where the tracking library will be created
  -t, --token=token      personal API token to authenticate with
  -v, --version=version  the version to pull
  --deprecated-runtimes  show deprecated SDK options for source configuration (for Itly users).
  --include-api-keys     include api keys to the tracking library
  --omit-api-keys        omit api keys from the tracking library

EXAMPLES
  $ ampli pull web
  $ ampli pull web -p ./ampli -b develop
  $ ampli pull web -p ./ampli -b develop -v 2.1.1
  $ ampli pull --omit-api-keys web
  $ ampli pull --include-api-keys web
  $ ampli pull --deprecated-runtimes

ampli refresh

刷新当前分支, 并更改主分支

USAGE
  $ ampli refresh

OPTIONS
  -t, --token=token  personal API token to authenticate with

EXAMPLE
  $ ampli refresh

ampli setup

显示当前源代码的设置指令

USAGE
  $ ampli setup

OPTIONS
  -t, --token=token  personal API token to authenticate with

EXAMPLE
  $ ampli setup

ampli source

列出所有来源

USAGE
  $ ampli source

OPTIONS
  -t, --token=token  personal API token to authenticate with

ampli status

校验(lint)您的分析源代码

USAGE
  $ ampli status

OPTIONS
  -b, --branch=branch                enforces source is on provided the branch
  -t, --token=token                  personal API token to authenticate with
  -u, --update                       update tracking plan with latest implementation status
  --instanceNames=instanceNames      Ampli instance name(s) to check
  --is-latest                        check if current version is the latest
  --is-latest-if-not-default-branch  check if current version is the latest (do not check if on default branch)
  --is-merged                        check if current branch/version has been merged into default branch
  --skip-update-on-default-branch    prevents updating implementation status on default branch
  --sourceDirs=sourceDirs            source code location

EXAMPLES
  $ ampli status
  $ ampli status -u
  $ ampli status -b main
  $ ampli status -u --skip-update-on-default-branch
  $ ampli status --sourceDirs ./src ./util
  $ ampli status --is-merged
  $ ampli status --is-latest
  $ ampli status --is-latest-if-not-default-branch
  $ ampli status --instanceNames myAmpliInstanceName ampli itly foo

ampli whoami

显示用户信息

USAGE
  $ ampli whoami

OPTIONS
  -z, --zone=us|eu  regional zone

版本与发布记录

@amplitude/ampli 共发布 66 个版本,首次发布于 2021/10/02;过去 12 个月发布了 4 个版本。

版本发布日期距今
1.36.6latest2026/07/113 个月前
1.36.52026/07/103 个月前
1.36.42026/07/093 个月前
1.36.32026/04/096 个月前
1.36.22025/02/211.7 年前
1.36.12025/02/211.7 年前

关于 @amplitude/ampli 的常见问题

@amplitude/ampli 是什么?

振幅 CLI

如何安装 @amplitude/ampli?

在项目目录运行 npm install @amplitude/ampli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 ampli,可以用 npx ampli 直接运行。

@amplitude/ampli 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@amplitude/ampli 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@amplitude/ampli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=12.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@amplitude/ampli 可以商用吗?

@amplitude/ampli 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@amplitude/ampli 的下载量有多少?

根据 npm 官方下载统计,@amplitude/ampli 在 2026/10/06 – 2026/11/04 这 30 天内被下载 806,874 次,日均约 26,896 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@amplitude/ampli 还在维护吗?

最新版本 1.36.6 发布于 2026/07/11(3 个月前);至今共发布 66 个版本,其中过去 12 个月发布了 4 个;首次发布于 2021/10/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。