Skip to main content

CLI

The Scheduler0 CLI is a command-line interface for interacting with the Scheduler0 API. Built with Go for native installation on Windows, macOS, and Linux.

Installation

From Source

git clone https://github.com/scheduler0/scheduler0-cli.git
cd scheduler0-cli
go build -o scheduler0

Binary Releases

Download pre-built binaries from the Releases page.

macOS

# Using Homebrew (when available)
brew install scheduler0/scheduler0-cli

Linux

# Download and install
wget https://github.com/scheduler0/scheduler0-cli/releases/latest/download/scheduler0-linux-amd64
chmod +x scheduler0-linux-amd64
sudo mv scheduler0-linux-amd64 /usr/local/bin/scheduler0

Windows

Download scheduler0-windows-amd64.exe from releases and add it to your PATH.

Quick Start

  1. Initialize credentials:
scheduler0 init

The CLI supports two authentication methods:

API Key Authentication (Managed/Hosted)

For managed or hosted Scheduler0 instances, you'll be prompted for:

  • Base URL (e.g., https://api.scheduler0.com)
  • API Key
  • API Secret
  • Account ID

Or provide via flags:

scheduler0 init \
--base-url https://api.scheduler0.com \
--api-key your-api-key \
--api-secret your-api-secret \
--account-id your-account-id

Basic Authentication (Self-Hosted)

For self-hosted Scheduler0 instances, you'll be prompted for:

  • Base URL (e.g., http://localhost:7070)
  • Username (set during infrastructure setup)
  • Password (set during infrastructure setup)

Or provide via flags:

scheduler0 init \
--base-url http://localhost:7070 \
--username your-username \
--password your-password \
--auth-type basic

Credentials are saved to ~/.scheduler0/config.json and will be used for all subsequent commands.

  1. Check cluster health:
scheduler0 healthcheck
  1. List projects:
scheduler0 projects list

Commands

Projects

# List projects
scheduler0 projects list [--limit 10] [--offset 0] [--order-by date_created] [--order-direction desc]

# Get project details
scheduler0 projects get <project-id>

# Create a project
scheduler0 projects create --name "My Project" --description "Description" --created-by "user-id"

# Update a project
scheduler0 projects update <project-id> --description "New description" --modified-by "user-id"

# Delete a project
scheduler0 projects delete <project-id> --deleted-by "user-id"

Jobs

# List jobs
scheduler0 jobs list [--project-id <id>] [--limit 10] [--offset 0]

# Get job details
scheduler0 jobs get <job-id>

# Create a job
scheduler0 jobs create \
--project-id 123 \
--timezone "UTC" \
--spec "0 30 * * * *" \
--data '{"key": "value"}' \
--created-by "user-id"

# Update a job
scheduler0 jobs update <job-id> \
--spec "0 0 * * * *" \
--status "inactive" \
--modified-by "user-id"

# Delete a job
scheduler0 jobs delete <job-id> --deleted-by "user-id"

AI-Powered Job Creation

Create job configurations from natural language prompts using AI:

# Create job configurations from a natural language prompt
scheduler0 prompt \
--prompt "Send weekly reports every Monday at 9 AM" \
--purposes "reporting,communication" \
--events "weekly_cycle" \
--recipients "team@example.com,manager@example.com" \
--channels "email" \
--timezone "America/New_York"

# Simple prompt (only required field)
scheduler0 prompt --prompt "Follow up 2 days after the demo"

Note: This endpoint requires credits. Each prompt execution consumes 1 credit. If you have insufficient credits, you'll receive an error.

Prompt Requirements:

  • --prompt: Required, must be between 1 and 160 characters (after trimming whitespace)
  • --purposes: Optional, max 5 items, each item max 36 characters
  • --events: Optional, max 5 items, each item max 36 characters
  • --recipients: Optional, max 5 items, each item max 36 characters
  • --channels: Optional, max 5 items, each item max 36 characters
  • --timezone: Optional, timezone for scheduling calculations

Executors

# List executors
scheduler0 executors list [--limit 10] [--offset 0]

# Get executor details
scheduler0 executors get <executor-id>

# Create a webhook executor
scheduler0 executors create \
--name "webhook-executor" \
--type "webhook_url" \
--webhook-url "https://example.com/webhook" \
--webhook-method "POST" \
--webhook-secret "secret" \
--created-by "user-id"

# Update an executor
scheduler0 executors update <executor-id> \
--name "updated-name" \
--modified-by "user-id"

# Delete an executor
scheduler0 executors delete <executor-id> --deleted-by "user-id"

Executions

# List executions
scheduler0 executions \
--start-date "2024-01-01T00:00:00Z" \
--end-date "2024-12-31T23:59:59Z" \
[--project-id <id>] \
[--job-id <id>] \
[--limit 10] \
[--offset 0]

Credentials

# List credentials
scheduler0 credentials list [--limit 10] [--offset 0]

# Get credential details
scheduler0 credentials get <credential-id>

# Create a credential
scheduler0 credentials create --created-by "user-id"

# Update a credential
scheduler0 credentials update <credential-id> --archived true --modified-by "user-id"

# Archive a credential
scheduler0 credentials archive <credential-id> --archived-by "user-id"

# Delete a credential
scheduler0 credentials delete <credential-id> --deleted-by "user-id"

Healthcheck

# Check cluster health (no authentication required)
scheduler0 healthcheck

Authentication

Scheduler0 CLI supports two authentication methods:

1. API Key Authentication (Managed/Hosted)

For managed or hosted Scheduler0 instances, use API Key + Secret authentication:

  • X-API-Key: Your API key
  • X-Secret-Key: Your API secret
  • X-Account-ID: Your account ID

2. Basic Authentication (Self-Hosted)

For self-hosted Scheduler0 instances, use username and password set during infrastructure setup:

  • Username and password configured during Scheduler0 setup
  • Uses HTTP Basic Authentication
  • No account ID required (single-tenant)

The CLI will automatically detect which authentication method to use based on your configuration.

Configuration

Credentials are stored in ~/.scheduler0/config.json:

API Key Authentication:

{
"base_url": "https://api.scheduler0.com",
"api_key": "your-api-key",
"api_secret": "your-api-secret",
"account_id": "your-account-id",
"auth_type": "api_key"
}

Basic Authentication (Self-Hosted):

{
"base_url": "http://localhost:7070",
"username": "your-username",
"password": "your-password",
"auth_type": "basic"
}

You can override the saved configuration using flags on any command.

Examples

Complete Workflow

# 1. Initialize with API key authentication
scheduler0 init

# 2. Create a project
scheduler0 projects create --name "My Project" --created-by "user-123"

# 3. Create an executor
scheduler0 executors create \
--name "webhook" \
--type "webhook_url" \
--webhook-url "https://api.example.com/webhook" \
--webhook-method "POST" \
--created-by "user-123"

# 4. Create a job (or use AI prompt)
scheduler0 jobs create \
--project-id 1 \
--timezone "UTC" \
--spec "0 30 * * * *" \
--data '{"message": "Hello"}' \
--created-by "user-123"

# Alternative: Use AI to generate job configurations
scheduler0 prompt \
--prompt "Send weekly reports every Monday at 9 AM" \
--purposes "reporting" \
--timezone "America/New_York"

# 5. List executions
scheduler0 executions \
--start-date "2024-01-01T00:00:00Z" \
--end-date "2024-12-31T23:59:59Z"

Self-Hosted Features

Note for Self-Hosted Users: Account Management, Feature Management, and Async Tasks Management APIs are designed for users who run Scheduler0 in their own infrastructure and need granular control over team access and resource usage.

Accounts

# Create an account
scheduler0 accounts create --name "My Account"

# Get account details
scheduler0 accounts get <account-id>

Async Tasks

# Get async task status (e.g., after creating a job)
scheduler0 async-tasks get <request-id>

GitHub Repository

The CLI source code is available at: https://github.com/scheduler0/scheduler0-cli