Skip to content

Lucu-lucuan-Lab/nosleep-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


NoSleep CLI

Keep your Windows machine awake from the command line.

CI Latest release Windows Go 1.26.2+

nosleep start --duration 30m  |  nosleep start --background --duration 2h  |  nosleep status -w


NoSleep CLI keeps a Windows machine awake for a fixed duration or until you stop it. It uses the Windows SetThreadExecutionState API to keep the system and display awake without moving the mouse, pressing keys, or simulating user input.

Quick Install

irm https://raw.githubusercontent.com/Lucu-lucuan-Lab/nosleep-cli/main/install.ps1 | iex

Install

Run the following command in PowerShell to download and install the latest release automatically:

irm https://raw.githubusercontent.com/Lucu-lucuan-Lab/nosleep-cli/main/install.ps1 | iex

The installer:

  • downloads the binary for the current Windows architecture
  • verifies the binary with the release SHA-256 checksum
  • installs nosleep.exe to %LOCALAPPDATA%\Programs\NoSleep
  • appends the install directory to the User Path

Open a new terminal after installation, then verify the command location:

where.exe nosleep

Expected output:

C:\Users\<you>\AppData\Local\Programs\NoSleep\nosleep.exe

Check the installed version:

nosleep version

Update

Run the installer again to replace the local binary with the latest release:

irm https://raw.githubusercontent.com/Lucu-lucuan-Lab/nosleep-cli/main/install.ps1 | iex

If NoSleep is running in the background, stop it before updating:

nosleep stop

Uninstall

Stop any active session, then run the uninstaller:

nosleep stop
irm https://raw.githubusercontent.com/Lucu-lucuan-Lab/nosleep-cli/main/uninstall.ps1 | iex

The uninstaller removes nosleep.exe, removes %LOCALAPPDATA%\Programs\NoSleep from the User Path, and removes NoSleep's local state file.

Manual install

Download the binary for your architecture from the latest release:

  • nosleep-windows-amd64.exe for most Windows PCs
  • nosleep-windows-arm64.exe for Windows ARM64

Rename the file to nosleep.exe, place it in a directory on your User Path, and verify it against checksums.txt from the same release.

Usage

Start an open-ended session:

nosleep start

Run for a fixed duration:

nosleep start --duration 30m
nosleep start --duration 2h
nosleep start --duration 1h30m

Run until a specific 24-hour time:

nosleep start --until 17:30

Start in the background:

nosleep start --background --duration 2h
nosleep status
nosleep stop

Show the installed version:

nosleep version

Attach a label to the session:

nosleep start --duration 45m --mode Monitoring

Stop the session with q, esc, or Ctrl+C.

Options

Flag Default Description
--duration none Session duration such as 30m, 2h, or 1h30m.
--until none Auto-stop time in 24-hour format, such as 17:30.
--background false Start NoSleep without keeping the terminal open.
--mode generic Optional label displayed for the current session.

For compatibility, nosleep --duration 30m still starts a foreground session. Only one background session is allowed at a time.

Build

Requirements:

  • Windows
  • Go 1.26.2 or newer

Build from source:

go build -o nosleep.exe .\cmd\nosleep

Run checks:

go test .\...

Release

Releases are built by GitHub Actions from version tags:

git tag v0.1.1
git push origin v0.1.1

The release workflow runs tests, builds Windows amd64 and arm64 binaries, writes SHA-256 checksums, and attaches the installer and uninstaller scripts to the GitHub release.

About

A lightweight Windows CLI to keep your system and display awake for a set duration.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors