metacore Start a pilot

Developers · Interfaces

Everything, from a terminal.

One program for people and for CI. It signs in through your browser, or sends the key of an app. Every command prints text for people, or JSON for scripts.

Terminal
$ metacore login --url https://korvan.eu1.example.com
$ export METACORE_ENVIRONMENT=staging METACORE_DOMAIN=configuration
$ metacore schema deploy configuration.txtpb
$ metacore run submit changes.json --wait
$ metacore run held
$ metacore run approve 019aa7e25c3b7d419a6e3f2b8c1d4e5f --wait
$ metacore record get setting name=approval-limit --at team=billing

Commands

Made for people, and for CI.

Each command is one or more calls of the public API. It prints text for people, or JSON for scripts with -o json.

ExitMeaning
0It worked. With --wait, the work ended well: a run published, or a deployment went live.
1It failed. A schema or a change set with a problem prints every problem.
2The command line or the configuration is wrong.
3The work stands still until a person acts. The command prints it as it stands.

Exit codes

A pipeline tells a failure from a change that waits for approval.

Commands forSuch as
Sign-inlogin whoami context token
The orgenvironment domain scope secret hostname export trail meters
People and appsgrant profile person app proposal
A domainschema run record job workflow connection module webhook
Cellscell cell-pool drain
Your machineatom

The commands, by what they work on

metacore waits prints what waits for you in every environment of the org.

Sign-in

A context for you. One variable for CI.

A context is an org and its sign-in, kept on your machine. In CI, an app’s key goes in METACORE_TOKEN, and wins over the context.

Terminal
$ metacore login --passkey
$ metacore login --no-browser
$ metacore whoami
$ METACORE_TOKEN=$(metacore token) terraform apply

A person, on any machine

With --no-browser, the CLI gives an address to open on another machine, and the page there shows a code to type. metacore token hands your sign-in to another program.

SettingWhere the CLI takes it
Org--url, then METACORE_URL, then the context.
Sign-inMETACORE_TOKEN, then the context.
Context--context, then METACORE_CONTEXT, then the last login.
Environment--environment, then METACORE_ENVIRONMENT.
Domain--domain, then METACORE_DOMAIN.
Output--output, then METACORE_OUTPUT, then text.

A flag, then a variable

So one script runs against any org, environment and domain.

Pipeline

A pipeline stops where a person decides.

With --wait, a command follows its work to the end. It ends with 3 when the work stands still until a person acts: neither done nor failed.

deploy.sh
export METACORE_ENVIRONMENT=production
export METACORE_DOMAIN=configuration

metacore schema fmt --check configuration.txtpb
metacore schema deploy configuration.txtpb --dry-run
metacore schema deploy configuration.txtpb --wait
metacore run submit changes.json --wait

A deployment and a change, from CI

The dry run checks the deployment against the environment and its live data, and makes nothing live.

Run

019aa7e25c3b7d419a6e3f2b8c1d4e5fHeld for a person

Submitted by
An app, for itself the app
Ended
Not yet
Changes
3

Gate

LayerHolds itWhy
setting, layer valueA second person decides it

Decide

The same run, in the back office

The pipeline ends with 3 and prints the run. A person who may decide its layer approves it here, or with metacore run approve.

On your machine

Write a schema with no sign-in.

The CLI tells the schema language and the contract of your atoms, with no call to an org. So a person, or a model that writes for one, writes a schema and its atoms with the CLI alone.

Terminal
$ metacore schema sample
catalog
configuration
content
orders
$ metacore schema sample orders > orders.txtpb
$ metacore schema fmt --check orders.txtpb

Start from a sample

A sample deploys as it is, into an org that declares its scopes. The last command prints nothing for a file that is in its form.

CommandWhat it gives
schema guideHow to model a domain, step by step.
schema docEach part of the schema language, and when to choose it. As a JSON Schema too.
schema check --localEvery problem of a schema, and its digest.
atom docHow the engine calls your atoms, and what each receives and answers.
atom testRuns a module as a cell runs it.

Commands that call no org

The local check looks at the schema alone. A deployment also checks it against your org and its live data.

See also

Build your domain.

Declare its schema, and take it to production, self-hosted or in a managed region.

Briefing