Skip to content
Closed
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
26 changes: 0 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,32 +36,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'

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

- 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
57 changes: 7 additions & 50 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,16 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4

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

# Prefer MSYS2 bash to git bash
- name: "add-path"
# Prefer MSYS2 bash to git bash.
- name: Add MSYS2 to PATH
shell: cmd
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
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'

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

- 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
run: echo C:\msys64\usr\bin>>"%GITHUB_PATH%"

- name: Setup BATS
uses: mig4/setup-bats@v1
Expand Down Expand Up @@ -84,30 +59,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

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

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'

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

- 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
70 changes: 13 additions & 57 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)
* Add the optional [Crontab Guru Dashboard](https://github.com/cronitorio/crontab-dashboard) to manage local cron jobs in a browser
* Automatic integration with Cronitor
* Power tools for your cron jobs

Expand Down Expand Up @@ -61,7 +61,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 separately installed Crontab Guru Dashboard |

### API Resources

Expand Down Expand Up @@ -195,62 +195,18 @@ cronitor environment delete <key>

## 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://github.com/cronitorio/crontab-dashboard) is
now a separate application. Its release bundles include the dashboard and a
pinned Cronitor CLI, so a single installation provides both executables.

Start locally
Run `crontab-dashboard` directly, or continue using `cronitor dash` after
installing the dashboard. The compatibility command forwards arguments,
configuration, environment, and signals to the standalone application.
Use `CRONTAB_DASHBOARD_BIN` to select an explicit dashboard executable.

```
cronitor dash
# then visit http://localhost:9000
```

Secure access
The dashboard is intended for local or secured access. A simple, safe pattern for remote use is an SSH tunnel:
```
ssh -L 9000:localhost:9000 user@your-server
# now open http://localhost:9000
```

Access control & options
```
# Set login credentials via environment variables (preferred).
# --dash-username / --dash-password work but appear in shell history and process lists.
export CRONITOR_DASH_USER=USER
export CRONITOR_DASH_PASS=PASS
cronitor configure

# Optionally, restrict which system users' crontabs are loaded
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;
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.

Create a local `.env` file (ignored by Git) and set permissions with `chmod 600 .env`:

```dotenv
CRONITOR_DASH_USER=your-username
CRONITOR_DASH_PASS='replace-with-a-strong-password'
```

Then build and start the dashboard:

```sh
docker compose -f compose.dashboard.yml up -d --build
```

Open `http://localhost:9000`, or use the SSH tunnel above for remote access.
The Compose example requires both credentials and binds the port to localhost.
Runtime environment variables remain accessible to Docker administrators.
Configuration and container crontabs are stored in named volumes. This starts
the dashboard only; running scheduled jobs also requires a cron daemon.

The existing `docker-compose.yml` is for development. For systemd setup and
additional deployment guidance, see the [Dashboard documentation](https://crontab.guru/dashboard.html).
Existing `cronitor exec` cron entries, `/etc/cronitor/cronitor.json`, and
`CRONITOR_*` environment variables continue to work. Dashboard installation,
Docker/Compose, systemd, and MCP instructions live in the dashboard repository.

## Configuration and secrets

Expand Down Expand Up @@ -297,7 +253,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 separately installed Crontab Guru Dashboard provides a [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for managing local cron jobs. Install its release bundle before using the compatibility commands below.

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

Expand Down
24 changes: 24 additions & 0 deletions cmd/browser.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package cmd

import (
"fmt"
"os/exec"
"runtime"
)

func openBrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("cmd", "/c", "start", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
default:
err = fmt.Errorf("unsupported platform")
}
if err != nil {
fmt.Printf("Failed to open browser: %v\n", err)
}
}
3 changes: 3 additions & 0 deletions cmd/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import (
"github.com/spf13/viper"
)

// Retained in the shared configuration schema for standalone dashboards.
const varMCPEnabled = "CRONITOR_MCP_ENABLED"

type ConfigFile struct {
ApiKey string `json:"CRONITOR_API_KEY"`
PingApiAuthKey string `json:"CRONITOR_PING_API_KEY"`
Expand Down
Loading
Loading