Command line interface (CLI)

ManicTime for Windows can be controlled from the command line while running. This is useful if you want to automate some tasks, like tagging time or export data using your script.

To use CLI, run Mtc.exe in ManicTime installation folder.

Commands

List of available mtc commands:

Command Description
export Exports activities to CSV or Excel file
addtag Create a new tag
startstopwatch Start stopwatch
stopstopwatch Stop stopwatch
getstopwatch Get stopwatch

Export data

Export activities to CSV or Excel file:

Syntax

mtc export 
	<timeline schema>
	<file path>
	[/fd:<from date>] [/td:<to date>]
	[/excel]
	[/q:<query filter>]
	

Parameters

Name Parameter Value Description Required Default
Timeline schema positional Available schemas:
  • ManicTime/Tags
  • ManicTime/ComputerUsage
  • ManicTime/Applications
  • ManicTime/Documents
Local timeline schema yes -
File path positional text Full path with file name yes -
From date /fd: date(yyyy-mm-dd) Date filter no -
To date /td: date(yyyy-mm-dd) Date filter no -
Excel export /excel switch Export data to MS Excel file no CSV file
Query filter /q: text(query syntax) Activity filter no -

Examples

e.g. Export computer usage activities for April 2024 to Excel file:

mtc export ManicTime/ComputerUsage "C:\export\ComputerUsage.xlsx" /excel /fd:2024-4-1 /td:2024-4-30

Export folder needs to exist. In above example, c:\export folder needs to exist, before you run the command.

Add tag

Creates a new tag in ManicTime.

Syntax

mtc addtag
	/t:<tagcombination>
	/st:<start time>
	/et:<end time>
	[/n:<notes>]

Parameters

Name Parameter Value Description Required Default
Tag combination /t: text Tags separated by comma yes -
Start time /st: datetime(yyyy-MM-ddTHH:mm:ss) Start time yes -
End time /et: datetime(yyyy-MM-ddTHH:mm:ss) End time yes -
Notes /n: text Tag notes no -

Examples

e.g. Create a tag with notes for specified time:

mtc addtag /st:2024-04-01T12:00:00 /et:2024-04-01T12:30:00 /t:"Client,Project,Meeting" /n:"Upcoming project discussion"

Start stopwatch

Start a stopwatch, timer or pomodoro. If stopwatch, timer or pomodoro is already running, it stops currently running one, saves the tag and starts a new one.

Syntax

mtc startstopwatch
	[/t:<tagcombination>]
	[/tl]
	[/n:<notes>]
	[/m:<mode>]
	[/d:<timer duration>]

Parameters

Name Parameter Value Description Required Default
Tag combination /t: text Tags separated by comma no -
Notes /n: text Tag notes no -
Mode /m: Available modes:
  • stopwatch
  • timer
  • pomodoro
Stopwatch mode no stopwatch
Timer duration /d: number(seconds) Timer duration in seconds. Only applicable when starting timer or pomodoro no -

Examples

e.g. Start a timer with one hour duration:

mtc startstopwatch /t:"Client,Project,Meeting" /m:Timer /d:3600

Stop stopwatch

Stop currently running stopwatch.

Syntax

mtc stopstopwatch

Get stopwatch

Get currently running stopwatch status.

Syntax

mtc getstopwatch

Example of response:

tagCombination: Client,Project,Meeting
notes: Sample note
duration: 3578
mode: timer
status: running