Skip to main content

Make a loop, grab a beer.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loopsie-0.1.1.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loopsie-0.1.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file loopsie-0.1.1.tar.gz.

File metadata

  • Download URL: loopsie-0.1.1.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for loopsie-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b07b414f1b8e4cc2ae1ff4e50d2748226faaf072e6be9228219143d4db5e095a
MD5 b752681e30c7f68a1e59550cd8afb384
BLAKE2b-256 62c78ace07f84814eb17779d0a6e64b9c792c894ae276239e5728d25284dcd3c

See more details on using hashes here.

File details

Details for the file loopsie-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: loopsie-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for loopsie-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d7837e4e323bf62691bc201d65ea28ae7549cd6e84147a604e5f7ad2d19f4c6f
MD5 924396ca1e46a1221f34fec930f28164
BLAKE2b-256 bc8d29abb99499edcf06a325a7d777e564758d11df3569cbb7ec095178bc705b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page