Skip to main content
Every OCat project contains a .ocat/config.json file. OCM reads this file when you run ocm run to determine the project entry point and load project metadata into the runtime context. The file is generated automatically by ocm initialize and can be edited by hand at any time.

Schema

name
string
required
The human-readable name of the project. Provided during ocm initialize; defaults to myProject.
version
string
default:"1.0.0"
The project version. Set to "1.0.0" when the project is first created.
description
string
default:""
A short description of the project. Starts as an empty string; edit it freely.
id
string
required
A project identifier. Auto-derived from the project name by converting camelCase to dash-case (e.g. myProjectmy-project). Can be changed during initialization.
main
string
Path to the main entry file, relative to the project root. Only present for App projects. Defaults to src/main.ocat. OCM executes this file when you run ocm run.Not written for Lib projects.
type
string
required
The project type. One of "app" or "lib".

Examples

.ocat/config.json
{
    "name": "myProject",
    "version": "1.0.0",
    "description": "An example OCat application.",
    "id": "my-project",
    "main": "src/main.ocat",
    "type": "app"
}

How OCM uses config.json

When you run ocm run, OCM performs the following steps:
  1. Reads .ocat/config.json using a synchronous JSON parse.
  2. Sets isProject: true and stores the parsed config object in the global runtime context under projectConfig.
  3. Executes the file at the path given by config.main.
The project config is available to the runtime throughout the execution of your program.
If .ocat/config.json does not exist or is invalid JSON, ocm run will throw a parse error and exit immediately.

Logger configuration file

In addition to config.json, you can place an optional logcfg.json file in the .ocat/ directory to configure the logging service. If present, it is read at startup before any code runs. See the Logging page for the full logcfg.json schema.

Projects overview

Understand project types, directory structure, and the project lifecycle.

Logging

Configure log levels and interceptors with logcfg.json.

Build docs developers (and LLMs) love