| 1 |
# go-tuf client CLI |
| 2 |
|
| 3 |
## Install |
| 4 |
|
| 5 |
``` |
| 6 |
go get github.com/theupdateframework/go-tuf/cmd/tuf-client |
| 7 |
``` |
| 8 |
|
| 9 |
## Usage |
| 10 |
|
| 11 |
The CLI provides three commands: |
| 12 |
|
| 13 |
* `tuf-client init` - initialize a local file store using root keys (e.g. from |
| 14 |
the output of `tuf root-keys`) |
| 15 |
* `tuf-client list` - list available targets and their file sizes |
| 16 |
* `tuf-client get` - get a target file and write to STDOUT |
| 17 |
|
| 18 |
All commands require the base URL of the TUF repository as the first non-flag |
| 19 |
argument, and accept an optional `--store` flag which is the path to the local |
| 20 |
storage. |
| 21 |
|
| 22 |
Run `tuf-client help` from the command line to get more detailed usage |
| 23 |
information. |
| 24 |
|
| 25 |
## Examples |
| 26 |
|
| 27 |
``` |
| 28 |
# init |
| 29 |
$ tuf-client init https://example.com/path/to/repo |
| 30 |
|
| 31 |
# init with a custom store path |
| 32 |
$ tuf-client init --store /tmp/tuf.db https://example.com/path/to/repo |
| 33 |
|
| 34 |
# list available targets |
| 35 |
$ tuf-client list https://example.com/path/to/repo |
| 36 |
PATH SIZE |
| 37 |
/foo.txt 1.6KB |
| 38 |
/bar.txt 336B |
| 39 |
/baz.txt 1.5KB |
| 40 |
|
| 41 |
# get a target |
| 42 |
$ tuf-client get https://example.com/path/to/repo /foo.txt |
| 43 |
the contents of foo.txt |
| 44 |
|
| 45 |
# the prefixed / is optional |
| 46 |
$ tuf-client get https://example.com/path/to/repo foo.txt |
| 47 |
the contents of foo.txt |
| 48 |
``` |