ocat CLI compiles and executes Orange Cat (.ocat) source files. It exposes two subcommands: run for executing files and inline for an interactive REPL session.
Commands
ocat run
Run an Orange Cat source file through the full compiler pipeline: lexer → parser → AST → runner.
Arguments
Path to the
.ocat file to execute. The file must have a .ocat extension unless --force is passed.Options
Force execution even if the file does not have a
.ocat extension. When this flag is set, the compiler prints Running in force mode before executing.Error cases
| Error | Cause |
|---|---|
ExtensionError | The file does not have a .ocat extension and --force was not passed. |
FileDoesn'tExistError | The specified file path does not exist on disk. |
Examples
- Normal execution
- Force mode
- Extension error
- File not found
Running a valid
.ocat file produces no extra output beyond the program’s own output.ocat inline
Start an interactive REPL (Read-Eval-Print Loop) for the Orange Cat language. Each line you enter is compiled and executed immediately.
ocat> prompt for each input line.
Internal commands
| Command | Description |
|---|---|
.exit | Exit the REPL and return to the shell. |
.help | Print a summary of available internal commands. |
.clear | Clear the terminal screen. |
Internal commands begin with a
. and are handled before the input is sent to the compiler. Any other input is executed as Orange Cat code.