@oml/cli
v0.10.0
Published
The cli specific package
Readme
OML CLI
@oml/cli is the command-line interface for linting, compiling, reasoning over, rendering, and validating OML workspaces.
Package Layout
- package.json - package manifest and published CLI entry
- bin/cli.js - executable entrypoint used by the published
omlcommand - src/main.ts - TypeScript entrypoint
- src/cli.ts - command registration and top-level CLI wiring
- src/commands -
lint,compile,reason,render, andvalidatecommand implementations - src/backend - shared RDF/reasoning and markdown execution support
Instructions
Use the public npm registry for @oml/* packages:
registry=https://registry.npmjs.org/
@oml:registry=https://registry.npmjs.org/From the repo:
node ./packages/cli/bin/cli.js --helpWhen installed, the command name is oml.
The CLI uses the built-in production OML Platform endpoint by default. Set OML_PLATFORM_API_URL=<url> to override it.
Quick Start
# Lint the current workspace
node ./packages/cli/bin/cli.js lint
# Lint against a local platform dev server
OML_PLATFORM_API_URL=http://127.0.0.1:8787 \
node ./packages/cli/bin/cli.js lint
# Compile RDF output
node ./packages/cli/bin/cli.js compile -w . -owl build/owl
# Check consistency only
node ./packages/cli/bin/cli.js reason -w . -owl build/owl --check-only
# Render markdown to static HTML
node ./packages/cli/bin/cli.js render -w . -md src/md -web build/web -owl build/owlCommands
loginRuns GitHub device-flow sign-in, exchanges the GitHub token with the OML Platform, and stores the returned platform session.logoutRemoves the local sign-in session.whoamiPrints the current sign-in session.lint [-w <workspace>]Validates one file, or the current workspace when no file is given.compile [-w <workspace>] [-owl <dir>] [-f <ttl|trig|nt|nq|n3>] [--clean] [--only] [--pretty]Compiles OML to RDF.reason [-w <workspace>] [-owl <dir>] [-f <ttl|trig|nt|nq|n3>] [--clean] [--only] [--pretty] [--check-only] [-u <true|false>] [-e <true|false>] [-p <true|false>]Runs consistency checking and, unless--check-onlyis used, generates entailments.render [-w <workspace>] -md <dir> -web <dir> [-owl <dir>] [-f <ttl|trig|nt|nq|n3>] [-c <model-uri>] [--clean] [--only] [--pretty] [-u <true|false>] [-e <true|false>] [-p <true|false>]Runs the compile/reason pipeline, then renders markdown to static HTML.validate -md <dir> [-w <workspace>] [-owl <dir>] [-f <ttl|trig|nt|nq|n3>] [--clean] [--only] [--pretty] [-u <true|false>] [-e <true|false>] [-p <true|false>]Validates markdown table-editor SHACL blocks against their context models.
Notes
- The CLI uses
OML_PLATFORM_API_KEYwhen it is set. Otherwise, operational commands use the token fromoml loginfor platform authorization. - OAuth login refresh uses built-in Supabase defaults. Set
OML_SUPABASE_URLorOML_SUPABASE_ANON_KEYto override them. - GitHub device-flow login requires
OML_AUTH_GITHUB_CLIENT_ID, unless you embedDEFAULT_GITHUB_CLIENT_IDinsrc/auth.ts. oml loginexchanges the GitHub token with the platform atOML_PLATFORM_API_URLor the built-in default endpoint, then stores the platform session locally.- The CLI depends on
@oml/reasoner. reasonruns ontology consistency checks in dependency order.renderruns the compile/reason pipeline unless--onlyis provided, then renders markdown, resolvesworkspace:/links, executes markdown blocks, and copies referenced non-markdown assets.- If the reasoner reports an inconsistent ontology, the CLI exits with code
1and prints the raw JSON result returned by the reasoner. - When installed from npm, the CLI checks the npm registry for newer
@oml/clireleases and printsnpm install -g @oml/cli@latestwhen an update is available. SetOML_NO_UPDATE_NOTIFIER=1to disable the check.
