Skip to content

Commit 13eee65

Browse files
committed
docs: added push and publish command
1 parent 85a047e commit 13eee65

1 file changed

Lines changed: 47 additions & 23 deletions

File tree

README.md

Lines changed: 47 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,68 +4,92 @@ This repository contains all definitions for Code0. These definitions will be us
44
## Definition CLI
55

66
### Setup
7-
First download cargo to use the cli.
7+
First install Cargo to use the CLI.
88
[Install Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html)
99

1010
Then run:
1111
```bash
1212
cargo install code0-cli
1313
```
1414

15-
After the cli compiled succesfully you can use it via:
15+
After the CLI compiles successfully, use it via:
1616
```bash
1717
code0-cli
1818
```
1919

2020
### Usage
21-
(Stay inside the root directory when running the command)
21+
Stay inside the repository root when running commands against the local `definitions` folder. Most commands use `./definitions` by default.
2222

2323
#### Download
24-
Will download the latest Definitions from the Code0 Definition Repository.
24+
Downloads `definitions.zip` from the Code0 definition GitHub releases and extracts it into `./definitions`.
2525

26-
If no feature is specified, all features will be downloaded. If a feature is specified, only that feature will be kept & can be loaded by one of the following languages: TypeScript, Rust.
27-
28-
-f (--features) is a list of features that will be downloaded.
29-
-t (--tag) is the version tag of the release you want to select.
26+
-t (--tag) selects a specific release tag.
27+
-f (--features) keeps only the listed extracted definition folders.
3028

3129
```bash
3230
code0-cli download
3331
code0-cli download -t def-0.0.8
34-
code0-cli download -f feature_1 feature_2 feature_3
35-
code0-cli download -t def-0.0.8 -f feature_1 feature_2 feature_3
32+
code0-cli download -f taurus-number taurus-text
33+
code0-cli download -t def-0.0.8 -f taurus-number taurus-text
3634
```
3735

38-
#### General Report
39-
Will create a report of all errors in the definitions.
36+
#### Report
37+
Validates the definitions and prints a summary report.
4038

4139
```bash
4240
code0-cli report
4341
code0-cli report -p /path/to/definitions
4442
```
4543

46-
#### Feature Report
47-
Will create a report of all errors in the definitions for a specific feature. Will also report on all specified functions, data types, and flow types.
44+
#### Module
45+
Prints definition details for all modules, or for one module by identifier.
4846

4947
```bash
50-
code0-cli feature
51-
code0-cli feature -p /path/to/definitions
52-
code0-cli feature -f feature_name
53-
code0-cli feature -f feature_name -p /path/to/definitions
48+
code0-cli module
49+
code0-cli module -n taurus-number
50+
code0-cli module -p /path/to/definitions
51+
code0-cli module -n taurus-number -p /path/to/definitions
5452
```
5553

5654
#### Watch for Changes
57-
Will run the report each time a definition file changes.
55+
Runs the analyser whenever a definition file changes.
5856

5957
```bash
6058
code0-cli watch
6159
code0-cli watch -p /path/to/definitions
60+
code0-cli watch --ignore-warnings
61+
```
62+
63+
#### Search
64+
Searches for a specific definition by identifier or runtime name and prints the matching JSON.
65+
66+
```bash
67+
code0-cli search -n std::number::add
68+
code0-cli search -n std::number::add -p /path/to/definitions
69+
```
70+
71+
#### Publish
72+
Generates publishable definitions from the source definitions. By default, it reads from `./definitions` and writes to `./out`.
73+
74+
```bash
75+
code0-cli publish -v 0.0.8
76+
code0-cli publish -v 0.0.8 -p /path/to/definitions
77+
code0-cli publish -v 0.0.8 -p /path/to/definitions -o /path/to/out
6278
```
6379

64-
#### Definition
65-
Will search for a specific definition.
80+
To replace the source folder with the generated output, use:
6681

6782
```bash
68-
code0-cli definition -n definition_name
69-
code0-cli definition -n definition_name -p /path/to/definitions
83+
code0-cli publish -v 0.0.8 --path definitions --out out
84+
rm -rf definitions
85+
mv out definitions
7086
```
7187

88+
#### Push
89+
Pushes definitions to a Sagittarius endpoint.
90+
91+
```bash
92+
code0-cli push -t "$SAGITTARIUS_TOKEN" -u "https://sagittarius.example.com"
93+
code0-cli push -t "$SAGITTARIUS_TOKEN" -u "https://sagittarius.example.com" -v 0.0.8
94+
code0-cli push -t "$SAGITTARIUS_TOKEN" -u "https://sagittarius.example.com" -p /path/to/definitions
95+
```

0 commit comments

Comments
 (0)