Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/real-cron.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: "Real cron"

# Runs tests/real-cron.sh: syncs a crontab with the shell shim, installs it
# for root, and checks three real cron ticks (about 4 minutes).
# for root, and checks three real cron ticks (about 4 minutes). Then runs
# tests/real-cron-dashboard.sh: toggles monitoring through crontab-dashboard
# and checks two more ticks (about 2 minutes).
# Runs on a pull request that has the `e2e` label (and on each push while it
# has it), or by hand from the Actions tab.
on:
Expand All @@ -14,7 +16,7 @@ jobs:
name: Real cron end-to-end
if: github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'e2e')
runs-on: ubuntu-latest
timeout-minutes: 15
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v7
Expand All @@ -30,3 +32,6 @@ jobs:

- name: Run real cron check
run: sudo env "PATH=$PATH" "GOCACHE=$(go env GOCACHE)" "GOMODCACHE=$(go env GOMODCACHE)" tests/real-cron.sh

- name: Run real cron dashboard check
run: sudo env "PATH=$PATH" "GOCACHE=$(go env GOCACHE)" "GOMODCACHE=$(go env GOMODCACHE)" tests/real-cron-dashboard.sh
104 changes: 73 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,34 +36,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: web/package-lock.json

- name: Install web dependencies
run: |
cd web
npm ci

- name: Ensure static directory exists
run: |
mkdir -p web/static
ls -la web/

- name: Build web assets
run: |
cd web
echo "Starting web build..."
npm run build
echo "Web build completed"

- name: Verify web assets were built
run: |
test -s web/static/index.html

- name: Go Release Binaries Normal Volume Size
uses: wangyoucao577/go-release-action@v1.53
with:
Expand Down Expand Up @@ -98,10 +70,76 @@ jobs:
path: ${{ matrix.goos }}_${{ matrix.goarch }}.*
if-no-files-found: error

build-web:
name: Build dashboard frontend
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: web/package-lock.json

- name: Build web assets
working-directory: web
run: |
npm ci
npm run build
test -s static/index.html

- uses: actions/upload-artifact@v4
with:
name: web-static
path: web/static/
if-no-files-found: error

build-dashboard:
name: Create dashboard assets
needs: [build-web]
runs-on: ubuntu-latest
strategy:
max-parallel: 2
matrix:
goos: [linux, windows, darwin, freebsd]
goarch: [amd64, arm, arm64]
exclude:
- goarch: arm
goos: darwin
- goarch: arm
goos: windows
- goarch: arm64
goos: windows

steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- uses: actions/download-artifact@v4
with:
name: web-static
path: web/static

- name: Build and package crontab-dashboard
run: scripts/package-dashboard.sh "${{ matrix.goos }}" "${{ matrix.goarch }}" .

- name: Stage release assets
uses: actions/upload-artifact@v4
with:
name: release-crontab-dashboard_${{ matrix.goos }}_${{ matrix.goarch }}
path: crontab-dashboard_${{ matrix.goos }}_${{ matrix.goarch }}.*
if-no-files-found: error

publish:
name: Publish complete release
runs-on: ubuntu-latest
needs: [build-binaries]
needs: [build-binaries, build-dashboard]
permissions:
contents: write
steps:
Expand All @@ -114,9 +152,13 @@ jobs:
- name: Verify complete asset set and checksums
working-directory: release-assets
run: |
for target in linux_amd64 linux_arm linux_arm64 darwin_amd64 darwin_arm64 freebsd_amd64 freebsd_arm freebsd_arm64 windows_amd64; do
for target in linux_amd64 linux_arm linux_arm64 darwin_amd64 darwin_arm64 freebsd_amd64 freebsd_arm freebsd_arm64 windows_amd64 \
crontab-dashboard_linux_amd64 crontab-dashboard_linux_arm crontab-dashboard_linux_arm64 \
crontab-dashboard_darwin_amd64 crontab-dashboard_darwin_arm64 \
crontab-dashboard_freebsd_amd64 crontab-dashboard_freebsd_arm crontab-dashboard_freebsd_arm64 \
crontab-dashboard_windows_amd64; do
extension=tar.gz
if [ "$target" = windows_amd64 ]; then extension=zip; fi
case "$target" in *windows_amd64) extension=zip ;; esac
archive="$target.$extension"
test -s "$archive"
test -s "$archive.sha256"
Expand Down
84 changes: 31 additions & 53 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,6 @@ jobs:
echo ::add-path::C:\msys64\usr\bin
dir C:\msys64\usr\bin

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: web/package-lock.json

