Skip to main content
FocusMe supports command-line arguments to start, stop, and list plans. This lets you automate plan control from scripts, scheduled tasks, or cron jobs without opening the FocusMe window.

Syntax

FocusMe.exe --start "Plan Name"
FocusMe.exe --stop "Plan Name"
FocusMe.exe --stop "Plan Name" --password "mypass"
FocusMe.exe --list
CommandDescription
--start "Plan Name"Start a plan by name
--stop "Plan Name"Stop a plan by name
--stop "Plan Name" --password "pass"Stop a password-protected plan
--listList all plans and their current status
Plan names are case-insensitive"Work Mode" and "work mode" both match the same plan.

How It Works

  • If FocusMe is already running, the command is sent to the running instance via IPC. The result is printed to the console.
  • If FocusMe is not running, it launches minimized to the system tray, processes the command, prints the result, and stays running to enforce the plan.
This means you can safely call these commands regardless of whether FocusMe is open — it will do the right thing either way.

Exit Codes

Every command returns an exit code you can check in scripts:
CodeMeaning
0Success
1Plan not found
2Protection denied (plan cannot be stopped)
3Invalid command or communication error

Protection Rules

Starting a plan with --start is always allowed, regardless of protection settings. Stopping a plan with --stop depends on the plan’s protection level:
Protection TypeCan Stop via CLI?
None (unprotected)Yes
PasswordYes, with --password "correct_password"
Random CharacterNo — returns exit code 2
ForcedNo — returns exit code 2
Plans with Random Character or Forced protection cannot be stopped from the command line. This is intentional — these protection modes are designed to prevent you from bypassing your own plans.

Checking Exit Codes

& "C:\Program Files\FocusMe\FocusMe.exe" --start "Work Mode"
$LASTEXITCODE
The exit code is available in $LASTEXITCODE.

Use Cases

Scheduled Focus Time

Start a blocking plan at the same time every day:
Program: "C:\Program Files\FocusMe\FocusMe.exe"
Arguments: --start "Work Mode"
Trigger: Daily at 9:00 AM
This starts your “Work Mode” plan automatically every morning, even if you forget.

Script-Based Automation

Chain plan control into scripts to set up your work environment:
& "C:\Program Files\FocusMe\FocusMe.exe" --start "No Social Media"
& "C:\Program Files\FocusMe\FocusMe.exe" --start "No Games"

Network-Based Triggers

Combine with automation tools to start plans based on context — for example, activating a “Work Mode” plan when you connect to your office Wi-Fi network.

Checking Plan Status

Use --list to see which plans are running before taking action:
& "C:\Program Files\FocusMe\FocusMe.exe" --list
This prints all your plans with their current status (active, inactive, scheduled).