All Projects → gotify → Cli

gotify / Cli

Licence: mit
A command line interface for pushing messages to gotify/server.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Cli

Tusk
The modern task runner
Stars: ✭ 181 (-2.16%)
Mutual labels:  cli
Gitmux
💻 Git in your tmux status bar
Stars: ✭ 180 (-2.7%)
Mutual labels:  cli
Neomutt
✉️ Teaching an Old Dog New Tricks -- IRC: #neomutt on irc.libera.chat
Stars: ✭ 2,343 (+1166.49%)
Mutual labels:  cli
Webpack Cli
webpack CLI provides the interface of options webpack uses in its configuration file. The CLI options override options passed in the configuration file.
Stars: ✭ 2,270 (+1127.03%)
Mutual labels:  cli
Msgphp
Reusable domain layers. Shipped with industry standard infrastructure.
Stars: ✭ 182 (-1.62%)
Mutual labels:  cli
Commander
Test your command line interfaces on windows, linux and osx and nodes viá ssh and docker
Stars: ✭ 183 (-1.08%)
Mutual labels:  cli
Emuto
manipulate JSON files
Stars: ✭ 180 (-2.7%)
Mutual labels:  cli
Xo
Command line utility that composes regular expression matches.
Stars: ✭ 184 (-0.54%)
Mutual labels:  cli
Brightness Cli
Change the screen brightness
Stars: ✭ 182 (-1.62%)
Mutual labels:  cli
Tox
Command line driven CI frontend and development task automation tool.
Stars: ✭ 2,523 (+1263.78%)
Mutual labels:  cli
Alive Progress
A new kind of Progress Bar, with real-time throughput, ETA, and very cool animations!
Stars: ✭ 2,940 (+1489.19%)
Mutual labels:  cli
Nodejs Master Class
🛠 This repository contains the homework assignment for Node.js Master Class that is focused on building a RESTful API, web app GUI, and a CLI in plain Node JS with no NPM or 3rd-party libraries
Stars: ✭ 182 (-1.62%)
Mutual labels:  cli
Appfairy
A CLI tool to Migrate a Webflow project into a React app
Stars: ✭ 183 (-1.08%)
Mutual labels:  cli
Piano Rs
A multiplayer piano using UDP sockets that can be played using computer keyboard, in the terminal
Stars: ✭ 180 (-2.7%)
Mutual labels:  cli
Ex cli
User friendly CLI apps for Elixir
Stars: ✭ 183 (-1.08%)
Mutual labels:  cli
Nba Live
Watch NBA games in the terminal, the content in Chinese only.
Stars: ✭ 181 (-2.16%)
Mutual labels:  cli
Ezshare
Easily share files, folders and clipboard over LAN - Like Google Drive but without internet
Stars: ✭ 182 (-1.62%)
Mutual labels:  cli
Drupal Code Generator
A code generator for Drupal.
Stars: ✭ 184 (-0.54%)
Mutual labels:  cli
Mbt
The most flexible build tool for monorepo
Stars: ✭ 184 (-0.54%)
Mutual labels:  cli
Wowcup
⚽ 💻 The finest Worldcup 2018 CLI.
Stars: ✭ 183 (-1.08%)
Mutual labels:  cli

Gotify-CLI travus-badge badge-release

Gotify-CLI is a command line client for pushing messages to gotify/server. It is not required to push messages. See alternatives.

Features

  • stores token/url in a config file
  • initialization wizard
  • piping support (echo message | gotify push)
  • simple to use
  • watch and push script result changes (gotify watch "curl http://example.com/api | jq '.data'")

Alternatives

You can simply use curl, HTTPie or any other http-client to push messages.

$ curl -X POST "https://push.example.de/message?token=<apptoken>" -F "title=my title" -F "message=my message"
$ http -f POST "https://push.example.de/message?token=<apptoken>" title="my title" message="my message"

Installation

Download the latest release for your os: (this example uses version v1.2.0)

