Skip to content

Commands & exit codes ​

Use ahk --help and ahk --capabilities on your actual executable for the final authority.

Commands ​

CommandBehavior
run script.ahk [args...]Execute a script; run can be omitted
check script.ahkParse without normal script execution
test script.ahk [args...]Execute in test mode
repl [script.ahk]Persistent expression session
mcpNative local MCP server over stdio
--helpUsage and available flags
--versionEngine version, build/compiler/architecture identity
--capabilitiesMachine-readable commands, features, protocol information

Selected flags ​

FlagPurpose
/HeadlessSuppress engine-owned interactive prompts; not a sandbox
/Diag=jsonStructured diagnostic/result mode
/ErrorStdOutHuman-readable error reporting; despite the legacy name, diagnostics use stderr
/ErrorStdOut:colorANSI-colored error reporting
/EvalOpt into Eval
/TraceHuman-readable executing statements on stderr
/Trace=jsonStructured statement events; development capability
/Coverage=pathLCOV file; development capability
/CrashLog=pathAppend-only engine event log
/DebugConnect to a DBGp debugger; separate from native MCP

Exit codes ​

CodeMeaning
0Success
10Uncaught script exception
11Critical/internal/fatal interpreter error
12Parse or load failure
13check failed
14test failed
64CLI usage error
130External interruption such as Ctrl+C

Other explicit ExitApp(n) values can pass through. Capture the code immediately and retain stderr to explain it.

API quick index ​

Print(Fmt?, Values*) · Eval(expr) · JSON.Parse(text, options?) · JSON.Stringify(value) · Inspect(value, depth?, maxItems?) · Check(source) · ProcessPipe(command, args?, workingDir?) · _ScriptGetLines(file, line, range?).

See the relevant feature guides for semantics, build requirements, and limits; this index is not a complete upstream language reference.

AutoHotkey Console × ClautoHotkey · Independent projects built on AutoHotkey v2.