@crawlee-cloud/cli

中文文档
1.7.0发布于 2026/11/09MITTypeScriptES Module构建来源已验证近 30 天下载 2661

CLI for Crawlee Cloud - run and deploy Actors

原始使用文档
文档目录9 节
  1. Installation
  2. Usage
  3. Commands
  4. Example
  5. Configuration
  6. Profiles (multi-environment)
  7. Environment Variables
  8. Documentation
  9. Publishing (maintainers)

Crawlee Cloud CLI

The official CLI tool for Crawlee Cloud.

Manage your Crawlee Cloud resources, deploy Actors, and view logs directly from your terminal.

Installation

npm install -g @crawlee-cloud/cli

Or use directly with npx:

npx @crawlee-cloud/cli <command>

Usage

crawlee-cloud <command> [options]
# Alias
crc <command> [options]

Commands

  • login - Login to your Crawlee Cloud account (supports --profile for multi-environment setups)
  • info - Show the active profile, API URL, server status, and authenticated user
  • profile - Manage saved login profiles (list, use, rm)
  • init - Scaffold a new Actor project from an Apify template
  • push - Deploy an Actor to the cloud
  • run - Run an Actor locally
  • call - Run an Actor on the platform (with optional --wait)
  • list - List actors and runs
  • logs - Stream logs from a running Actor
  • status - Check the status of a run
  • dev - Run an Actor locally with hot reload

Example

# 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

Configuration

Connect to your self-hosted Crawlee Cloud server:

# Login to your server
crc login --url https://your-server.com

You'll be prompted for your API token. Credentials are stored in ~/.crawlee-cloud/config.json.

Profiles (multi-environment)

Switch between local, staging, and production with named profiles. Each profile holds its own API URL + token.

# 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

For per-invocation overrides without changing the active profile, use the CRAWLEE_CLOUD_PROFILE env var:

CRAWLEE_CLOUD_PROFILE=prod crc push    # one-off push to prod, no `profile use` needed

crc info exits non-zero if the server is unreachable or the token is invalid, which makes it suitable as a CI gate before crc push:

crc info --json >/dev/null && crc push

Environment Variables

VariableDescription
CRAWLEE_CLOUD_API_URLOverride the active profile's API base URL
CRAWLEE_CLOUD_TOKENOverride the active profile's API token
CRAWLEE_CLOUD_PROFILEOverride the active profile name for this invocation
CRAWLEE_CLOUD_REGISTRY_URLDocker registry URL used by crc push for image push, optional
GHCR_TOKENGitHub Container Registry token used by the crc push --ghcr path
GHCR_USERGHCR username for crc push --ghcr (default: github)

Documentation

For full documentation, visit the Crawlee Cloud Documentation.

Publishing (maintainers)

The CLI publishes to npm as @crawlee-cloud/cli automatically when a v* tag is pushed to the repo, via .github/workflows/publish-cli.yml.

The release flow is:

  1. Open a chore(release): vX.Y.Z PR that bumps all 5 workspace package.json files (root + api + cli + dashboard + runner) and the lockfile in lockstep.
  2. Merge it.
  3. Tag the merge commit vX.Y.Z and push the tag.
  4. The publish workflow validates that the tag matches packages/cli/package.json, builds, and publishes with provenance via npm trusted publishing (no NPM_TOKEN secret required).

Manual publish (escape hatch — only use if the workflow is broken):

cd packages/cli
npm login            # interactive
npm publish --access public   # `prepack` builds dist/ automatically

版本与发布记录

@crawlee-cloud/cli 共发布 27 个版本,首次发布于 2025/12/26;过去 12 个月发布了 27 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.7.0latest2026/11/091 天前
1.6.02026/08/053 个月前
1.5.02026/07/273 个月前
1.0.12026/07/064 个月前
1.0.02026/06/075 个月前
0.9.92026/06/065 个月前

关于 @crawlee-cloud/cli 的常见问题

@crawlee-cloud/cli 是什么?

CLI for Crawlee Cloud - run and deploy Actors

如何安装 @crawlee-cloud/cli?

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

@crawlee-cloud/cli 支持 TypeScript 吗?

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

@crawlee-cloud/cli 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@crawlee-cloud/cli 需要什么版本的 Node.js?

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

@crawlee-cloud/cli 可以商用吗?

@crawlee-cloud/cli 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@crawlee-cloud/cli 的下载量有多少?

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

@crawlee-cloud/cli 还在维护吗?

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