Skip to main content
This page is the entry point for using a service definition. Most application work follows register → setup → test or start. Contract authors can use run while refining one operation, then register the complete definition when it is ready for repeated use. run compiles and executes one operation in a short-lived process. Registered services use an immutable compiled revision and can retain profiles, backend state, reports, and deferred work under SIMILE_HOME.

Register

With no arguments, registration loads ./Simfile and uses the name declared by its service block. An explicit name asserts the expected service name. --config URL_OR_FILE selects another definition. Registration performs the expensive and failure-prone work before installation:
  1. load the service configuration from a local path or HTTP(S) URL;
  2. resolve and load its OpenAPI, Smithy, or TypeScript source and HCL modules;
  3. parse and semantically validate the selected contract language and HCL;
  4. compile schemas, outcomes, constraints, and heuristic plans;
  5. encode and decode the .similec artifact to verify it; and
  6. install a private immutable revision, then atomically advance current.
If the service already exists, registration fails unless --force is explicit. Routine refreshes should use update instead.

Setup

When the registered configuration declares principal setup, this command collects provisioning values, runs its contract operation, and creates one durable profile of that principal. Issued credentials are stored in service state and exported to a private .env file without appearing in command output. Setup without --profile generates an unused human-readable name and creates another independent consumer identity. Passing an existing profile name updates its collected configuration while preserving its issued identity. See Set up a service for the authoring model.

Start

Starting a registered service reads the current manifest and artifact from the registry. It does not reopen the original configuration, read local contract files, or refetch remote sources. This makes startup independent of the provider’s availability and ensures the process runs the exact revision that registration validated. For an ad-hoc local run, bypass the registry:
This form loads ./Simfile. --port changes only that invocation. start --config accepts an explicit local path; URL-based configuration loading belongs to register and update. Override the configured listener address when a container or virtual machine must expose it:

Test

test starts the selected service on an available loopback port, supplies that address to the child as SIMILE_BASE_URL, and keeps the emulator alive until the command exits. A registered service’s current profile is injected automatically; --profile NAME selects another profile. Simile returns the child command’s exit status and shuts the listener down. Use --scenario or --fault-profile to run a controlled failure case. See Local testing for the complete workflow and CI testing for isolated job state.

Update

Update reloads the stored configuration snapshot and the sources it names, compiles a complete new revision, and advances current only after success. A failed fetch, parse, semantic check, schema compile, or artifact check leaves the active revision unchanged. To replace the configuration source at the same time:
An already running process keeps the artifact it loaded. Restart it to load the newly current revision.

Remove

Removal permanently deletes the named service’s complete registry directory, state/services/NAME.redb, and state/services/NAME.exchanges.redb. The --confirm value is required and must exactly match the service name. A missing or different value fails before the registry is changed. If a running process owns the state lock, removal fails rather than unlinking live state. Other services and the registry layout remain intact. Stop a running service before removal. After removal, simile start inttegro fails until the service is registered again.

Run

run compiles the selected contract and optional --module HCL modules in memory, executes one operation, prints the result, and exits. It does not read or write the service registry. Because each invocation creates a fresh runtime, replay state does not cross CLI invocations.

Registry layout

The default registry root is ~/.simile; set SIMILE_HOME for CI isolation or tests:
The service supervisor checkpoints the complete service-owned Stack and sanitized exchange history under state/services/. Separately launched Stack component processes use state/stack/. Both use embedded redb and sidecar ownership locks; the registry revisions themselves remain immutable. locks/ is reserved for broader registry coordination; installation currently relies on same-filesystem staging and atomic rename.

Continue