Skip to content

Pincho-App/pincho-sh

Pincho Shell Scripts

License: MIT

Official shell script library for Pincho - Send push notifications from shell scripts, cron jobs, and automation workflows. POSIX sh compatible, zero dependencies (only curl).

Installation

curl -sL https://raw.githubusercontent.com/Pincho-App/pincho-sh/main/install.sh | sh

Get your token: Open app → Settings → Help → copy token

Quick Start

# Source the library
. /usr/local/lib/pincho/pincho.sh

# Set your token
export PINCHO_TOKEN="your_token"

# Send a notification
pincho_send "Deploy Complete" "Version 1.2.3 deployed to production"

Usage

#!/bin/sh
. /usr/local/lib/pincho/pincho.sh

# Basic notification
pincho_send "Title" "Message"

# With all options
pincho_send \
  --title "Deploy Complete" \
  --message "Version 1.2.3 deployed" \
  --type "deployment" \
  --tag "prod" \
  --tag "release" \
  --image "https://example.com/image.png" \
  --action "https://example.com/dashboard"

API Reference

pincho_send

Arguments:

  • --title TEXT - Title (required, max 256 chars)
  • --message TEXT - Message (required, max 4096 chars)
  • --type TEXT - Type for categorization
  • --tag TEXT - Tag (repeatable, max 10)
  • --image URL - Image URL
  • --action URL - Action URL
  • --token TEXT - API token (overrides PINCHO_TOKEN env var)

Exit codes: 0=success, 1=auth error, 2=validation error, 3=rate limit, 4=network error

Shorthand: pincho_send "Title" "Message"

Environment variables:

  • PINCHO_TOKEN (required) - Your API token
  • PINCHO_URL (optional) - API endpoint (default: https://api.pincho.app/send)
  • PINCHO_LAST_RATE_* (exported) - Rate limit info after each request

pincho_notifai

Convert text to notifications using AI. Useful for automation workflows where you have free-form text that should become a structured notification.

Arguments:

  • --text TEXT - Text to convert (required, 5-2500 chars)
  • --type TEXT - Type for categorization
  • --token TEXT - API token (overrides PINCHO_TOKEN env var)

Exit codes: Same as pincho_send

Shorthand: pincho_notifai "Deploy server and restart services"

Example:

pincho_notifai "SSL cert expires in 7 days - renew now"
pincho_notifai --text "Build failed with 3 errors" --type "ci-cd"

Bash Version

For better array handling: . /usr/local/lib/pincho/pincho-bash.sh (requires Bash 4.0+)

Encryption

Not supported in shell scripts. Use CLI tool or language SDKs (Go, Python, JS, PHP, C#, Rust) for encryption.

Examples

See examples/ directory for complete scripts: cron jobs, git hooks, CI/CD, monitoring, error handling, rate limits, parallel sending.

Documentation

Links

License

MIT License - see LICENSE file for details.

About

POSIX shell scripts for Pincho push notifications

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages