Skip to main content
The 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.
ocat <command> [options]

Commands

ocat run

Run an Orange Cat source file through the full compiler pipeline: lexer → parser → AST → runner.
ocat run <file> [options]

Arguments

file
string
required
Path to the .ocat file to execute. The file must have a .ocat extension unless --force is passed.

Options

-f, --force
boolean
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

ErrorCause
ExtensionErrorThe file does not have a .ocat extension and --force was not passed.
FileDoesn'tExistErrorThe specified file path does not exist on disk.

Examples

ocat run src/main.ocat
Running a valid .ocat file produces no extra output beyond the program’s own output.
$ ocat run src/main.ocat
Hello World!
Using --force bypasses the extension check entirely. The file is still passed through the full Orange Cat compiler pipeline, so the content must be valid Orange Cat syntax.

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 inline
The REPL prints a version banner on startup and then shows the ocat> prompt for each input line.

Internal commands

CommandDescription
.exitExit the REPL and return to the shell.
.helpPrint a summary of available internal commands.
.clearClear 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.

Example session

$ ocat inline
Orange Cat REPL v1.0.0
ocat> print("Hello World!")
Hello World!
ocat> .help
.exit     Exit REPL
.clear    Clear screen
ocat> .exit

Bye!
The REPL is useful for quickly testing expressions and small snippets without creating a file. Each line is a self-contained execution.

Build docs developers (and LLMs) love