No description
Find a file
2025-02-13 15:56:49 +00:00
.github/workflows build(deps): update jiro4989/setup-nim-action action to v2 (#84) 2024-07-09 20:31:32 -07:00
.vscode build: add recommended extensions 2021-09-04 01:56:16 -07:00
.yarn/releases build(deps): update yarn to v3.8.7 2024-12-04 02:18:28 +00:00
src feat: handle invalid JSON better 2021-10-19 05:37:15 -07:00
.dockerignore feat: create ZWS CLI 2021-02-24 10:23:59 -08:00
.editorconfig ci(deploy): install C build toolchain 2021-02-24 10:50:37 -08:00
.gitattributes feat: create ZWS CLI 2021-02-24 10:23:59 -08:00
.gitignore feat: create ZWS CLI 2021-02-24 10:23:59 -08:00
.prettierignore feat: create ZWS CLI 2021-02-24 10:23:59 -08:00
.releaserc.json fix: include Windows builds in CD 2021-09-15 08:17:08 -07:00
.yarnrc.yml build(deps): update yarn to v3.8.7 2024-12-04 02:18:28 +00:00
cli.nimble feat: handle invalid JSON better 2021-10-19 05:37:15 -07:00
Dockerfile build(deps): update alpine docker tag to v3.21.2 2025-01-08 22:41:25 +00:00
package.json build(deps): update dependency prettier to v3.5.1 2025-02-13 15:56:49 +00:00
README.md feat(shorten): improve deprecation notice for Shortened.baseUrl 2021-10-17 21:32:38 -07:00
renovate.json build(renovate): use @jonahsnider config 2021-04-16 17:50:32 -07:00
yarn.lock build(deps): update dependency prettier to v3.5.1 2025-02-13 15:56:49 +00:00

zws-im/cli

A command line interface for ZWS instances.

Usage

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.

Subcommands

shorten (default)

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.

stats

View total statistics for the configured ZWS instance.

zws [options] stats

stats <url>

View usage statistics for a shortened URL.

zws [options] stats <url>

config

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

Config

The config is stored as zws.ini in the config directory of the current user for applications as the Nim configuration file format.

Full example

[Api]
url = "https://api.example.com"
token = "YTdaKVdfGPxdkKaayRwaVHvLXtVkPdPz"

[Shortened]
baseUrl = "https://example.com"

Api

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.

Shortened

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

Installation

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.

Nimble

  1. Install Nim and Nimble

  2. Install via Nimble

    nimble install zws
    

Docker

An official Docker image is published on Docker Hub as zwsim/cli.

docker run --rm zwsim/cli [options] url

Manual installation

  1. Download a binary from the latest release
  2. Add the binary to your PATH
  3. Windows users will also need to add these DLLs to their PATH