Skip to main content
The ocm CLI manages Orange Cat projects. It handles project scaffolding and running the project entry point.
ocm <command>

Commands

ocm initialize

Alias: ocm init Scaffold a new Orange Cat project interactively. The command walks you through a series of prompts and then creates the project directory structure and configuration file.
ocm initialize
# or
ocm init

Prompts

1

Project name

Enter the name of your project. Defaults to myProject.
? How do you want to name your project? (myProject)
2

Directory

Enter the directory where the project will be created. Defaults to the project name you entered in the previous step.
? Where do you want to create your project? (myProject)
3

Project ID

Enter a unique identifier for your project. Defaults to a dash-cased version of the project name (e.g. myProjectmy-project).
? What is your project ID? (my-project)
4

Project type

Select the project type from the list.
? What type of project do you want to create?
  App
  Lib
  • App — an executable application. Creates src/main.ocat with a starter print("Hello World!") and includes a main field in config.json.
  • Lib — a library. No entry-point file is created and config.json does not include a main field.

Generated project structure

After answering all prompts, ocm initialize creates the following layout inside the chosen directory:
my-project/
├── src/
│   └── main.ocat
├── connection/
└── .ocat/
    └── config.json
src/main.ocat:
print("Hello World!")
.ocat/config.json:
{
    "name": "myProject",
    "version": "1.0.0",
    "description": "",
    "id": "my-project",
    "main": "src/main.ocat",
    "type": "app"
}

Example session

$ ocm init
? How do you want to name your project? myProject
? Where do you want to create your project? myProject
? What is your project ID? my-project
? What type of project do you want to create? App

ocm run

Run the project’s main entry point. Must be executed from the project’s root directory (where .ocat/config.json exists).
ocm run
ocm run reads .ocat/config.json, sets up the project context, and then delegates to ocat run with the main field value as the target file.
1

Read project config

Reads .ocat/config.json from the current directory.
2

Set project context

Sets the global project context (isProject, projectConfig, services) so that project-aware features such as logging are enabled.
3

Execute main file

Runs the file referenced by config.json’s main field through the full compiler pipeline.
4

Write logs

On exit, writes execution logs to .ocat/logs.txt inside the project directory.

Example

$ ocm run
Hello World!
After execution, .ocat/logs.txt is created or overwritten with the run’s log output.
ocm run must be run from the project’s root directory. If .ocat/config.json does not exist, the command will fail when attempting to read the config file.
ocm run always passes force: false to the underlying ocat run call, so the main file must have a .ocat extension.

Build docs developers (and LLMs) love