Skip to main content

loopsie

Make a loop, grab a beer 🍻

Python Dependencies


You've got a command. You want it to run over and over. Maybe with a delay, maybe not. You don't want to write a bash while loop like an animal. You want to name it, background it, and forget about it.

That's it. That's the tool.

Install

pip install loopsie

Quick start

# Run a command every 5 minutes
loopsie run --every 5m -- curl -s https://example.com/health

# Run a command in a loop with a 30s breather between runs
loopsie run --sleep 30s -- ./check-things.sh

# Run a command in a tight loop and say fuck it (yolo)
loopsie run -- echo "are we there yet"

The real reason you're here 🤖

loopsie run --sleep 5m --name codemonkey -- \
  claude -p "Check the repo for open TODOs and fix one. When none are left, run: loopsie kill codemonkey"

Set it. Forget it. Go touch grass, or your... nvm.

Aliases (for the truly lazy)

Tired of typing claude --model opus --dangerously-skip-permissions every time? Same.

Make an alias like a dandy little bitch:

# Save it once
loopsie alias set claude -- claude --model opus --dangerously-skip-permissions -p

# Use it forever — everything after -- gets appended
loopsie run --sleep 5m --alias claude -- "Review the latest PR and leave comments"

Managing your loops

loopsie ls                  # what's running?
loopsie logs codemonkey     # what did it do?
loopsie logs -f codemonkey  # what is it doing right now?
loopsie kill codemonkey     # ok that's enough
loopsie kill --all          # everybody out

Full CLI

loopsie run [OPTIONS] -- COMMAND [ARGS...]

  -n, --name NAME       Name this loop (auto-generated if omitted)
  -e, --every DURATION   Fixed interval between starts (e.g. 5m, 1h, 30s)
  -s, --sleep DURATION   Delay between completions (e.g. 30s, 1m)
  -m, --max N           Stop after N iterations
  --alias NAME          Use a saved alias as command prefix
  --fg                  Run in foreground (don't daemonize)

loopsie ls              List running loops
loopsie logs NAME       View loop output (-f to follow)
loopsie kill NAME       Stop a loop (--all to stop everything)

loopsie alias set NAME -- COMMAND [ARGS...]
loopsie alias ls
loopsie alias show NAME
loopsie alias rm NAME

Durations: 30s, 5m, 2h, 1h30m — you get it.

Design philosophy

  • Zero dependencies. Python stdlib only. No click, no rich, no yaml. Just argparse and os.fork() like nature intended.
  • Single file. The entire tool is one Python file. Read it in 5 minutes.
  • No daemon. Each loop is its own background process. Nothing running = nothing running.
  • State in ~/.loopsie/. PID files, JSON metadata, plain text logs. rm -rf it if things get weird.

Contributing

Submit PRs so I can ignore them. Bonus points if you're a huge douche about it.

License

MIT — do whatever you want.

...Why the fuck are you still reading this.

Metadata

Release files for loopsie 0.1.1

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

Source distribution (sdist)

Source distribution for loopsie 0.1.1
File Size Uploaded
loopsie-0.1.1.tar.gz 7.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for loopsie 0.1.1
File Interpreter ABI Platform
loopsie-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.6 kB

Release files / loopsie-0.1.1.tar.gz

Download URL loopsie-0.1.1.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b07b414f1b8e4cc2ae1ff4e50d2748226faaf072e6be9228219143d4db5e095a
BLAKE2b-256 checksum
How to use checksums
62c78ace07f84814eb17779d0a6e64b9c792c894ae276239e5728d25284dcd3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / loopsie-0.1.1-py3-none-any.whl

Download URL loopsie-0.1.1-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7837e4e323bf62691bc201d65ea28ae7549cd6e84147a604e5f7ad2d19f4c6f
BLAKE2b-256 checksum
How to use checksums
bc8d29abb99499edcf06a325a7d777e564758d11df3569cbb7ec095178bc705b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

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