- name: Install web dependencies
shell: bash
run: |
cd web
npm ci

- name: Test dependency fixes
shell: bash
run: cd web && npm run test:dependencies

- name: Build web assets
shell: bash
run: |
cd web
npm run build

- name: Setup BATS
uses: mig4/setup-bats@v1
with:
Expand Down Expand Up @@ -91,26 +68,6 @@ jobs:
with:
go-version-file: '${{ github.workspace }}/go.mod'

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: web/package-lock.json

- name: Install web dependencies
run: |
cd web
npm ci

- name: Test dependency fixes
run: cd web && npm run test:dependencies

- name: Build web assets
run: |
cd web
npm run build

- name: Setup BATS
uses: mig4/setup-bats@v1
with:
Expand Down Expand Up @@ -161,6 +118,25 @@ jobs:
go-version: 'stable'
check-latest: true

- name: Build binary
run: go build -o cronitor main.go

- name: Run Go tests
run: go test ./...

# The dashboard frontend is the only npm build. It runs here, with no
# secrets; the CLI jobs above need no Node.
dashboard:
name: Build and smoke-test the dashboard
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7

- uses: actions/setup-go@v7
with:
go-version-file: '${{ github.workspace }}/go.mod'

- name: Set up Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -169,17 +145,19 @@ jobs:
cache-dependency-path: web/package-lock.json

- name: Install web dependencies
run: |
cd web
npm ci
working-directory: web
run: npm ci

- name: Test dependency fixes
working-directory: web
run: npm run test:dependencies

- name: Build web assets
run: |
cd web
npm run build
working-directory: web
run: npm run build

- name: Build binary
run: go build -o cronitor main.go
- name: Smoke-test cronitor dash and crontab-dashboard
run: tests/dashboard-smoke.sh

- name: Run Go tests
run: go test ./...
- name: Package one release archive
run: scripts/package-dashboard.sh linux amd64 dist
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ TODO.md

