克劳利云CLI
官方 CLI 工具用于 克劳利云。 。 。 .
管理 Crawlee Cloud 资源, 部署演员, 从终端直接查看日志 .
安装
npm install -g @crawlee-cloud/cli
或直接使用 npx :
npx @crawlee-cloud/cli <command>
使用量
crawlee-cloud <command> [options]
# Alias
crc <command> [options]
图标
login- 登录您的 Crawlee 云账户( 支持)--profile(多环境设置)info- 显示活动配置文件、 API URL、 服务器状态和认证用户profile- 管理已保存的登录配置文件( E)list, (中文(简体) ),use, (中文(简体) ),rm(中文(简体) )init- 脚手架从一个认证模板中推出一个新的演员项目push- 向云层部署一个演员run- 在当地运行一个演员call- 在平台上运行一个演员(可选)--wait(中文(简体) )list- 列出演员和运行logs- 流出运行中的演员的日志status- 检查运行状态dev- 在当地运行一个演员,热重装
示例
# Login
crc login
# Push the current directory as an Actor (name comes from .actor/actor.json)
crc push
# Run the Actor
crc call my-actor
配置
连接到您的 Crawlee Cloud 服务器 :
# Login to your server
crc login --url https://your-server.com
你会因为你的API信使而被激怒的 全权证书存于 ~/.crawlee-cloud/config.json。 。 。 .
简介(多环境)
在本地、中转和生产之间切换有命名的剖面图。 每个配置文件都持有自己的API URL + 令牌.
# Save credentials under a named profile
crc login --profile local --url http://localhost:3000 --token <T>
crc login --profile staging --url https://crc.staging.com --token <T>
crc login --profile prod --url https://crc.prod.com --token <T>
# List all profiles (active marked with *)
crc profile list
# Switch the active profile
crc profile use staging
# Remove a profile
crc profile rm staging
# Check what's currently active and reachable
crc info
crc info --json # for scripts / CI healthchecks
对于不改变活动配置文件的每次调用操作,请使用 CRAWLEE_CLOUD_PROFILE (原始内容存档于2018-09-21) (英语). env var:
CRAWLEE_CLOUD_PROFILE=prod crc push # one-off push to prod, no `profile use` needed
crc info 如果服务器无法到达或信使无效, 则退出非零, 使其在之前适合作为 CI 门 crc push数字 :
crc info --json >/dev/null && crc push
环境变量
| 变量 | 说明 |
|---|---|
CRAWLEE_CLOUD_API_URL | 覆盖活动配置文件的 API 基础 URL |
CRAWLEE_CLOUD_TOKEN | 覆盖活动配置文件的 API 令牌 |
CRAWLEE_CLOUD_PROFILE | 覆盖此引用的当前配置文件名称 |
CRAWLEE_CLOUD_REGISTRY_URL | 嵌入器注册 URL crc push 用于图像推, 可选 |
GHCR_TOKEN | GitHub 集装箱登记标志 crc push --ghcr 路径 |
GHCR_USER | GHCR 用户名 crc push --ghcr (默认 : github(中文(简体) ) |
文档
欲获取完整文件,请访问 Crawlee 云文档。 。 。 .
出版(维护者)
CLI 发布为 npm @crawlee-cloud/cli 自动当 a v* 标记被推入回波,通过 .github/workflows/publish-cli.yml。 。 。 .
发行流量为:
- 打开 a
chore(release): vX.Y.Z公关撞出 全部5个 工作空间package.json文件(root + api + cli + 仪表板 + 跑取器)和锁口文件. - 合并它.
- 标记合并承诺
vX.Y.Z并按下标签. - 发布工作流程验证标记匹配
packages/cli/package.json,通过 npm 信任的出版建立并用出处出版(否)NPM_TOKEN需要保密).
手动发布( 逃生舱口—— 只有在工作流程被打破时使用 ) :
cd packages/cli
npm login # interactive
npm publish --access public # `prepack` builds dist/ automatically