{"_id":"5509e8a9e463aa3d000dd3a6","project":"55078477fa89210d00c8ca23","user":"5507846643d3400d0052fd09","category":{"_id":"55192997822f9c23006e9571","project":"55078477fa89210d00c8ca23","pages":[],"__v":0,"version":"5509d0dae463aa3d000dd351","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-03-30T10:46:47.225Z","from_sync":false,"order":1,"slug":"apis","title":"APIs"},"version":{"_id":"5509d0dae463aa3d000dd351","forked_from":"55078478fa89210d00c8ca26","project":"55078477fa89210d00c8ca23","__v":5,"createdAt":"2015-03-18T19:24:10.735Z","releaseDate":"2015-03-18T19:24:10.735Z","categories":["5509d0dbe463aa3d000dd352","5509d0dbe463aa3d000dd353","5509d1664c7c3f2300aac023","550c237bf23ffc230037b98c","55192997822f9c23006e9571","55192a8f337285170047f867"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"0.9.0","version":"0.9"},"__v":33,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-03-18T21:05:45.135Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"# Contents\n\n- [Global Options](#global-options)\n- [Configuration File](#configuration-file)\n- [Commands](#commands)\n    - [help](#section-help) - Prints the general help/usage information or for a specified subcommand.\n    - [version](#section-version) - Prints the version.\n    - [generate](#section-generate) - Generate facts from a built-in or external generator.\n    - [transact](#section-transact) - Transacts facts.\n    - [log](#section-log) - Outputs a log of facts for a domain.\n    - [http](#section-http) - Starts an HTTP server exposing the [HTTP API](doc:http).\n    - [domains](#section-domains) - Prints a list of fact domains.\n    - [list](#section-list) - Prints a list of entities, attributes, or values in a domain.\n    - [gaps](#section-gaps) - Prints a list of detected gaps in a domain.\n    - [conflicts](#section-conflicts) - Prints a list of detected conflicts in a domain.\n\n# Global Options\n\nOptions that can may be included in any commands. Most commands require them.\n\n- `--config=PATH` - Path to a configuration file containing options. See the section [below](#config-file) for more information.\n- `--log=LEVEL` - Output log level. Choices are `debug`, `info`, `warn` (default), `error`, `fatal`, or `panic`.\n- `--storage=STORAGE` - Name of the storage engine to use. See the list of [storage engines](doc:storage-engines)\n- `--path=PATH` - Applies to filesystem-based storage engines. Path to the database file or directory.\n\n# Configuration File\n\nA configuration file is supported to remove the need to pass the same options for every command (e.g. `storage` and `path`). JSON and YAML formats are supported and the keys corresponding to the options. For example:\n\n```javascript\n{\n    \"storage\": \"boltdb\",\n    \"path\": \"/path/to/origins.boltdb\"\n}\n```\n\nOrigins will look for a file named `origins.json` or `origins.yml` and load it automatically. Otherwise an explicit path can be specified using the `--config` option.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Commands\"\n}\n[/block]\n# help\n\nPrints a help and usage information for the program. Passing a `command` name will print usage information for the specified subcommand.\n\n```\norigins help [command]\n```\n\n# version\n\nPrints the version of the program.\n\n```\norigins version\n```\n\n# generate\n\nGenerate facts from a built-in or external generator.\n\n```\norigins generate [--domain=DOMAIN] [--time=TIME] <command>\n```\n\n- `--domain=DOMAIN` - The default domain to use for facts.\n- `--time=TIME` - The default time value for the facts.\n\n# transact\n\nReads facts in from one of the supported [formats](doc:data-formats) from stdin or a file and transacts them.\n\n```\norigins transact [path, ...] [--format=FORMAT] [--compression=COMPRESSION] [--domain=DOMAIN]\n```\n\n- `--format=FORMAT` - The data format of the input stream. Choices are `csv` or `jsonstream`. For file-based loads the format will detected based on the file extension if not specified.\n- `--compression=COMPRESSION` - The type of compression used. Choices are `gzip` and `bzip2`. For file-based loads the compression method will detected from the filename if not specified.\n- `--domain=DOMAIN` - The default domain the facts will be loaded into. If facts define a non-empty `domain` field, the fact will be loaded into that domain rather than the one specified here.\n\n# log\n\nOutputs the log of facts in a domain.\n\n```\norigins log <domain> [--since=SINCE] [--asof=ASOF] [--format=FORMAT]\n```\n\n- `--since=SINCE` - Sets the lower bound (inclusive) of transaction time of the facts to be returned.\n- `--asof=ASOF` - Sets the upper bound (inclusive) of transaction time of the facts to be returned.\n- `--format=FORMAT` - The data format of the input stream. Choices are `csv` (default) or `jsonstream`.\n\n# http\n\nStarts the HTTP exposing the [HTTP interface](doc:http).\n\n```\norigins http [--host=HOST] [--port=PORT]\n```\n\n- `--host=HOST` - The hostname to listen on.\n- `--port=PORT` - The port to bind to.\n\n# domains\n\nPrints a list of domains in the database.\n\n```\norigins domains\n```\n\n# list\n\nPrints a list of identities in a domain of the specified type: entity, attribute, value.\n\n```\norigins list <domain> <type> [--since=SINCE] [--asof=ASOF] [--filter=FILTER]\n```\n\n- `--since=SINCE` - Sets the lower bound (inclusive) of transaction time of the facts to be returned.\n- `--asof=ASOF` - Sets the upper bound (inclusive) of transaction time of the facts to be returned.\n- `--filter=FILTER` - Filters the identities based on locality to the domain. Choices are `all`, `external`, `local` (default).\n\n# gaps\n\nPrints out the entity/attribute pairs that have [gaps](doc:information-model#gaps) in their history.\n\n```\norigins gaps <domain> [--threshold=DELTA]\n```\n\n- `--threshold=DELTA` - The maximum allowed time gap. The value is a duration such as `3h`. Defaults to one second (`1s`).\n\n# conflicts\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Proposal Status\",\n  \"body\": \"See [issue 110](https://github.com/chop-dbhi/origins/issues/110)\"\n}\n[/block]\nPrints out the entity/attribute pairs that have [conflicts](doc:information-model#conflicts) in their history.\n\n```\norigins conflicts <domain> [--resolve]\n```\n\n- `--resolve` - Prints a list of `retract` statements for resolving the conflicts in the history.","excerpt":"Overview of the Origins CLI.","slug":"cli","type":"basic","title":"Command Line Interface (CLI)"}

Command Line Interface (CLI)

Overview of the Origins CLI.

# Contents - [Global Options](#global-options) - [Configuration File](#configuration-file) - [Commands](#commands) - [help](#section-help) - Prints the general help/usage information or for a specified subcommand. - [version](#section-version) - Prints the version. - [generate](#section-generate) - Generate facts from a built-in or external generator. - [transact](#section-transact) - Transacts facts. - [log](#section-log) - Outputs a log of facts for a domain. - [http](#section-http) - Starts an HTTP server exposing the [HTTP API](doc:http). - [domains](#section-domains) - Prints a list of fact domains. - [list](#section-list) - Prints a list of entities, attributes, or values in a domain. - [gaps](#section-gaps) - Prints a list of detected gaps in a domain. - [conflicts](#section-conflicts) - Prints a list of detected conflicts in a domain. # Global Options Options that can may be included in any commands. Most commands require them. - `--config=PATH` - Path to a configuration file containing options. See the section [below](#config-file) for more information. - `--log=LEVEL` - Output log level. Choices are `debug`, `info`, `warn` (default), `error`, `fatal`, or `panic`. - `--storage=STORAGE` - Name of the storage engine to use. See the list of [storage engines](doc:storage-engines) - `--path=PATH` - Applies to filesystem-based storage engines. Path to the database file or directory. # Configuration File A configuration file is supported to remove the need to pass the same options for every command (e.g. `storage` and `path`). JSON and YAML formats are supported and the keys corresponding to the options. For example: ```javascript { "storage": "boltdb", "path": "/path/to/origins.boltdb" } ``` Origins will look for a file named `origins.json` or `origins.yml` and load it automatically. Otherwise an explicit path can be specified using the `--config` option. [block:api-header] { "type": "basic", "title": "Commands" } [/block] # help Prints a help and usage information for the program. Passing a `command` name will print usage information for the specified subcommand. ``` origins help [command] ``` # version Prints the version of the program. ``` origins version ``` # generate Generate facts from a built-in or external generator. ``` origins generate [--domain=DOMAIN] [--time=TIME] <command> ``` - `--domain=DOMAIN` - The default domain to use for facts. - `--time=TIME` - The default time value for the facts. # transact Reads facts in from one of the supported [formats](doc:data-formats) from stdin or a file and transacts them. ``` origins transact [path, ...] [--format=FORMAT] [--compression=COMPRESSION] [--domain=DOMAIN] ``` - `--format=FORMAT` - The data format of the input stream. Choices are `csv` or `jsonstream`. For file-based loads the format will detected based on the file extension if not specified. - `--compression=COMPRESSION` - The type of compression used. Choices are `gzip` and `bzip2`. For file-based loads the compression method will detected from the filename if not specified. - `--domain=DOMAIN` - The default domain the facts will be loaded into. If facts define a non-empty `domain` field, the fact will be loaded into that domain rather than the one specified here. # log Outputs the log of facts in a domain. ``` origins log <domain> [--since=SINCE] [--asof=ASOF] [--format=FORMAT] ``` - `--since=SINCE` - Sets the lower bound (inclusive) of transaction time of the facts to be returned. - `--asof=ASOF` - Sets the upper bound (inclusive) of transaction time of the facts to be returned. - `--format=FORMAT` - The data format of the input stream. Choices are `csv` (default) or `jsonstream`. # http Starts the HTTP exposing the [HTTP interface](doc:http). ``` origins http [--host=HOST] [--port=PORT] ``` - `--host=HOST` - The hostname to listen on. - `--port=PORT` - The port to bind to. # domains Prints a list of domains in the database. ``` origins domains ``` # list Prints a list of identities in a domain of the specified type: entity, attribute, value. ``` origins list <domain> <type> [--since=SINCE] [--asof=ASOF] [--filter=FILTER] ``` - `--since=SINCE` - Sets the lower bound (inclusive) of transaction time of the facts to be returned. - `--asof=ASOF` - Sets the upper bound (inclusive) of transaction time of the facts to be returned. - `--filter=FILTER` - Filters the identities based on locality to the domain. Choices are `all`, `external`, `local` (default). # gaps Prints out the entity/attribute pairs that have [gaps](doc:information-model#gaps) in their history. ``` origins gaps <domain> [--threshold=DELTA] ``` - `--threshold=DELTA` - The maximum allowed time gap. The value is a duration such as `3h`. Defaults to one second (`1s`). # conflicts [block:callout] { "type": "warning", "title": "Proposal Status", "body": "See [issue 110](https://github.com/chop-dbhi/origins/issues/110)" } [/block] Prints out the entity/attribute pairs that have [conflicts](doc:information-model#conflicts) in their history. ``` origins conflicts <domain> [--resolve] ``` - `--resolve` - Prints a list of `retract` statements for resolving the conflicts in the history.