Skip to content

CLI reference ​

The aion binary is installed by @iwentsourcing/cli. Run it with npx aion, or add the package to your project.

Every command that talks to an API takes --host and --tenant. They default to the environment variables IWENTSOURCING_HOST and IWENTSOURCING_TENANT, so exporting them once is enough. Commands that print rows take -o json for scripts and agents.

aion serve ​

Serve an api and management

aion serve [options] <src...>
Argument
src...source file
Option
-s, --storage <uri>uri. default: :memory:
-l, --lock <uri>uri. default: :memory:
-q, --queue <uri>uri. default: :memory:
--var, --variable <variable...>variable name in source file
-h, --host <host>api host (IWENTSOURCING_HOST). default: http://localhost:3333
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing

aion build ​

Build iwentsourcing manifesto

aion build [options] <src...>
Argument
src...source file
Option
--var, --variable <variable...>variable name in source file
-o, --output <dist>output file. default: iwentsourcing-manifesto.json
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing

aion upload ​

Upload iwentsourcing manifesto to management api

aion upload [options] <src...>
Argument
src...source file
Option
--var, --variable <variable...>variable name in source file
-h, --host <host>api host (IWENTSOURCING_HOST). default: https://api.iwentsourcing.com
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing

aion seed ​

Seed events into stream

aion seed [options] <src...>
Argument
src...source file
Option
--var, --variable <variable...>variable name in source file
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing
-h, --host <host>api host (IWENTSOURCING_HOST). default: https://api.iwentsourcing.com

aion backup ​

Incremental event backups and point-in-time restore

aion backup run ​

Copy events not yet backed up to the backup target

aion backup run [options]
Option
-s, --storage <uri>storage uri of the events to back up or restore into (STORAGE_URI)
--target <target>backup target: a directory or gs://bucket/prefix
-t, --tenant <tenant>back up only this tenant

aion backup follow ​

Keep replicating new events to the backup target until stopped

aion backup follow [options]
Option
-s, --storage <uri>storage uri of the events to back up or restore into (STORAGE_URI)
--target <target>backup target: a directory or gs://bucket/prefix
-t, --tenant <tenant>back up only this tenant
-q, --queue <uri>queue uri of the API, to react to new events immediately. default: :memory:

aion backup restore ​

Restore a tenant from the backup into a new tenant

aion backup restore [options]
Option
-s, --storage <uri>storage uri of the events to back up or restore into (STORAGE_URI)
--target <target>backup target: a directory or gs://bucket/prefix
-t, --tenant <tenant>tenant to restore
--into <tenant>new tenant to restore into
--until <date>restore the state as of this ISO date (default: latest)

aion backup list ​

List the segments in the backup target

aion backup list [options]
Option
--target <target>backup target: a directory or gs://bucket/prefix

aion whoami ​

Who am I currently logged in as

aion whoami [options]
Option
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing
-h, --host <host>api host (IWENTSOURCING_HOST). default: https://api.iwentsourcing.com
--realm <realm>realm of the session, the users of a deployed realm have their own login. default: iwentsourcing

aion login ​

Login into iwentsourcing

aion login [options] <provider>
Argument
providerauth provider
Option
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing
-h, --host <host>api host (IWENTSOURCING_HOST). default: https://api.iwentsourcing.com
--realm <realm>realm of the session, the users of a deployed realm have their own login. default: iwentsourcing
-u, --username <username>auth username
-p, --password <password>auth password
--token <token>auth token
--token-stdinread the auth token from the standard input, e.g. the output of a command that prints one

aion register ​

Register into iwentsourcing

aion register [options] <provider>
Argument
providerauth provider
Option
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing
-h, --host <host>api host (IWENTSOURCING_HOST). default: https://api.iwentsourcing.com
--realm <realm>realm of the session, the users of a deployed realm have their own login. default: iwentsourcing
-u, --username <username>auth username
-p, --password <password>auth password

aion token ​

Print the access token of a login, to send as a bearer token to the MCP endpoint of the api

aion token [options]
Option
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing
-h, --host <host>api host (IWENTSOURCING_HOST). default: https://api.iwentsourcing.com
--realm <realm>realm of the session, the users of a deployed realm have their own login. default: iwentsourcing

aion tenant ​

Manage tenants

aion tenant list ​

List the tenants you are a member of

aion tenant list [options]
Option
-h, --host <host>api host (IWENTSOURCING_HOST). default: https://api.iwentsourcing.com
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing
--no-headersleave out the table header row. default: show headers
-o, --output <format>output format, json is meant for scripts and agents. one of table, json. default: table
--skip <count>rows to skip. default: 0
--take <count>rows to show, at most 1000. default: 50

aion tenant create ​

Register a new tenant and become its first member

aion tenant create [options] <name>
Argument
nametenant name
Option
-h, --host <host>api host (IWENTSOURCING_HOST). default: https://api.iwentsourcing.com
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing
--no-headersleave out the table header row. default: show headers
-o, --output <format>output format, json is meant for scripts and agents. one of table, json. default: table

aion realm ​

Inspect the realms deployed to a tenant

aion realm list ​

