getting-started
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGetting Started with Acquia CLI
Acquia CLI 入门指南
This guide covers installation, authentication, and your first commands.
Use when:
- Installing acli for the first time
- Authenticating with Acquia Cloud
- Learning your first acli commands
本指南涵盖安装、认证以及入门命令的使用。
适用于以下场景:
- 首次安装acli
- 登录Acquia Cloud进行认证
- 学习acli入门命令
Tool Overview
工具概述
Two separate CLIs exist for Acquia Cloud operations:
| Tool | Purpose |
|---|---|
| General Cloud management: applications, environments, IDEs, SSH keys, code/DB sync |
| CI/CD pipeline operations: trigger builds, check job status, stream logs |
Use pipelines-cli for anything related to pipeline jobs. Use acli for everything else.
Acquia Cloud操作有两个独立的CLI工具:
| 工具 | 用途 |
|---|---|
| 通用云管理:应用、环境、IDE、SSH密钥、代码/数据库同步 |
| CI/CD流水线操作:触发构建、检查任务状态、流式查看日志 |
所有与流水线任务相关的操作请使用pipelines-cli,其他操作请使用acli。
Installation
安装
macOS & Linux
macOS 与 Linux
Option 1: Native Binary (Recommended)
选项1:原生二进制文件(推荐)
The native binary requires no PHP installation and works on any modern macOS or Linux system.
bash
undefined原生二进制文件无需安装PHP,可在任何现代macOS或Linux系统上运行。
bash
undefinedDownload the latest release
下载最新版本
curl -fsSL https://github.com/acquia/cli/releases/latest/download/acli
-o /usr/local/bin/acli
-o /usr/local/bin/acli
curl -fsSL https://github.com/acquia/cli/releases/latest/download/acli
-o /usr/local/bin/acli
-o /usr/local/bin/acli
Make it executable
设置可执行权限
chmod +x /usr/local/bin/acli
chmod +x /usr/local/bin/acli
Verify it works
验证安装成功
acli --version
undefinedacli --version
undefinedOption 2: PHP Archive (PHAR)
选项2:PHP归档文件(PHAR)
If you prefer or already have PHP 8.2 installed:
bash
curl -fsSL https://github.com/acquia/cli/releases/latest/download/acli.phar \
-o /usr/local/bin/acli.phar
chmod +x /usr/local/bin/acli.phar如果您偏好或已安装PHP 8.2:
bash
curl -fsSL https://github.com/acquia/cli/releases/latest/download/acli.phar \
-o /usr/local/bin/acli.phar
chmod +x /usr/local/bin/acli.pharUse as:
使用方式:
acli.phar --version
acli.phar --version
Or create an alias
或创建别名
alias acli='acli.phar'
undefinedalias acli='acli.phar'
undefinedUsing Homebrew (macOS)
使用Homebrew安装(macOS)
bash
brew tap acquia/cli
brew install acli
acli --versionbash
brew tap acquia/cli
brew install acli
acli --versionYour First Command: Authentication
首个命令:身份认证
Acquia CLI uses OAuth to authenticate with your Acquia account. You'll only need to do this once.
bash
acli auth:loginThis will:
- Open your browser
- Prompt you to authorize Acquia CLI
- Generate an access token
- Store it locally in (encrypted)
~/.acquia/cloud_api/credentials.json
Tokens are valid for 30 days. If your token expires, run again.
acli auth:loginAcquia CLI使用OAuth对您的Acquia账号进行认证,仅需执行一次该操作。
bash
acli auth:login执行该命令会:
- 打开浏览器
- 提示您授权Acquia CLI
- 生成访问令牌
- 将令牌加密存储在本地文件中
~/.acquia/cloud_api/credentials.json
令牌有效期为30天。如果令牌过期,重新运行即可。
acli auth:loginVerify Authentication
验证认证状态
bash
acli auth:meShows your name, email, and account information.
bash
acli auth:me该命令会显示您的姓名、邮箱及账号信息。
Your First Command: List Applications
首个命令:列出应用
See which applications you have access to:
bash
acli api:applications:listOutput:
Select a Cloud Platform application:
[0] My First App (prod, staging, dev)
[1] Client Project (prod, staging)
[2] Development App (dev)查看您有权访问的应用:
bash
acli api:applications:list输出示例:
Select a Cloud Platform application:
[0] My First App (prod, staging, dev)
[1] Client Project (prod, staging)
[2] Development App (dev)Shell Completion
Shell自动补全
Enable tab completion for faster command entry.
启用Tab补全功能以加快命令输入速度。
Bash
Bash
bash
eval "$(acli shell:complete bash)"Add to for permanent setup:
~/.bashrcbash
echo 'eval "$(acli shell:complete bash)"' >> ~/.bashrc
source ~/.bashrcbash
eval "$(acli shell:complete bash)"添加到文件以永久启用:
~/.bashrcbash
echo 'eval "$(acli shell:complete bash)"' >> ~/.bashrc
source ~/.bashrcZsh
Zsh
bash
eval "$(acli shell:complete zsh)"Add to :
~/.zshrcbash
echo 'eval "$(acli shell:complete zsh)"' >> ~/.zshrc
source ~/.zshrcbash
eval "$(acli shell:complete zsh)"添加到文件:
~/.zshrcbash
echo 'eval "$(acli shell:complete zsh)"' >> ~/.zshrc
source ~/.zshrcFish
Fish
bash
acli shell:complete fish | sourceAdd to :
~/.config/fish/config.fishbash
acli shell:complete fish | sourcebash
acli shell:complete fish | source添加到文件:
~/.config/fish/config.fishbash
acli shell:complete fish | sourceGetting Help
获取帮助
Command Help
命令帮助
Every command has a built-in help page:
bash
undefined每个命令都内置帮助页面:
bash
undefinedGeneral help
通用帮助
acli --help
acli -h
acli --help
acli -h
Help for a specific command
特定命令的帮助
acli ide:create --help
acli ide:create -h
acli ide:create --help
acli ide:create -h
List all available commands by category
按分类列出所有可用命令
acli list
undefinedacli list
undefinedVerbose Output
详细输出
For debugging, show detailed output:
bash
undefined如需调试,可显示详细输出:
bash
undefined-v (normal), -vv (detailed), -vvv (very detailed)
-v(普通详细度)、-vv(详细)、-vvv(非常详细)
acli ide:list -vvv
acli ide:create -v
undefinedacli ide:list -vvv
acli ide:create -v
undefinedDebug Mode
调试模式
Run any command in debug mode to see behind-the-scenes details:
bash
acli ide:create --debug在调试模式下运行任意命令以查看幕后细节:
bash
acli ide:create --debugConfiguration
配置
Config File Location
配置文件位置
Configuration is stored at:
~/.acquia/~/.acquia/
├── cloud_api/
│ └── credentials.json # Your API token (encrypted)
├── config.yaml # Settings
└── cache/ # Cached data配置存储在:
~/.acquia/~/.acquia/
├── cloud_api/
│ └── credentials.json # 您的API令牌(已加密)
├── config.yaml # 设置项
└── cache/ # 缓存数据Linking a Local Project
关联本地项目
Run in your project directory to associate it with a Cloud application. See Application Management for details.
acli app:link在项目目录中运行,将其与Cloud应用关联。详情请查看**应用管理**。
acli app:linkCommon First Steps
常见入门步骤
Step 1: Authenticate
步骤1:身份认证
bash
acli auth:login
acli auth:mebash
acli auth:login
acli auth:meStep 2: Set Up a Project
步骤2:设置项目
bash
cd /path/to/project
acli app:linkbash
cd /path/to/project
acli app:linkStep 3: Create an IDE (or connect to existing)
步骤3:创建IDE(或连接现有IDE)
bash
acli ide:create # Create a new onebash
acli ide:create # 创建新IDEOR
或
acli ide:list # Connect to existing
undefinedacli ide:list # 连接现有IDE
undefinedStep 4: Set Up SSH
步骤4:设置SSH
bash
acli ssh-key:list # See your SSH keysbash
acli ssh-key:list # 查看您的SSH密钥If no keys, create one
如果没有密钥,创建一个
acli ssh-key:create
undefinedacli ssh-key:create
undefinedStep 5: Try a Drush Command
步骤5:尝试Drush命令
bash
acli remote:drush status
acli remote:drush cr # Clear cachesbash
acli remote:drush status
acli remote:drush cr # 清除缓存Troubleshooting
故障排除
"Command not found: acli"
"Command not found: acli"
Make sure the binary is in your . Try:
PATHbash
which acli确保二进制文件在您的中。尝试:
PATHbash
which acliIf nothing, add to PATH
如果无输出,添加到PATH
export PATH="/usr/local/bin:$PATH"
acli --version
undefinedexport PATH="/usr/local/bin:$PATH"
acli --version
undefined"Error: Failed to authenticate"
"Error: Failed to authenticate"
Your token has expired or isn't valid. Try:
bash
acli auth:login您的令牌已过期或无效。尝试:
bash
acli auth:login"Error: Access denied"
"Error: Access denied"
You don't have permission to access that application or resource. Check:
- Are you logged in with the right Acquia account?
- Do you have permissions in Acquia Cloud UI?
Run to verify you're using the right account.
acli auth:me您无权访问该应用或资源。检查:
- 您是否使用正确的Acquia账号登录?
- 您在Acquia Cloud UI中是否拥有相应权限?
运行以验证您使用的账号是否正确。
acli auth:meNeed more help?
需要更多帮助?
See Troubleshooting Guide for more issues.
查看**故障排除指南**了解更多问题解决方案。
Acquia Site Factory (ACSF) Authentication
Acquia Site Factory (ACSF) 认证
If your organization uses Acquia Site Factory, register separate credentials:
bash
acli auth:acsf-loginOptions:
bash
acli auth:acsf-login \
--username=myuser \
--key=MY_API_KEY \
--factory-url=https://www.myfactory.comTo log out:
bash
acli auth:acsf-logout如果您的组织使用Acquia Site Factory,请注册单独的凭证:
bash
acli auth:acsf-login可选参数:
bash
acli auth:acsf-login \
--username=myuser \
--key=MY_API_KEY \
--factory-url=https://www.myfactory.com登出命令:
bash
acli auth:acsf-logoutCache Management
缓存管理
Clear local acli caches (useful when commands behave unexpectedly):
bash
acli self:clear-cachesAliases: ,
acli ccacli cr清除本地acli缓存(当命令行为异常时非常有用):
bash
acli self:clear-caches别名:,
acli ccacli crTelemetry
遥测数据
acli collects anonymous usage data by default to help improve the tool. To opt out:
bash
acli self:telemetry:disableTo re-enable:
bash
acli self:telemetry:enableToggle interactively:
bash
acli self:telemetry:toggleAlias:
acli telemetry默认情况下,acli会收集匿名使用数据以帮助改进工具。如需退出:
bash
acli self:telemetry:disable重新启用:
bash
acli self:telemetry:enable交互式切换:
bash
acli self:telemetry:toggle别名:
acli telemetryOpen Product Documentation
打开产品文档
Open Acquia product docs in your browser:
bash
acli docsFor a specific product:
bash
acli docs acli
acli docs cloud-ide在浏览器中打开Acquia产品文档:
bash
acli docs打开特定产品的文档:
bash
acli docs acli
acli docs cloud-ideBest Practices
最佳实践
- Authenticate first — Run before anything else; most commands require it.
acli auth:login - Discover commands — Use to see all available commands grouped by topic.
acli list - Enable shell completion — Run once to get tab-completion for commands and flags.
acli shell:complete - Verify your setup — Run to confirm your authenticated identity and acli version.
acli self:info - Stay updated — Run regularly to get bug fixes and new features.
acli self:update - Clear caches on odd behavior — Run if commands return unexpected results.
acli self:clear-caches
- 先完成认证 — 在执行其他操作前先运行;大多数命令都需要认证。
acli auth:login - 探索命令 — 使用查看所有按主题分组的可用命令。
acli list - 启用Shell自动补全 — 运行一次即可获得命令和参数的Tab补全功能。
acli shell:complete - 验证设置 — 运行确认您的认证身份和acli版本。
acli self:info - 保持更新 — 定期运行以获取bug修复和新功能。
acli self:update - 异常时清除缓存 — 如果命令返回意外结果,运行。
acli self:clear-caches
Next Steps
下一步
Now that you're set up, try:
- Create your first IDE — Set up a development environment
- Explore applications — Learn about your apps
- Set up SSH keys — Secure authentication
完成设置后,您可以尝试:
- 创建首个IDE — 搭建开发环境
- 探索应用 — 了解您的应用
- 设置SSH密钥 — 安全认证