https://github.com/accordproject/template-cli
Command Line Interface for template engine and data format conversion
https://github.com/accordproject/template-cli
Last synced: 5 months ago
JSON representation
Command Line Interface for template engine and data format conversion
- Host: GitHub
- URL: https://github.com/accordproject/template-cli
- Owner: accordproject
- License: apache-2.0
- Created: 2023-03-20T10:23:45.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-20T08:28:25.000Z (over 2 years ago)
- Last Synced: 2025-07-01T20:50:12.826Z (6 months ago)
- Language: TypeScript
- Size: 241 KB
- Stars: 1
- Watchers: 6
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Accord Project Template Manager
Command Line Interface for the [Accord Project Template Engine](https://github.com/accordproject/template-engine).
## Install
```shell
npm i @accordproject/template-cli -g
```
## Example Commands
### Help
```shell
ten help
```
### Generate
The `generate` command creates a document from a template + data.
The command below generates an HTML file using the `helloworld` template:
```shell
ten generate ~/dev/template-engine/test/templates/full/ ~/dev/template-engine/test/templates/full/data.json html ~/Desktop/test.html
```
### Compile
The `compile` command compiles a template to TypeScript code
The command below compiles the `helloworld` template:
```shell
ten compile ~/dev/template-engine/test/templates/helloworld ~/dev/temp/helloworld
```
To run the generated code:
```
cd ~/dev/temp/helloworld
npm i
npm start ~/dev/template-engine/test/templates/helloworld/data.json
```
The output should be:
```json
{
"$class": "org.accordproject.commonmark@0.5.0.Document",
"xmlns": "org.accordproject.commonmark@0.5.0",
"nodes": [
{
"$class": "org.accordproject.ciceromark@0.6.0.Contract",
"name": "top",
"nodes": [
{
"$class": "org.accordproject.commonmark@0.5.0.Paragraph",
"nodes": [
{
"$class": "org.accordproject.commonmark@0.5.0.Text",
"text": "Hello ",
"nodes": []
},
{
"$class": "org.accordproject.ciceromark@0.6.0.Variable",
"name": "message",
"value": "\"World\""
},
{
"$class": "org.accordproject.commonmark@0.5.0.Text",
"text": ".",
"nodes": []
}
]
}
]
}
]
}
```