Need help with hipchat-cli?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

hipchat
352 Stars 96 Forks MIT License 77 Commits 2 Opened issues

Description

Command line scripts for working with the HipChat REST API

Services available

!
?

Need anything else?

Contributors list

hipchat-cli

Some command line scripts for performing HipChat API calls. For details on how to obtain a token and room id, see the tutorial.

./hipchat_room_message

Used to send a message to a room.

$ cat message.txt | ./hipchat_room_message -t  -r  -f "System"

Configuration

hipchat-cli can be configured with one of the following options in a combination of those.

  • Command-line options
  • Environment variables
  • Configuration file

Command-line options

Command-line options are passed into hipchat-cli. A list of options is available by executing

hipchat_room_message -h
. ``` $ ./hipchatroommessage -h Usage: ./hipchatroommessage -t -r -f

This script will read from stdin and send the contents to the given room as a system message. Or use -i message.

OPTIONS: -h Show this message -t API token -r Room ID -f From name (optional in v2 API) -c Message color (yellow, red, green, purple, gray or random - default: yellow) -m Message format (html or text - default: html) -i Optional: Input to send to room (default: stdin) -l Nagios message level (critical, warning, unknown, ok, down, up). Will override color. -n Trigger notification for people in the room -o API host (api.hipchat.com) -v API version (default: v1) -k Allow curl to make insecure SSL connections ```

Usage example:

$ ./hipchat_room_message -vv2 -t  -r  -i "This is a message"

Environment variables

All options available as command-line options can be passed in as environment variables.

Environment variable

Description
HIPCHATTOKEN API token
HIPCHATROOMID Room ID
HIPCHATFROM From name
HIPCHATCOLOR Message color (yellow, red, green, purple, gray or random - default: yellow)
HIPCHATFORMAT Message format (html or text - default: html)
HIPCHATNOTIFY Trigger notification for people in the room (default: 0)
HIPCHATHOST API host (default: api.hipchat.com)
HIPCHATLEVEL Message Level (targetting Nagios states, critical, warning, unknown, ok)
HIPCHATAPI API version (default: v1)

Usage example:

$ cat message.txt | HIPCHAT_TOKEN= HIPCHAT_ROOM_ID=1234 ./hipchat_room_message -f "System"

Configuration file

All environment variables can be specified in a configuration file. The configuration file is

/etc/hipchat
.

Usage example:

Configuration in

/etc/hipchat
:
bash
HIPCHAT_TOKEN=
HIPCHAT_ROOM_ID=1234

Command-line:

bash
$ cat message.txt | HIPCHAT_FROM="System" ./hipchat_room_message -c green

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.