List the realms deployed to a tenant

aion realm list [options]
Option
-h, --host <host>api host (IWENTSOURCING_HOST). default: https://api.iwentsourcing.com
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing
--no-headersleave out the table header row. default: show headers
-o, --output <format>output format, json is meant for scripts and agents. one of table, json. default: table
--skip <count>rows to skip. default: 0
--take <count>rows to show, at most 1000. default: 50

aion realm show ​

Show the streams, aggregations and auth providers of a realm

aion realm show [options] <realm>
Argument
realmrealm name
Option
-h, --host <host>api host (IWENTSOURCING_HOST). default: https://api.iwentsourcing.com
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing
--no-headersleave out the table header row. default: show headers
-o, --output <format>output format, json is meant for scripts and agents. one of table, json. default: table
--skip <count>rows to skip. default: 0
--take <count>rows to show, at most 1000. default: 50

aion aggregation ​

Inspect aggregation instances

aion aggregation list ​

List aggregation instances

aion aggregation list [options]
Option
--realm <realm>only this realm
--pattern <pattern>only this pattern
-h, --host <host>api host (IWENTSOURCING_HOST). default: https://api.iwentsourcing.com
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing
--no-headersleave out the table header row. default: show headers
-o, --output <format>output format, json is meant for scripts and agents. one of table, json. default: table
--skip <count>rows to skip. default: 0
--take <count>rows to show, at most 1000. default: 50

aion aggregation state ​

List the states of an aggregation instance, or the rows of one state

aion aggregation state [options] <realm> <pattern> <name> [state]
Argument
realmrealm name
patternaggregation pattern
nameaggregation instance name, see aggregation list
statestate name, leave out to list the declared states
Option
--definition-version <version>definition version, needed when an instance exists in several
-h, --host <host>api host (IWENTSOURCING_HOST). default: https://api.iwentsourcing.com
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing
--no-headersleave out the table header row. default: show headers
-o, --output <format>output format, json is meant for scripts and agents. one of table, json. default: table
--skip <count>rows to skip. default: 0
--take <count>rows to show, at most 1000. default: 50

aion stream ​

Inspect and operate stream instances

aion stream list ​

List stream instances

aion stream list [options]
Option
--realm <realm>only this realm
--pattern <pattern>only this pattern
-h, --host <host>api host (IWENTSOURCING_HOST). default: https://api.iwentsourcing.com
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing
--no-headersleave out the table header row. default: show headers
-o, --output <format>output format, json is meant for scripts and agents. one of table, json. default: table
--skip <count>rows to skip. default: 0
--take <count>rows to show, at most 1000. default: 50

aion stream events ​

List the events of a stream instance, oldest first

aion stream events [options] <realm> <pattern> <name>
Argument
realmrealm name
patternstream pattern
namestream instance name, see stream list
Option
--definition-version <version>definition version, needed when an instance exists in several
--since <date>only events created at or after this date. default: null
-h, --host <host>api host (IWENTSOURCING_HOST). default: https://api.iwentsourcing.com
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing
--no-headersleave out the table header row. default: show headers
-o, --output <format>output format, json is meant for scripts and agents. one of table, json. default: table
--skip <count>rows to skip. default: 0
--take <count>rows to show, at most 1000. default: 50

aion stream state ​

List the states of a stream instance, or the rows of one state

aion stream state [options] <realm> <pattern> <name> [state]
Argument
realmrealm name
patternstream pattern
namestream instance name, see stream list
statestate name, leave out to list the declared states
Option
--definition-version <version>definition version, needed when an instance exists in several
-h, --host <host>api host (IWENTSOURCING_HOST). default: https://api.iwentsourcing.com
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing
--no-headersleave out the table header row. default: show headers
-o, --output <format>output format, json is meant for scripts and agents. one of table, json. default: table
--skip <count>rows to skip. default: 0
--take <count>rows to show, at most 1000. default: 50

aion stream push ​

Push an event to a stream instance

aion stream push [options] <realm> <pattern> <name> <event>
Argument
realmrealm name
patternstream pattern
namestream instance name, see stream list
eventevent name
Option
--definition-version <version>definition version, needed when an instance exists in several
-d, --data <json>event payload as json. default: {}
--id <id>event id, makes the push idempotent
--no-awaitreturn before the event is processed
-h, --host <host>api host (IWENTSOURCING_HOST). default: https://api.iwentsourcing.com
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing
--no-headersleave out the table header row. default: show headers
-o, --output <format>output format, json is meant for scripts and agents. one of table, json. default: table

aion stream replay ​

Replay streams

aion stream replay [options]
Option
-h, --host <host>api host (IWENTSOURCING_HOST). default: https://api.iwentsourcing.com
--no-headersleave out the table header row. default: show headers
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing

aion mcp ​

Run an MCP server on stdio, so an agent can inspect and operate iwentsourcing with the login of this CLI

aion mcp [options]
Option
-h, --host <host>api host (IWENTSOURCING_HOST). default: https://api.iwentsourcing.com
-t, --tenant <tenant>tenant name (IWENTSOURCING_TENANT). default: iwentsourcing