nudge

command module
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

README

nudge logo

nudge - A Pushover CLI

Current state: Beta. Can be used reliably to send messages daily, most things are stable now. Most of the Pushover 4.0 features are supported.

Current version: v0.7.0

nudge provides a small command line tool to send push notifications over Pushover. It aims to provide a simple and composable tool to send push notifications.

What's New

  • Verify that the recipients you want to send notifications are already present in the account.
  • Internal improvements and refactoring.

For older changes, please refer to release notes or changelog for even more detailed history.

Installing

Just run go install git.sr.ht/~bayindirh/nudge@latest.

Building

After cloning the repository, going to src/ folder and running go build nudge.go should do.

Configuration

You need two keys for Nudge to function. An API key and a User key.

Important: The keys should be placed in nudge.conf file. See file contents for guidance.

The configuration file (nudge.conf) is searched in the following places, in the order given below:

  • . (Current directory where user is in)
  • ~/.config/nudge.conf
  • /etc/nudge.conf
  • $CURRENT_WORKING_DIRECTORY/conf (a conf directory where nudge binary is)
  • $CURRENT_WORKING_DIRECTORY (nudge.conf in the same directory with nudge binary)

The first found file takes precedence over the rest, even if they're present. Unless the file location is overriden via flags and no configuration file is found in any of the given locations, nudge throws an error and exits.

You can use src/conf/nudge.conf.example file as a template. File format is TOML.

Running

Running nudge is simple. Considering your files are in the correct places (see nudge -help for defaults), it's simply:

nudge "Hello, world!"

alternatively, you can integrate nudge to your pipelines (since v0.5.0):

echo "Hello, world!" | nudge

Message titles are set to sender's hostname by default, but can be changed. Message will be sent to all devices registered to that user, with default sound and priority. These can be changed, too.

Current options are as follows:

Usage: nudge [OPTIONS] message
  -attach-image string
    	Attach an image to your notification.
  -config-path string
    	Define or override configuration file path.
  -devices string
    	List of devices to be notified. Separate multiple devices with ','. (default "all")
  -dryrun
    	Simulate sending a notification.
  -expire int
    	Seconds before giving-up re-sending notifications (for priority 2 only). (default 1800)
  -html
    	Enable HTML formatting in notifications.
  -list-recipients
    	Print the list of recipients available on the account and exit.
  -log-level string
    	Change the logging level. (default "warn")
  -priority int
    	Adjust notification priority. Between -2 and 2. (default 0)
  -retry-interval int
    	Seconds between notification re-sends (for priortity 2 only). (default 30)
  -sound string
    	Set notification sound.
  -title string
    	Notification title. Hostname is used if omitted. (default "orion")
  -ttl int
    	Seconds before the notification removed from devices automatically (ignored if priority is 2).
  -url string
    	An optional URL to attach to the notification.
  -url-title string
    	An optional title for URL to send.
  -verify-recipients
    	Verify recipients with Pushover before sending the notification.
  -version
    	Print version and exit.

Known Issues

  • Not all features provided by Pushover is implemented (image attachments, priority 2 message status tracking, and possibly others)

## Roadmap

  • 0.8.0: Support priority 2 (Emergency) notification operations: Get receipt, check acknowledgement, cancel.

Other Details

nudge is written in Go and licensed with GNU/GPLv3 or later. The project uses Semantic Versioning and Conventional Commits.

This project is a part of Very Alpha Technologies ecosystem.

Documentation

Overview

* nudge - A CLI agent for Pushover, written in Go. * Copyright (C) 2024 Hakan Bayindir * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL