# @google-automations/cron-utils

> Utilities for setting up bot crons

Latest version **5.1.2** (published 2026-11-17) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @google-automations/cron-utils
pnpm add @google-automations/cron-utils
yarn add @google-automations/cron-utils
bun add @google-automations/cron-utils
```

Provides the command `cron-utils`.

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 5.1.2 |
| Published | 2026-11-17 |
| First published | 2021-05-21 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 22 |
| Dependencies | 4 |
| Unpacked size | 29.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 748 |
| Author | Jeff Ching |
| Maintainers | google-wombot |

## Links

- npm: https://www.npmjs.com/package/@google-automations/cron-utils
- Repository: https://github.com/googleapis/repo-automation-bots
- Issues: https://github.com/googleapis/repo-automation-bots/issues
- npm.io page: https://npm.io/package/@google-automations/cron-utils

## Dependencies (4)

- [yargs](https://npm.io/package/yargs.md) ^17.5.1
- [js-yaml](https://npm.io/package/js-yaml.md) ^4.3.2
- [@google-cloud/run](https://npm.io/package/@google-cloud/run.md) ^1.4.0
- [@google-cloud/scheduler](https://npm.io/package/@google-cloud/scheduler.md) ^4.3.0

## Recent versions

- 5.1.2 (latest) — 2026-11-17
- 5.1.1 — 2026-09-16
- 5.1.0 — 2026-07-24
- 5.0.1 — 2026-04-01
- 5.0.0 — 2024-09-06
- 4.0.0 — 2023-09-18
- 3.2.2 — 2023-01-12
- 3.2.1 — 2022-12-22
- 3.2.0 — 2022-09-12
- 3.1.3 — 2022-06-22
- 3.1.2 — 2022-06-15
- 3.1.1 — 2022-06-06
- 3.1.0 — 2022-05-27
- 3.0.2 — 2022-02-08
- 3.0.1 — 2021-09-17
- … 8 more at https://npm.io/package/@google-automations/cron-utils/versions

## README

# Utility for deploying repo-automation-bot crons

This is a small utility for configuring scheduled cron tasks for
repo-automation-bots.

## Usage

### Install

```bash
npm i -g @google-automations/cron-utils
```

### Usage

This library provides a `cron-utils` binary script that deploys scheduled
triggers for `gcf-utils` based bots.

To run, call the `cron-utils` binary from the root directory of your bot.
You will need a `cron.yaml` and/or `cron` file in that directory.

```bash
cron-utils deploy \
  --scheduler-service-account=[some-service-account]@[project-name].iam.gserviceaccount.com \
  --function-region=us-central1 \
  --region=us-central1 \
  --function-name=[name of target function] \
  --project=[project-id]
```

| Option | Description | Default |
| ------ | ----------- | ------- |
| scheduler-service-account | Service account email that signs requests to the scheduler proxy | *Required* |
| function-region | Region where the function is deployed | *Required* |
| region | Region where the scheduler proxy is deployed | *Required* |
| function-name | Name of the target function/bot | *Required* |
| project | Name of the project where function and scheduler proxy are deployed | `repo-automation-bots` |

### cron.yaml

You can specify one or more cron tasks via a `cron.yaml` config file
at the root of your bot.

```yaml
cron:
- name: name of cron
  # crontab formatted schedule
  schedule: 0 1 * * *
  description: optional description
  # extra request parameters for scheduler http request
  params:
    foo: bar
```

---
_Source: https://npm.io/package/@google-automations/cron-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
