Skip to main content
Zingat includes a command-line client (clipclient) for creating and managing clips from the terminal.

Installation

The CLI client is built as part of the Zingat project:
# Build the CLI client
cargo build --release --bin clipclient

# Install globally (optional)
cargo install --path . --bin clipclient
Zingat API Client

USAGE:
    clipclient --api-key <api-key> [addr] <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
        --api-key <api-key>    

ARGS:
    <addr>     [env: ZINGAT_ADDR=]  [default: http://127.0.0.1:8000]

SUBCOMMANDS:
    get       
    help      Prints this message or the help of the given subcommand(s)
    new       
    update    

Basic Usage

clipclient --api-key <api-key> [addr] <SUBCOMMAND>
Options:
  • --api-key <api-key>: API key for authentication (required)
  • [addr]: Server address (optional, defaults to http://127.0.0.1:8000)
    • Can also be set via ZINGAT_ADDR environment variable
Subcommands:
  • get: Retrieve a clip by shortcode
  • new: Create a new clip
  • update: Update an existing clip
  • help: Show help information

Examples

Generate API Key

First, generate an API key:
# Get API key from server
xh GET http://localhost:8000/api/clip/key

Create Clip

# Create a new clip with default address
cargo run --bin clipclient -- --api-key <key> new "Hello from CLI"

# Create a clip with title, password, and expiry
cargo run --bin clipclient -- --api-key <key> new "Content here" \
  --title "My Clip" \
  --password "secret123" \
  --expires "2024-12-31"

# Create a paste on a remote server
cargo run --bin clipclient -- --api-key <key> https://zingat.example.com new "Remote paste"

Get Clip

# Get a clip by shortcode
cargo run --bin clipclient -- --api-key <key> get <shortcode>

# Get clip from remote server
cargo run --bin clipclient -- --api-key <key> https://zingat.example.com get <shortcode>

Update Clip

# Update an existing clip
cargo run --bin clipclient -- --api-key <key> update <shortcode> "Updated content"

# Update with all options
cargo run --bin clipclient -- --api-key <key> update <shortcode> "New content" \
  --title "Updated Title" \
  --password "newpass" \
  --expires "2025-01-01"

Using Environment Variable

# Set server address via environment variable
export ZINGAT_ADDR=https://zingat.example.com
cargo run --bin clipclient -- --api-key <key> new "Content"