Skip to content
Select theme

CLI and SDK

AI agent getting started? Read Agents: start here first.

Use the CLI for interactive work and coding agents. Use the platform SDK’s typed modules for an integration or automation.

Both operate on the shared engineering model. The platform authorizes each operation and validates the data it changes.

For your own hosted interface, see Host your own app. To use a coding agent to set up a model and demo data, follow Bootstrap a tool with an agent.

For interactive work, follow CLI setup. Coding agents begin with Agents: start here. For a backend integration, install the SDK below.

The SDK requires Node.js 22 or later. TypeScript consumers also need @types/node.

Install the SDK and Node.js types from the public npm registry:

Terminal window
npm install @openengio/sdk @types/node

Import from a module subpath such as @openengio/sdk/objects or @openengio/sdk/branches; the package has no root import.

Obtain an access token through OAuth or a service identity. You also need the project ID and the ID of an object that identity can read. Keep the token on your backend.

Save this as read-object.mjs:

import {
createHttpsTransport,
createObjectsTransportClient,
toCredential,
} from "@openengio/sdk/objects";
const token = process.env.OPENENG_ACCESS_TOKEN;
const projectId = process.env.OPENENG_PROJECT_ID;
const objectId = process.env.OPENENG_OBJECT_ID;
if (!token || !projectId || !objectId) {
throw new Error("Set OPENENG_ACCESS_TOKEN, OPENENG_PROJECT_ID and OPENENG_OBJECT_ID");
}
const origin = "https://api.openeng.io";
const transport = createHttpsTransport(origin);
const objects = createObjectsTransportClient(transport, origin, toCredential(token));
const answer = await objects.readObject({
selector: { projectId, ref: "main" },
input: { objectId },
});
console.log(JSON.stringify(answer, null, 2));

Set those three environment variables in your backend environment, then run:

Terminal window
node read-object.mjs

A successful response contains the object in result. Compare it with the same record in the workspace on main. Handle a refusal before rendering a result; an unavailable object is not an empty record.

ModuleUse it for
ObjectsRead and change engineering records and relationships
BranchesCreate branches and review proposals
OntologyPublish shared types and views
AdministrationManage organisations and integrations
AgentsWork with conversations and plans

Each operation separates its selector, which names the project and branch or baseline, from its input arguments.

Use openeng help <command> and the CLI reference for exact command shapes. The external app guide covers OAuth registration, scopes and service identities.

  1. Start your integration with reads.
  2. For edits, create a branch through the Branches client.
  3. Send mutations through the Objects client using that branch’s full name.
  4. Inspect the diff and submit a proposal for review.
  5. Merge only when the platform’s review and protection rules permit it.
  6. Configure types and views through Ontology, where proposed changes are published separately from engineering data.

Handle each response according to the operation’s contract:

  • A completed operation returns the authoritative data for your app.
  • A structured error response explains why the platform rejected the request; preserve the user’s draft and show the reason.
  • A repeated idempotent write may return the previously recorded response without running the write again.
  • For a write whose completion could not be determined, check or recover it using its correlation ID before trying again.

Transport failures can throw. A failed connection does not prove that a write had no effect.

  1. Keep the correlation ID sent with the write, together with its idempotency key and correlation information.
  2. If objects.mutate times out, call objects.recover with the same selector and input: { correlationId } before retrying.
  3. Check the recovery result. Recovery searches the branch’s recent commits for the correlation ID and writes its own audit record. It leaves the original record unchanged and does not repeat the mutation. It returns succeeded with the commit, or unknown with depthSearched, the number of commits searched, if none was found.
  4. On unknown, read the objects on the branch to check whether the change is there before sending it again; the write was not found within the search.
  5. For branch operations, use inspectBranchOperation. They have no recovery route.

Branching and change control explains the review workflow. Host your own app covers backend authentication and external hosting.