Skip to content

Commit 25405e7

Browse files
authored
Update GOVPP_CLI doc (#141)
Signed-off-by: Ondrej Fabry <[email protected]>
1 parent 32e69d2 commit 25405e7

File tree

1 file changed

+50
-45
lines changed

1 file changed

+50
-45
lines changed

Diff for: docs/GOVPP_CLI.md

+50-45
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,31 @@
22

33
This document provides guide for the GoVPP CLI app.
44

5+
---
56

6-
## Installation of GoVPP CLI
7+
## Installation
78

8-
### Prerequisites
9+
To install GoVPP CLI it is currently required to have Go installed on your system.
10+
11+
#### Prerequisites
912

10-
- Go 1.19+
13+
- **Go** 1.19+ ([installation](https://go.dev/doc/install))
1114

12-
### Install
15+
### Install with Go
1316

14-
To install GoVPP CLI, run:
17+
To install from the latest GoVPP release, run:
1518

1619
```shell
17-
# Latest release
1820
go install go.fd.io/govpp/cmd/govpp@latest
21+
```
1922

20-
# Development version
23+
To install the most recent development version, run:
24+
25+
```shell
2126
go install go.fd.io/govpp/cmd/govpp@master
2227
```
2328

24-
## Getting Started with the GoVPP CLI
29+
## Getting Started
2530

2631
The GoVPP CLI is a powerful tool for managing your VPP API development, maintenance and integration. With features such as VPP API schema export, comparison, linting, breaking change detector, Go code bindings generation and running a proxy or HTTP service for the VPP API, the GoVPP CLI offers a comprehensive solution for the VPP API management. The GoVPP CLI is designed to integrate seamlessly with your existing workflow, so you can focus on what matters most: write _great VPP APIs_ and develop control-plane apps to use them. Whether you are working with a small, focused project or a large, complex system, the GoVPP CLI is the perfect choice. In the next few minutes, you will learn how to use the GoVPP CLI to easily execute VPP CLI commands, generate code, compare schemas, and serve VPP API as an HTTP service.
2732

@@ -44,98 +49,98 @@ Let's check the version of GoVPP CLI you'll be using is up-to-date.
4449
govpp --version
4550
```
4651

52+
This will print the version of GoVPP CLI.
53+
4754
## Usage
4855

49-
```
50-
_________ ___ _________________
51-
__ ____/_______ | / /__ __ \__ __ \
52-
_ / __ _ __ \_ | / /__ /_/ /_ /_/ /
53-
/ /_/ / / /_/ /_ |/ / _ ____/_ ____/
54-
\____/ \____/_____/ /_/ /_/
56+
The `govpp` command will print the usage help for the top-level commands and their subcommands by default.
5557

58+
```
59+
______ _ _ _____ _____ govpp v0.8.0
60+
| ____ _____ \ / |_____] |_____] user@machine (go1.20 linux/amd64)
61+
|_____| [_____] \/ | | Mon Jul 3 12:13:24 CEST 2023
62+
5663
Usage:
5764
govpp [command]
58-
65+
5966
Available Commands:
60-
cli Send VPP CLI command
61-
diff Compare two schemas
62-
export Export files to output location
63-
generate Generate code bindings
64-
http Serve VPP API as HTTP service
65-
lint Lint VPP API files
66-
vppapi Print VPP API
67+
cli Send CLI via VPP API
68+
generate Generate code
69+
help Help about any command
70+
http VPP API as HTTP service
71+
vppapi Manage VPP API
6772
6873
Flags:
6974
-D, --debug Enable debug mode
7075
-L, --loglevel string Set logging level
7176
--color string Color mode; auto/always/never
72-
-v, --version version for govpp
77+
--version version for govpp
7378
7479
Use "govpp [command] --help" for more information about a command.
7580
```
7681

77-
### Print VPP API contents
82+
### Show VPP API contents
7883

79-
The `vppapi` command allows you to print the VPP API files and their specific contents
84+
The `vppapi ls` command allows you to print the VPP API files and their specific contents
8085
in various formats. This can be useful for debugging or for generating documentation.
8186

82-
Here's an example usage of the `vppapi` command:
87+
Here's an example usage of the `vppapi ls` command:
8388

8489
```sh
85-
# List VPP API files for installed VPP
86-
govpp vppapi
90+
# List VPP API files for default input
91+
govpp vppapi ls
8792
```
8893

8994
You can use the `--input` flag to specify the input source for the VPP API files.
9095

9196
```sh
9297
# Use current directory as input source (local VPP repository)
93-
govpp vppapi --input="."
98+
govpp vppapi ls .
9499
```
95100

96101
The default format prints the output data in a table, but you can also specify
97102
other output formats such as JSON, YAML or Go template using the `--format` flag.
98103

99104
```sh
100-
# Print in common formats
101-
govpp vppapi --format="json"
102-
govpp vppapi --format="yaml"
105+
# Print using common formats
106+
govpp vppapi ls --format="json"
107+
govpp vppapi ls --format="yaml"
103108

104-
# Print as a Go template
105-
govpp vppapi --format='{{ printf "%+v" . }}'
109+
# Print using a Go template
110+
govpp vppapi ls --format='{{ printf "%+v" . }}'
106111
```
107112

108113
You can use the `--show-contents`, `--show-messages`, `--show-raw`, and `--show-rpc`
109114
flags to show specific parts of the VPP API file(s).
110115

111116
```sh
112-
# Print VPP API file contents
113-
govpp vppapi --show-contents
117+
# List VPP API contents
118+
govpp vppapi ls --show-contents
114119

115-
# Print VPP API messages
116-
govpp vppapi --show-message
120+
# List VPP API messages
121+
govpp vppapi ls --show-message
117122

118-
# Print VPP API services
119-
govpp vppapi --show-rpc
123+
# List RPC services
124+
govpp vppapi ls --show-rpc
120125

121-
# Print raw VPP API file
122-
govpp vppapi --show-raw
126+
# Print raw VPP API files
127+
govpp vppapi ls --show-raw
123128
```
124129

125130
You can also use the `--include-fields` and `--include-imported` flags to include
126131
message fields and imported types, respectively.
127132

128133
For more information on the available flags and options, use the `-h` or `--help` flag.
129134

130-
### Lint VPP API files
135+
### Run linter for VPP API definitions
131136

132137
The `lint` command allows you to run linter checks for your VPP API files. This can help you catch issues early and ensure that your code follows best practices.
133138

134139
Here's an example usage of the `lint` command:
135140

136141
shell
137142
```sh
138-
govpp lint --input="https://github.com/FDio/vpp.git"
143+
govpp vppapi lint https://github.com/FDio/vpp.git
139144
```
140145

141146
This command runs the linter checks on the `master` branch of official VPP repository and outputs any issues found.
@@ -151,7 +156,7 @@ The `diff` command allows you to compare two VPP API schemas and lists the diffe
151156
Here's an example usage of the `diff` command:
152157

153158
```sh
154-
govpp diff ./vppapi2210 --against ./vppapi2302
159+
govpp vppapi diff "./vppapi2210" --against "./vppapi2302"
155160
```
156161

157162
This command compares the VPP API schema from `vppapi2210` directory against the VPP API schema in `vppapi2302` and lists the differences between them. The output shows related information details for each difference.

0 commit comments

Comments
 (0)