Skip to main content

tmux-scheduler

tmux-scheduler is a CLI tool that reads a YAML schedule and sends input to tmux sessions after configured delays.

It uses libtmux to connect to the active tmux server and send keys to panes.

Install

poetry install

To enter the virtualenv shell:

poetry shell

Usage

poetry run tmux-scheduler -i schedule.yaml

Use -d or --dry_run to execute the schedule timing without sending any input to tmux.

The CLI uses rich logging to show each scheduled input before it waits and sends it, with highlighted delay and session fields and dimmed input text. Wait durations are rendered with humanize for easier reading. While each item is waiting, it also renders a Rich progress bar with elapsed time, remaining time, and a preview of the input being queued.

Schedule format

The input file must be a YAML list. Each item must define:

  • schedule: when to send the input
  • session: tmux target to send input to, or null to use the only running tmux session
  • input: text to send

The schedule field supports:

  • a number, treated as seconds from now, for example 14400
  • a relative time string parsed by dateparser, for example "1 hour later"
  • a clock time string parsed by dateparser, for example "23:00"

humanize is used for display formatting of wait durations in the CLI output. Schedule parsing still uses dateparser, because humanize does not parse natural-language schedule expressions.

For clock times like "23:00", if that time has already passed today, tmux-scheduler schedules it for the next day.

Targets are resolved in this order:

  • session name, for example worker
  • window target, for example worker:0
  • pane target, for example worker:0.1 or %3

If you target a session or window, input is sent to that target's active pane.

If session is null, tmux-scheduler will send the input to the active pane of the only tmux session. If tmux has zero sessions or more than one session, it raises an error.

Example:

- schedule: 14400
  session:
  input: |
    export APP_ENV=dev
    export LOG_LEVEL=debug
    cd ~/projects/my-app
    source .venv/bin/activate
    python manage.py migrate
    python manage.py runserver
- schedule: "1 hour later"
  session: worker:0
  input: python job.py
- schedule: "23:00"
  session: worker:0.1
  input: python job.py

Metadata

Release files for tmux-scheduler 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tmux-scheduler 1.0.0
File Size Uploaded
tmux_scheduler-1.0.0.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tmux-scheduler 1.0.0
File Interpreter ABI Platform
tmux_scheduler-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.3 kB

Release files / tmux_scheduler-1.0.0.tar.gz

Download URL tmux_scheduler-1.0.0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f7c74e5fcffaf37218f0583fb1d8a9fd464c5eb453cf02f0033bf366bb7e6756
BLAKE2b-256 checksum
How to use checksums
dad1e3544a0103e17548744f12226983e15244e8ec173c1cb32be6252c29be31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.3 Linux/6.17.0-20-generic

Release files / tmux_scheduler-1.0.0-py3-none-any.whl

Download URL tmux_scheduler-1.0.0-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a24b254a3a07f32b1c868296a9b6d8e098d6ae1e0314dc12747306400c197d8b
BLAKE2b-256 checksum
How to use checksums
352f87582ea2812f1f56e7723a8e037dbe6a19ad1aefebcfabb3dde9b788f191
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.3 Linux/6.17.0-20-generic

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page