Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yuzutech/kroki-cli
A Kroki CLI
https://github.com/yuzutech/kroki-cli
cli diagrams golang images kroki
Last synced: 6 days ago
JSON representation
A Kroki CLI
- Host: GitHub
- URL: https://github.com/yuzutech/kroki-cli
- Owner: yuzutech
- License: mit
- Created: 2019-02-12T18:44:54.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-15T02:16:41.000Z (5 months ago)
- Last Synced: 2024-11-07T14:19:28.201Z (13 days ago)
- Topics: cli, diagrams, golang, images, kroki
- Language: Go
- Size: 3.97 MB
- Stars: 65
- Watchers: 5
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
= Kroki CLI
image:https://github.com/yuzutech/kroki-cli/workflows/CI/badge.svg[Build Status,link=https://github.com/yuzutech/kroki-cli/actions?query=workflow%3ACI]
A CLI for https://kroki.io.
== Usage
kroki convert hello.dot
By default, the diagram type will be inferred from the diagram file extension and the default output format will be `SVG`.
Long format:
kroki convert hello.dot --type dot --format svg
The output format can also be inferred from the output file using the `--out-file` flag:
kroki convert simple.er --out-file out.png
Read from `stdin`:
cat hello.dot | kroki convert - -t dot
By default, when reading from `stdin` using `-`, the result will be output to `stdout`.
If you want to output to a file you can use `-o`:cat hello.dot | kroki convert - -t dot -o out.png
Similarly, you can also output to `stdout` when reading from a file using the special value `-` with the `--out-file` flag:
kroki convert simple.er --out-file -
== Installation
The https://github.com/yuzutech/kroki-cli/releases[releases page] provides binaries for each version to download.
You can also install the package directly from source. The compiled binary will be put into `$GOPATH/bin/` or `$HOME/go/bin/` if `$GOPATH` is not set:
```bash
go install github.com/yuzutech/kroki-cli/cmd/kroki@latest
```== Configuration
To configure the endpoint, you can use a configuration file.
The CLI will look for the following locations:* `/etc/kroki.yml`
* `$HOME/kroki.yml`
* `kroki.yml`You can also specify an alternate config file using the `--config` flag:
kroki convert hello.dot --config config.yml
The config file should contain the endpoint URL and the HTTP timeout.
By default, Kroki will use the demonstration server: https://demo.kroki.io and a timeout of 20 seconds.CAUTION: Please note that the demonstration server usage is restricted to reasonable, non-commercial use-cases.
We provide no guarantee regarding uptime or latency.Example:
.kroki.yml
```yml
endpoint: 'https://localhost:8000'
timeout: 30s
```If you don't want to use a file you can also use the following environment variables:
* `KROKI_ENDPOINT`
* `KROKI_TIMEOUT`[]
KROKI_ENDPOINT=https://localhost:8000 KROKI_TIMEOUT=1m kroki convert hello.dot