$ wget -O gotify https://github.com/gotify/cli/releases/download/v1.2.0/gotify-cli-linux-amd64
# or
$ curl -Lo gotify https://github.com/gotify/cli/releases/download/v1.2.0/gotify-cli-linux-amd64

Make gotify executable:

$ chmod +x gotify

Test if the Gotify-CLI works: (When it doesn't work, you may have downloaded the wrong file or your device/os isn't supported)

$ gotify version

It should output something like this:

Version:   1.2.0
Commit:    ec4a598f124c149802038c74571aa704a6660c4a
BuildDate: 2018-11-24-19:41:36

(optional) Move the executable to a folder on your $PATH:

$ mv gotify /usr/bin/gotify

Now you can either run the initialization wizard or create a config manually. This tutorial uses the wizard.

$ gotify init

When you've finished initializing Gotify-CLI, you are ready to push messages to gotify/server.

Here are some examples commands, you can view the "push help" via gotify help push (or have a look at push help).

$ gotify push my message
$ gotify push "my message"
$ echo my message | gotify push
$ gotify push < somefile
$ gotify push -t "my title" -p 10 "my message"
$ gotify watch "curl http://example.com/api | jq '.data'"

Help

Uses version v2.1.0

NAME:
   Gotify - The official Gotify-CLI

USAGE:
   cli [global options] command [command options] [arguments...]

VERSION:
   2.1.0

COMMANDS:
     init        Initializes the Gotify-CLI
     version, v  Shows the version
     config      Shows the config
     push, p     Pushes a message
     watch       watch the result of a command and pushes output difference
     help, h     Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help
   --version, -v  print the version

Watch help

NAME:
   cli watch - watch the result of a command and pushes output difference

USAGE:
   cli watch [command options] <cmd>

OPTIONS:
   --interval value, -n value  watch interval (sec) (default: 2)
   --priority value, -p value  Set the priority (default: 0)
   --exec value, -x value      Pass command to exec (default to "sh -c")
   --title value, -t value     Set the title (empty for command)
   --token value               Override the app token
   --url value                 Override the Gotify URL
   --output value, -o value    Output verbosity (short|default|long) (default: "default")

Push help

$ gotify help push
NAME:
   gotify push - Pushes a message

USAGE:
   gotify push [command options] <message-text>

DESCRIPTION:
   the message can also provided in stdin f.ex:
   echo my text | gotify push

OPTIONS:
   --priority value, -p value    Set the priority (default: 0)
   --title value, -t value       Set the title (empty for app name)
   --token value                 Override the app token
   --url value                   Override the Gotify URL
   --quiet, -q                   Do not output anything (on success)
   --contentType value           The content type of the message. See https://gotify.net/docs/msgextras#client-display
   --disable-unescape-backslash  Disable evaluating \n and \t (if set, \n and \t will be seen as a string)

Configuration

Note: The config can be created by gotify init.

Gotify-CLI will search the following paths for a config file:

  • /etc/gotify/cli.json
  • $XDG_CONFIG_HOME/gotify/cli.json
  • ~/.gotify/cli.json
  • ./cli.json

Structure

name description example
token an application token (a client token will not work) A4ZudDRdLT40L5X
url the URL to your gotify/server https://gotify.example.com
defaultPriority Default priority ( set to 0 if not present) 6

Config example

{
  "token": "A4ZudDRdLT40L5X",
  "url": "https://gotify.example.com",
  "defaultPriority": 6
}

Configuration option

If needed, you can disable SSL handcheck validation using an environment variable:

export GOTIFY_SKIP_VERIFY_TLS=True

Dockerfile

The Dockerfile contains the steps necessary to build a new version of the CLI and then run it in a minimal Alpine container.

Build:

docker build -t gotify/gotify-cli .

Run (this assumes your cli.json file is in the current working directory):

docker run -it -v "$PWD/cli.json:/home/app/cli.json" gotify/gotify-cli:latest push -p 5 "Test from Gotify CLI"
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].