LogoTurbo0

lightsout

A command-line tool that politely asks every open app to quit on macOS, Linux and Windows, leaving your terminal running.

Introduction

lightsout is a command-line utility that politely asks every open application to quit in a single command, while keeping the terminal or editor it was launched from open. It runs on macOS, Linux and Windows as a single small binary with no runtime.

What is lightsout?

lightsout is an open-source CLI (MIT-licensed, by abhisheksinha1506 on GitHub) that sends a quit request to every app on your machine and closes Finder or File Explorer windows. It takes one command with optional flags as input and produces a per-app log of what was quit, what failed, and what was left open — then exits with status 1 if anything survived. It works on macOS, Linux (X11 and XWayland) and Windows, installable through Homebrew, Scoop, .deb/.rpm packages or go install.

What makes lightsout stand out?
  • Never force quits — every app receives the same request as Cmd+Q or clicking its close button, so apps with unsaved work can show their own save dialog; anything still open after the timeout is listed at the end and left running.
  • Script-friendly exit codes — lightsout exits with status 1 when any app is left open, so callers can branch on the result.
  • Parent-process detection — it walks its own process tree from your shell up to the terminal or editor that launched it (Terminal, iTerm2, VS Code, Windows Terminal) and keeps that app open without asking.
  • Dry runs — lightsout --dry-run lists exactly which apps would be asked to quit and quits nothing, including Finder/File Explorer windows.
  • Persistent keep list — lightsout keep and lightsout unkeep edit the ignoredApps list in ~/.config/lightsout/config.yml; naming apps inline (lightsout Slack "Google Chrome") keeps them for one run only.
  • Scheduled runs — --yes skips all prompts and --timeout accepts a whole number of seconds from 1 to 300; a 7 pm cron entry such as 0 19 * * 1-5 lightsout --yes --timeout 30 will refuse to run rather than quit the wrong app if it cannot identify its own parent.
  • Native per-platform calls — macOS Dock apps by process ID then Finder windows via AppleScript, Linux windows through wmctrl on X11, Windows taskbar apps through WM_CLOSE then File Explorer; each platform is tested end to end in CI (TextEdit, xterm, Notepad).
  • Shell integration and signed releases — tab completion for bash, zsh, fish and PowerShell plus a man page; checksums signed with cosign, build provenance verifiable with gh attestation verify, and SBOMs for every download.
Who should use lightsout?
  • Developers ending a workday with a dozen editors, browsers and chat apps open who want a single teardown command instead of Cmd+Q-ing each one.
  • People automating a machine shutdown at a fixed hour via cron or a scheduled task, needing an orderly quit that still respects unsaved documents.
  • Remote/SSH users on tmux who want the terminal they are typing in excluded but every other app closed.
  • Ops and security-conscious teams who check the signed checksums and provenance attestation before installing on developer machines.
What can you do with lightsout?
  • End-of-day cleanup: run lightsout once and get a printed list of every app quit, plus the names of any that are still waiting on a save prompt.
  • Scheduled shutdowns: combine --yes with --timeout in crontab so apps that hang past the deadline are reported, never killed.
  • Safe first trial: run --dry-run on a new machine to see the exact quit list before committing to it.
  • Keep-your-music setups: permanently exempt Spotify or a browser full of tabs with lightsout keep, and keep one-off apps for a single run by passing their names.
How does lightsout work?

Install with Homebrew, Scoop, a .deb/.rpm package or go install, then run lightsout --dry-run to preview. On a normal run it identifies the app it was launched from, asks every other app to quit, closes Finder or File Explorer windows, prints a per-app result, and exits with status 1 if anything is left open.

FAQ
Will I lose unsaved work?

No. lightsout sends the same request as choosing Quit or clicking the close button, so apps can ask you to save. Anything still open after the timeout is left running and listed at the end — nothing is ever force quit.

Does it work on Wayland?

Only for apps running through XWayland. Native Wayland apps cannot be listed by another program, and lightsout warns you when it detects a Wayland session.

Why does macOS ask whether my terminal may control Finder?

lightsout closes Finder windows with AppleScript, which macOS prompts you to allow once. Quitting other apps requires no permission.

Is lightsout free?

Yes. It is open source under the MIT license, with packages for macOS, Linux (amd64, arm64, armv6, armv7) and Windows (x64, ARM); a winget package is in review and Windows builds are not yet code-signed, so SmartScreen warns once.

Categories

Information

Launch on turbo0

Submit your own product to reach creators and founders looking for the next tool to try.

Submit your product

More Products

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates