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

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. 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:

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:
Plans with Random Character or Enforced 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

The exit code is available in $LASTEXITCODE.

Use Cases

Scheduled Focus Time

Start a blocking plan at the same time every day:
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:

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:
This prints all your plans with their current status (active, standby, disabled, etc.).