Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated cicero-cli and ergo-cli for 0.20 release #243

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
228 changes: 179 additions & 49 deletions docs/cicero-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,73 +5,203 @@ title: Cicero CLI

Install the `@accordproject/cicero-cli` npm package to access the Cicero command line interface (CLI). After installation you can use the `cicero` command and its sub-commands as described below.

To install the Cicero CLI:
```
npm install -g @accordproject/cicero-cli
```

## Usage

```md
Commands:
cicero parse parse a contract text
cicero draft create contract text from data
cicero normalize normalize markdown (parse & redraft)
cicero trigger send a request to the contract
cicero invoke invoke a clause of the contract
cicero initialize initialize a clause
cicero archive create a template archive
cicero compile generate code for a target platform
cicero get save local copies of external dependencies

Options:
--version Show version number [boolean]
--verbose, -v [default: false]
--help Show help [boolean]

```

## cicero parse

Loads a template from a directory on disk and then parses input clause (or contract) text using the template.
If successful the template model is printed to console. If there are syntax errors in the DSL
text the line and column and error information are printed.
`cicero parse` loads a template from a directory on disk and then parses input clause (or contract) text using the template. If successful, the template model is printed to console. If there are syntax errors, the line and column and error information are printed.

```md
cicero parse

parse a contract text

Options:
--version Show version number [boolean]
--verbose, -v [default: false]
--help Show help [boolean]
--template path to the template [string]
--sample path to the contract text [string]
--output path to the output file [string]
--currentTime set current time [string] [default: null]
--warnings print warnings [boolean] [default: false]
```

## cicero draft

`cicero draft` creates contract text from data.

```md
create contract text from data

Options:
--version Show version number [boolean]
--verbose, -v [default: false]
--help Show help [boolean]
--template path to the template [string]
--data path to the contract data [string]
--output path to the output file [string]
--currentTime set current time [string] [default: null]
--wrapVariables wrap variables as XML tags [boolean] [default: false]
--warnings print warnings [boolean] [default: false]
```

## cicero normalize

`cicero normalize` normalizes markdown text by parsing and redrafting the text.

```bash
cicero parse
```md
normalize markdown (parse & redraft)

Options:
--help Show help [boolean]
--version Show version number [boolean]
--template path to the directory with the template [string]
--sample path to the clause text [string]
--out path to the output file [string]
--verbose, -v [default: false]
Options:
--version Show version number [boolean]
--verbose, -v [default: false]
--help Show help [boolean]
--template path to the template [string]
--sample path to the contract text [string]
--overwrite overwrite the contract text [boolean] [default: false]
--output path to the output file [string]
--currentTime set current time [string] [default: null]
--warnings print warnings [boolean] [default: false]
--wrapVariables wrap variables as XML tags [boolean] [default: false]
```

## cicero execute
## cicero trigger

`cicero trigger` sends a request to the contract.

Loads a template from a directory on disk and then attempts to create a clause (or contract)from a given input
text. If the clause (or contract) is successfully created, it is then executed by the engine, passing in JSON data. If successful the
engine response is printed to the console.
```md
send a request to the contract

```bash
cicero execute
Options:
--version Show version number [boolean]
--verbose, -v [default: false]
--help Show help [boolean]
--template path to the template [string]
--sample path to the contract text [string]
--request path to the JSON request [array]
--state path to the JSON state [string]
--currentTime set current time [string] [default: null]
--warnings print warnings [boolean] [default: false]

Options:
--help Show help [boolean]
--version Show version number [boolean]
--template path to the directory with the template [string]
--sample path to the clause text [string]
--request path to the JSON request [array]
--state path to the JSON state [string]
--verbose, -v [default: false]
```

## cicero invoke

`cicero invoke` invokes a specific clause (`--clauseName`) of the contract.

```md
invoke a clause of the contract

Options:
--version Show version number [boolean]
--verbose, -v [default: false]
--help Show help [boolean]
--template path to the template [string]
--sample path to the contract text [string]
--clauseName the name of the clause to invoke [string]
--params path to the parameters [string]
--state path to the JSON state [string]
--currentTime set current time [string] [default: null]
--warnings print warnings [boolean] [default: false]

```

## cicero initialize

`cicero initialize` initializes a clause.

```md
cicero initialize

initialize a clause

Options:
--version Show version number [boolean]
--verbose, -v [default: false]
--help Show help [boolean]
--template path to the template [string]
--sample path to the contract text [string]
--currentTime initialize with this current time [string] [default: null]
--warnings print warnings [boolean] [default: false]

```
## cicero archive

Creates a Cicero Template Archive (.cta) file from a template stored in a local directory.
`cicero archive` creates a Cicero Template Archive (`.cta`) file from a template stored in a local directory.

```md
cicero archive

create a template archive

Options:
--version Show version number [boolean]
--verbose, -v [default: false]
--help Show help [boolean]
--template path to the template [string]
--target the target language of the archive [string] [default: "ergo"]
--output file name for new archive [string] [default: null]
--warnings print warnings [boolean] [default: false]

```

## cicero compile

`cicero generate` generates code for a target platform. It loads a template from a directory on disk and then attempts to generate versions of the template model in the specified format. The available formats include: `Go`, `PlantUML`, `Typescript`, `Java`, and `JSONSchema`.

```md
cicero compile

generate code for a target platform

```sh
cicero archive
Options:
--version Show version number [boolean]
--verbose, -v [default: false]
--help Show help [boolean]
--template path to the template [string]
--target target of the code generation [string] [default: "JSONSchema"]
--output path to the output directory [string] [default: "./output/"]
--warnings print warnings [boolean] [default: false]

Options:
--help Show help [boolean]
--version Show version number [boolean]
--template path to the directory with the template [string]
--archiveFile file name for the archive [string]
--verbose, -v [default: false]
```
## cicero get

## cicero generate
`cicero get` saves local copies of external dependencies.

Loads a template from a directory on disk and then attempts to generate versions of the template model in the specified format.
The available formats include: `Go`, `PlantUML`, `Typescript`, `Java`, and `JSONSchema`.
```md
cicero get

```bash
cicero generate
save local copies of external dependencies

Options:
--help Show help [boolean]
--version Show version number [boolean]
--template path to the directory with the template
[string] [default: "."]
--format format of the code to generate
[string] [default: "JSONSchema"]
--outputDirectory output directory path [string] [default: "./output/"]
--verbose, -v [default: false]
Options:
--version Show version number [boolean]
--verbose, -v [default: false]
--help Show help [boolean]
--template path to the template [string]
--output output directory path [string]
```
2 changes: 1 addition & 1 deletion docs/concerto-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: concerto-cli
title: Concerto CLI
---

Install the `@accordproject/concerto-cli` npm package to access the Concerto command line interface (CLI). After installation you can use the concerto command and its sub-commands as described below.
Install the `@accordproject/concerto-cli` npm package to access the Concerto command line interface (CLI). After installation you can use the `concerto` command and its sub-commands as described below.

To install the Concerto CLI:
```
Expand Down
Loading