A command line interface for ZWS instances.
zws [options] [url]
zws [options] shorten [url]
zws [options] stats [url]
zws [options] config
Flags | Description |
---|---|
-h , --help |
Print help and exit. |
-v , --version |
Print version and exit. |
--json |
Output JSON. |
--plain |
Output without formatting. |
--no-input |
Disable reading from stdin . |
Shortens the provided URL.
zws [options] [url]
zws [options] shorten [url]
If no URL is provided and --no-input
is not provided and the terminal is not a TTY it will be read from stdin
.
View total statistics for the configured ZWS instance.
zws [options] stats
View usage statistics for a shortened URL.
zws [options] stats <url>
Print the current configuration.
You can view the config path and if it's being loaded with the -h
or --help
flag.
zws [options] config
The config is stored as zws.ini
in the config directory of the current user for applications as the Nim configuration file format.
[Api]
url = "https://api.example.com"
token = "YTdaKVdfGPxdkKaayRwaVHvLXtVkPdPz"
[Shortened]
baseUrl = "https://example.com"
Key | Description | Default |
---|---|---|
url |
The URL of the ZWS instance. | https://api.zws.im |
token |
The API token to use in requests. Only required for custom instances with authentication configured. |
Key | Description | Default |
---|---|---|
DEPRECATED baseUrl |
The URL shortened IDs should be appended to. You only need to set this if you can't set the base URL on the API side. | https://zws.im if Api.url is set to default, otherwise the value of Api.url |
Nimble is the preferred way to install the CLI and is the best option for regular use.
Docker is easiest for testing but containers are slower compared to native host execution.
-
Install via Nimble
nimble install zws
An official Docker image is published on Docker Hub as zwsim/cli
.
docker run --rm zwsim/cli [options] url
- Download a binary from the latest release
- Add the binary to your
PATH
- Windows users will also need to add these DLLs to their
PATH