cirrus-cli

cirruslabsMIT更新放缓

在本地或任意 CI 环境里跑 Cirrus 任务的命令行工具,方便开发时直接复现和调试流水线,不用反复推代码等远端构建。

CLI for executing Cirrus tasks locally and in any CI

v1.0.0发布于 2026-06-01 17:13 UTC293star35fork同步于 2026-11-07 07:32 UTC

怎么上手

由 README 提炼,执行前请确认
cirrus run
cirrus validate
硬件要求按 README 说明

README 未说明具体硬件要求;需环境中已安装 Docker 或 Podman,Linux 容器仅支持 amd64 架构,arm64 需改用 arm_container。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

在本地或任意 CI 中复现执行 Cirrus 任务,用容器保证结果一致

在本地或任意 CI 环境里跑 Cirrus 任务的命令行工具,方便开发时直接复现和调试流水线,不用反复推代码等远端构建。

核心能力

  • 复用 Cirrus CI 的 .cirrus.yml 配置格式
  • 用容器不可变性保证任务跨机器、跨时间一致
  • 默认按 .gitignore 将工作目录 rsync 进容器
  • 支持按任务名运行并可用 -e 注入环境变量
  • 提供 cirrus validate 校验配置文件

容易踩的坑

container 默认按 amd64 架构运行,arm64 机器需改用 arm_container;macOS 15 及以上运行 cirrus run 会触发本地网络权限弹窗,需用 root 加 --user 或修改系统网络偏好;目前仅支持 Linux container 和 macos_instance VM,不支持其他平台任务。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.0.0
  1. v1.0.0最新正式版2026-06-01 · 2026-06-01 17:13 UTC

    Release just before Cirrus CI is shutting down.

    What's Changed

    Full Changelog: https://github.com/cirruslabs/cirrus-cli/compare/v0.165.2...v1.0.0

  2. v0.165.22026-03-17 · 2026-03-17 13:23 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/cirruslabs/cirrus-cli/compare/v0.165.1...v0.165.2

  3. v0.165.12026-03-11 · 2026-03-11 17:58 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/cirruslabs/cirrus-cli/compare/v0.165.0...v0.165.1

  4. v0.165.02026-02-27 · 2026-02-27 19:02 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/cirruslabs/cirrus-cli/compare/v0.164.3...v0.165.0

  5. v0.164.32026-02-20 · 2026-02-20 17:24 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/cirruslabs/cirrus-cli/compare/v0.164.2...v0.164.3

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Cirrus CLI

    Build Status

    [!IMPORTANT]

    macOS 15 (Sequoia) or later

    The newly introduced "Local Network" permission in macOS Sequoia requires accepting a GUI pop-up on each host machine that runs cirrus run or cirrus worker run and Tart VMs.

    To work around this, there are two options. The first one is to invoke the cirrus run or cirrus worker run as root with an additional --user command-line argument, which takes a name of your regular, non-privileged user on the host machine.

    This will cause the Cirrus CLI to start a small cirrus localnetworkhelper process in the background and then drop the privileges to the specified user.

    The helper process is privileged and needed to establish network connections on behalf of the Cirrus CLI without triggering a GUI pop-up.

    This approach is more secure than simply running cirrus run or cirrus worker run as root, because only a small part of Cirrus CLI runs privileged and the only functionality that this part has is establishing new connections.

    The second workaround is to set the local network privacy preferences so that all IPv4 private address space that could potentially be used for Tart VMs is excluded:

    sudo defaults write com.apple.network.local-network AllowedEthernetLocalNetworkAddresses -array "10.0.0.0/8" "172.16.0.0/12" "192.168.0.0/16"
    sudo defaults write com.apple.network.local-network AllowedWiFiLocalNetworkAddresses -array "10.0.0.0/8" "172.16.0.0/12" "192.168.0.0/16"
    

    ...and then reboot.

    Cirrus CLI is a tool for running containerized tasks reproducibly in any environment. Most commonly, Cirrus tasks are used as part of continuous integration workflows but can also be used as part of local development process as a hermetic replacement of helper scripts/Makefiles. Cirrus CLI runs your tasks locally the same way they are executed in CI or on your colleague's machine. Immutability of containers ensures the tasks will be executed the same way years from now regardless what versions of packages you'll have locally.

    Cirrus CLI Demo

    Installation

    Usage

    Cirrus CLI reuses the same YAML configuration format as Cirrus CI which allows to reuse a large list of examples created by Cirrus CI community.

    Note: Cirrus CLI can be used in any environment that has Docker or Podman installed. It can be your laptop or any CI system you already have like Jenkins, GitHub Actions, Travis CI, etc. With Cirrus CLI it's no longer a requirement to use Cirrus CI in order to benefit from Cirrus configuration format that we (Cirrus Labs) have crafted for so long and really proud of.

    Here is an example of .cirrus.yml configuration file for testing a Go application with several Go versions:

    task:
      env:
        matrix:
          VERSION: 1.21
          VERSION: 1.22
      name: Tests (Go $VERSION)
      container:
        image: golang:$VERSION
      modules_cache:
        fingerprint_script: cat go.sum
        folder: $GOPATH/pkg/mod
      get_script: go get ./...
      build_script: go build ./...
      test_script: go test ./...
    

    Note: container: implies the amd64 architecture. If you're running on arm64, please use with the arm_container instead.

    Running Cirrus Tasks

    To run Cirrus tasks, simply switch to a directory where the .cirrus.yml is located and run:

    cirrus run
    

    By default, working directory will be rsynced into a container while respecting .gitignore configuration. This makes sure Cirrus Tasks are executed from a clean state only with source code changes.

    In case rsync-ing the whole working directory is too costly, you can pass a --dirty flag which will result in all operations being done against the actual working directory (and not it's rsynced copy):

    cirrus run --dirty Lint
    

    Since most linters and code-analysis tools are read-only by their nature there is no need in extra precautions and the potentially costly rsync-ing can be safely avoided.

    It is also possible to run a particular task by name:

    cirrus run "Tests (Go 1.15)"
    

    Or pass some extra environment variables with -e flag:

    cirrus run -e CIRRUS_TAG="test-release" Release
    

    Note: Cirrus CLI only supports Linux container and macos_instance VMs at the moment. Linux containers support the Dockerfile as a CI environment feature.

    Validating Cirrus Configuration

    To validate a Cirrus configuration, simply switch to a directory where the .cirrus.yml is located and run:

    cirrus validate
    

    Caching

    By default, Cirrus CLI stores blob artifacts produced by the cache instruction in the user-specific cached data folder. Similar to Cirrus Cloud the CLI can use a caching HTTP server for more efficient sharing of cached artifacts between tasks executed on different physical hosts.

    Caching HTTP server should support a single /<key> REST endpoint with PUT, GET and HEAD methods available for uploading, downloading and checking availability of a cached artifact under <key> key respectively. There are reference implementations of such HTTP servers for Google Cloud Storage and AWS S3 and Azure's Blob Storage.

    To start using your own HTTP caching server simply pass it's hostname as CIRRUS_HTTP_CACHE_HOST to run command:

    cirrus run --environment CIRRUS_HTTP_CACHE_HOST=http-cache-host.internal:8080
    

    Security

    Cirrus CLI aims to run in different environments, but in some environments we choose to provide more usability at the cost of some security trade-offs:

    • SELinux
      • both the task container and the helper container (that copies the project directory into a per-task container volume using rsync) run unconfined

    Please open an issue if your use-case requires a different approach.

    FAQ

    Cirrus CI was released in the early 2018 with an idea to bring some innovation to CI space. A lot of things have changed in CI-as-a-service space since then but Cirrus CI pioneered many ideas in CI-as-a-service space including per-second billing and support for Linux, Windows and macOS all together.

    Over the past two and a half years we heard only positive feedback about Cirrus CI's YAML configuration format. Users liked how concise their configuration looked and that it was easy to reason about.

    Another feedback we heard from users was that it's hard to migrate from one CI to another. There is a need to rewrite CI configurations from one format into another that basically still locks into another vendor.

    And now in 2020 with Cirrus CLI we are trying to solve the "vendor lock" problem by popularizing Cirrus configuration format and building community around it. Stay tuned for the upcoming option to use Starlark templates instead of YAML!

    Think of Cirrus CLI as an executor of Cirrus Tasks on a single machine only in Docker containers for simple CI scenarious. And Cirrus CI as an option for more specific cases where Cirrus Tasks can be executed in containers and VMs using a variety of supported compute services or using a managed infrastructure with per-second billing.

    License

    Cirrus CLI is distributed under the MIT License.

    Copyright (c) 2026 Cirrus Labs, Inc.