OptixLog Docs
CLIConfiguration

optixlog.toml

Full schema for the committed project config file — [optixlog], [codegen], and [[projects]] tables, plus discovery rules.

optixlog.toml is the committed, non-secret project configuration file. It records the API base URL, the codegen output settings, and the list of projects that optixlog generate builds types for. Write it once with optixlog init and commit it to version control.

No secrets here

Credentials — API keys and base URLs used for auth — belong in ~/.optixlog/credentials.toml. Never put an API key in optixlog.toml.

Discovery

optixlog generate (and other commands that accept --config-path) discover optixlog.toml by walking up from the current working directory:

  1. Check <cwd>/optixlog.toml.
  2. Check each parent directory in turn.
  3. Stop at the first match.

This lets you run optixlog generate from any subdirectory of your repository and resolve a single root config. If no file is found, generate exits with an error.

You can bypass discovery by passing --config-path <path> explicitly.

Schema

[optixlog]

Prop

Type

[codegen]

Prop

Type

[[projects]]

An array of TOML tables. Each entry represents one project that generate builds types for. There must be at least one entry for generate to succeed.

Prop

Type

A missing id or name (or a projects value that is not an array of tables) is a ConfigError.

What is NOT in this file

  • Credentials — API keys and base URLs for authentication live in ~/.optixlog/credentials.toml (mode 0600).
  • Node-to-project mapping — which node types belong to which project is derived from each project's fetched schema at generate time. The [[projects]] array records which projects to generate for, not what is in them.

Complete example

optixlog.toml
# Committed, non-secret project config. Credentials never live here —
# they go in ~/.optixlog/credentials.toml.

[optixlog]
api_base_url = "https://optixlog.leidos.com"
schema_version = 1

[codegen]
output_path = "optixlog_gen.py"   # file `optixlog generate` writes
module_style = "single_file"      # "single_file" | "package"

# Source of truth for which projects `generate` builds types for.
# The node↔project association is NOT stored here — it is derived
# from each project's fetched schema at generate time.
[[projects]]
id = "proj_grating_7f3a"
name = "Grating Coupler Lab"

[[projects]]
id = "proj_modulator_22b1"
name = "Modulator Program"

Format and round-trip

The file is written by optixlog init using a hand-rendered layout ([optixlog] → [codegen] → [[projects]]) for a stable, readable ordering. It is read with tomllib (Python 3.11+) or tomli (Python 3.10), and the layout round-trips faithfully through tomli-w.

Validation errors

ConditionError message
[optixlog].api_base_url missing or empty<path>: [optixlog].api_base_url is required
[optixlog] is not a table<path>: [optixlog] must be a table
[codegen] is not a table<path>: [codegen] must be a table
[[projects]] is not an array of tables<path>: [[projects]] must be an array of tables
An entry is missing id or name<path>: each [[projects]] needs id and name: ...
Invalid TOML<path>: invalid TOML: ...

On this page