Skip to content

pawiromitchel/bcron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

bcron

SCR-20260204-krjj

A modern command scheduler with an interactive TUI for managing scheduled tasks.

Features

  • ✨ Interactive TUI - Beautiful split-pane interface with live task details
  • πŸ“… Flexible Scheduling - Schedule commands at specific times with timezone support
  • πŸ”„ Background Daemon - Reliable task execution with automatic polling
  • πŸ“œ Script Support - Run .sh, .py, .rb, .pl, .js, .php files with auto-detection
  • πŸ“Š Execution History - Full stdout/stderr logging for every execution
  • πŸ”” Desktop Notifications - Native macOS notifications for task events (start, success, failure)
  • 🎯 CLI & TUI - Use whichever interface suits your workflow
  • ⚑ Concurrent Execution - Run up to 10 tasks simultaneously
  • πŸ›‘οΈ Protected Scheduling - Prevents task creation without running daemon
  • πŸ“¦ Single Binary - One executable for CLI, TUI, and daemon management
  • πŸš€ Auto-Start - Daemon automatically starts when scheduling tasks if needed

Quick Start

Build

./build.sh

Start the Daemon

./bin/bcron daemon start # Verify it's running ./bin/bcron daemon status

Launch the TUI

./bin/bcron

TUI Keybindings:

  • n - New task
  • e - Edit
  • d - Delete
  • h - History
  • f - Filter
  • r - Refresh
  • ↑/↓ - Navigate
  • Enter - View details
  • q - Quit

Or Use CLI

# Add a task ./bin/bcron add "echo 'Hello'" --at "2026-02-05 12:00 UTC" --name "greeting" # List tasks ./bin/bcron list # Run immediately ./bin/bcron run 1 # View logs ./bin/bcron logs 1 # View history ./bin/bcron history 1

Time Formats

# ISO 8601 --at "2026-02-05T12:00:00Z" # With timezone --at "2026-02-05 12:00 UTC" --at "2026-02-05 14:30 EST" # Custom timezone flag --at "2026-02-05 12:00" --timezone "America/New_York"

Command Types

Shell Commands

./bin/bcron add "echo 'Hello'" --at "2026-02-05 12:00 UTC" --name "test" ./bin/bcron add "ls -la /tmp" --at "2026-02-05 13:00 UTC" --name "list"

Scripts

Automatically detects interpreter from shebang or file extension:

./bin/bcron add "./backup.sh" --at "2026-02-05 02:00 UTC" --name "backup" ./bin/bcron add "./process_data.py" --at "2026-02-05 09:00 UTC" --name "process"

Supported: .sh, .py, .rb, .pl, .js, .php

Desktop Notifications (macOS)

bcron sends native macOS notifications for task execution events:

Notification Types

  • πŸ”΅ Task Started - When a task begins execution

    Title: bcron - Task Started Message: Task #5 - backup started 
  • βœ… Task Completed - When a task finishes successfully

    Title: bcron - Task Completed βœ“ Message: Task #5 - backup executed successfully 
  • ❌ Task Failed - When a task fails

    Title: bcron - Task Failed βœ— Message: Task #5 - backup failed to execute 

Platform Support

  • macOS: Full support via native Notification Center
  • Linux/Windows: Gracefully skipped (no errors)

Notifications are non-blocking and won't prevent task execution if they fail.

Configuration

  • Database: ~/.config/bcron/bcron.db
  • PID File: ~/.config/bcron/bcron.pid
  • Check Interval: 30 seconds
  • Task Timeout: 1 hour
  • Max Concurrent: 10 tasks

Task Status

  • pending - Waiting to run
  • running - Currently executing
  • completed - Finished successfully
  • failed - Finished with error
  • cancelled - Manually cancelled

Daemon Commands

# Start daemon ./bin/bcron daemon start # Stop daemon ./bin/bcron daemon stop # Check status (shows real PID, uptime, task counts) ./bin/bcron daemon status

Troubleshooting

Daemon not running

# Check status ./bin/bcron daemon status # Remove stale PID file if needed rm ~/.config/bcron/bcron.pid # Start daemon ./bin/bcron daemon start

Can't add tasks

If you see ⚠️ Warning: Scheduler daemon is not running!, start the daemon first:

./bin/bcron daemon start

Note: In auto-start mode, the daemon will start automatically when you add tasks.

MCP Server

bcron ships with an MCP server so AI assistants (Claude, etc.) can schedule and manage tasks directly.

Setup

cd mcp uv run bcron-mcp

Or with pip:

cd mcp pip install . bcron-mcp

Claude Desktop Config

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{ "mcpServers": { "bcron": { "command": "uv", "args": ["--directory", "/path/to/bash-cron/mcp", "run", "bcron-mcp"] } } }

Available Tools

Tool Description
schedule_task Schedule a command to run at a specific time
list_tasks List all tasks (optionally filtered by status)
get_task Get a single task by ID or name
get_task_logs Get stdout/stderr from the latest execution
cancel_task Cancel a pending task
daemon_status Check if the scheduler daemon is running
daemon_start Start the scheduler daemon

Note: Update BCRON_BIN in mcp/server.py to point to your bcron binary if it's not at the default path.

Documentation

For detailed information, see CLAUDE.md

License

MIT

Version

0.1.0 - Production Ready

About

Command / Script scheduler made with golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors