Error reference › CLI diagnostics
CLI001
cannot open file
errorWhat it means
The CLI reads the file before parsing; failure to open produces this diagnostic with the path in the message.
Trigger condition
A script path was passed that does not exist or cannot be opened for reading.
Minimal failing example
$ mozhi run missing.mzVerified fix
$ mozhi run existing.mzPass a path that exists; relative paths resolve against the current directory.
What the interpreter prints
error[CLI001]: cannot open file
--> app.mz:1:16
1 | $ mozhi run missing.mz
| ^
|
reason: (the exact problem, with positions)
help: (a suggested fix appears here)
docs: https://crossberry-in.github.io/mozhi-doc/errors/CLI001Run
mozhi --json run app.mz to get the same information as
machine-readable JSON (schema mozhi.diagnostics.v1), or --verbose to
also show grouped related diagnostics. See the CLI reference.Suggested fix
Check the path and your current directory. Note: `mozhi run` needs the file argument; see CLI003 for the missing-argument case.
Related syntax
CLI: run
Related diagnostics
Reference links
Limitations
Permission errors are reported with the same code (the OS error text is included).