# Dashboard
node_modules/
web/static/
web/static/*
!web/static/README.md
cronitor-linux

Claude.md
Expand Down
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
CronitorCLI is the recommended companion application to the Cronitor monitoring service. Use it on your workstation and deploy it to your server for powerful features, including:

* Import and sync all of your cron jobs with Cronitor
* Easily manage your cron jobs with the [web-based control panel](#crontab-guru-dashboard)
* Manage your cron jobs in a browser with the optional [Crontab Guru Dashboard](#crontab-guru-dashboard)
* Automatic integration with Cronitor
* Power tools for your cron jobs

Expand Down Expand Up @@ -71,7 +71,7 @@ Logout revokes this installation's credential and removes it locally. **Schedule
| `cronitor exec <key> <cmd>` | Run a command with monitoring |
| `cronitor list` | List all cron jobs |
| `cronitor status` | View monitor status |
| `cronitor dash` | Start the web dashboard |
| `cronitor dash` | Start the Crontab Guru Dashboard (installed separately as `crontab-dashboard`) |

#### How `cronitor sync` changes a crontab

Expand Down Expand Up @@ -274,12 +274,24 @@ Team and API key commands need a credential from `cronitor auth login --admin` a

## Crontab Guru Dashboard

The Cronitor CLI bundles the [Crontab Guru Dashboard](https://crontab.guru/dashboard.html), a self‑hosted web UI to manage your cron jobs, including a one‑click “run now” and "suspend", a local console for testing jobs, and a built in MCP server for configuring jobs and checking the health/status of existing ones.
The [Crontab Guru Dashboard](https://crontab.guru/dashboard.html) is a self‑hosted web UI to manage your cron jobs, including a one‑click “run now” and "suspend", a local console for testing jobs, and a built in MCP server for configuring jobs and checking the health/status of existing ones.

Since version 34.0 the dashboard is a separate program, `crontab-dashboard`, released with each CLI version. The `cronitor` binary does not include it. Your configuration, cron jobs, systemd units, and MCP settings do not change: `cronitor dash` starts `crontab-dashboard` with the same arguments.

Install

Put `crontab-dashboard` in the same folder as `cronitor` (Linux and macOS shown; use your platform and architecture, for example `darwin_arm64`). If `crontab-dashboard` is missing, `cronitor dash` prints this command with the right values:

```
curl -fsSL https://github.com/cronitorio/cronitor-cli/releases/latest/download/crontab-dashboard_linux_amd64.tar.gz | sudo tar -xz -C /usr/local/bin
```

On Windows, extract `crontab-dashboard.exe` from `crontab-dashboard_windows_amd64.zip` into the folder that holds `cronitor.exe`. `cronitor update` updates both programs when they are in the same folder. `crontab-dashboard configure` and `crontab-dashboard update` work the same as the `cronitor` commands, so a dashboard-only install never needs to call `cronitor`.

Start locally

```
cronitor dash
cronitor dash # or: crontab-dashboard
# then visit http://localhost:9000
```

Expand All @@ -303,8 +315,8 @@ cronitor configure --users user1,user2
```
### Docker

The included `dockerfile` downloads and extracts the CLI for the target platform
(`amd64`, `arm64`, or `arm`). Credentials are supplied when the container starts;
The included `dockerfile` downloads and extracts the CLI and the dashboard for
the target platform (`amd64`, `arm64`, or `arm`). Credentials are supplied when the container starts;
do not put them in Docker build arguments or Dockerfile `ENV` instructions.
The dashboard reads these environment variables directly, so no
`cronitor configure` step is needed.
Expand Down Expand Up @@ -376,7 +388,7 @@ You can also pass `--ping-api-host eu.cronitor.link`, or save it with `cronitor

## MCP Server (AI Integration)

The Cronitor CLI includes a built-in [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for managing cron jobs with natural language through AI-powered tools like Claude Code, Cursor, Cline, and Windsurf.
The Crontab Guru Dashboard includes a built-in [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for managing cron jobs with natural language through AI-powered tools like Claude Code, Cursor, Cline, and Windsurf.

**Quick start:** Run `cronitor dash` on your server, then configure your MCP client to spawn `cronitor dash --mcp-instance default`.

Expand Down
36 changes: 36 additions & 0 deletions cmd/crontab-dashboard/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// crontab-dashboard is the Crontab Guru Dashboard. It is built from the same
// commit as cronitor and shares its configuration, flags, and API client.
package main

import (
"os"

"github.com/cronitorio/cronitor-cli/cmd"
"github.com/cronitorio/cronitor-cli/internal/dashboard"
)

func main() {
setup()
os.Args = dashboardArgs(os.Args)
cmd.Execute()
}

func setup() {
cmd.RootCmd.Use = cmd.DashboardBinaryName
cmd.SetUpdateBinary(cmd.DashboardBinaryName)
dashboard.Register(cmd.RootCmd)
}

// passThrough are the CLI commands crontab-dashboard runs as named, so a
// standalone install needs no `cronitor` command for settings and updates.
var passThrough = map[string]bool{"dash": true, "configure": true, "update": true}

// dashboardArgs runs the dash command unless the first argument names a
// pass-through command, so `crontab-dashboard --port 9100` and
// `cronitor dash --port 9100` match.
func dashboardArgs(args []string) []string {
if len(args) > 1 && passThrough[args[1]] {
return args
}
return append([]string{args[0], "dash"}, args[1:]...)
}
Loading
Loading