{"id":24434035,"url":"https://github.com/itspriddle/slack-notify","last_synced_at":"2026-05-06T17:35:27.166Z","repository":{"id":181529126,"uuid":"666821534","full_name":"itspriddle/slack-notify","owner":"itspriddle","description":"Bash script to send notifications via legacy Slack incoming webhooks","archived":false,"fork":false,"pushed_at":"2023-07-20T21:53:27.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-01T17:53:37.952Z","etag":null,"topics":["bash","slack"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itspriddle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-15T17:28:57.000Z","updated_at":"2023-07-18T14:36:19.000Z","dependencies_parsed_at":"2025-01-20T16:53:03.204Z","dependency_job_id":"9b7fdf68-c458-44d7-9cdb-7f11878f60a6","html_url":"https://github.com/itspriddle/slack-notify","commit_stats":null,"previous_names":["itspriddle/slack-notify"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/itspriddle/slack-notify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itspriddle%2Fslack-notify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itspriddle%2Fslack-notify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itspriddle%2Fslack-notify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itspriddle%2Fslack-notify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itspriddle","download_url":"https://codeload.github.com/itspriddle/slack-notify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itspriddle%2Fslack-notify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32704646,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","slack"],"created_at":"2025-01-20T16:52:59.163Z","updated_at":"2026-05-06T17:35:27.152Z","avatar_url":"https://github.com/itspriddle.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slack-notify\n\nSend notifications via legacy Slack incoming webhooks. Requires Bash, jq, and curl.\n\nWhy? Slack keeps letting us create them, so we'll keep using them.\n\n## Synopsis\n\n    slack-notify [options] \u003cmessage\u003e\n    echo \"Message\" | slack-notify [options]\n    slack-notify -F \"Field Title|Body\" [options]\n\n## Description\n\nWithout the `-F` / `--field` option, a standard text message is sent to the\nwebhook, either as the first argument or STDIN.\n\nText Example:\n\n    $ slack-notify \"This is a message\"\n    $ echo \"This is a message | slack-notify\"\n\nWhen `-F` / `--field` is used, a Slack message \"attachment\" is used (not\nto be confused with a file attachment). Messages sent via legacy webhooks\ncan have more than one attachment, or none at all as with the text example\nabove. Attachments have one or more fields. By default, one attachment is\nused and multiple fields can be added to it by specifying `-F` / `--field`\nmore than once. To send more than one attachment, `-F` / `--field` can be\nused with an index; eg: `-F1` / `--field2`. To further style messages, the\n`-c` / `--color`, `-p` / `--pretext`, `-b` / `--fallback`, and `-f` /\n`--footer` options can also be used with an index.\n\nFields have a title and a value. The option can be used more than\nonce. The argument to `-F` / `--field` is a string, separated by the `-s`\n/ `--separator` character (`|` by default).\n\nSlack allows specifying long or short fields. If multiple short fields are\nsent, they will be displayed in 2 columns in Slack clients. Long fields\nspan both columns. Fields are marked short by default or when the title is\nprefixed with `short:`. Fields are marked long when the title is prefixed\nwith `long:`.\n\nSingle attachment example with 2 fields:\n\n    $ slack-notify -F \"Field Title|Body\" -F \"Another Field|Body\"\n\nMultiple attachments, red and green:\n\n    $ slack-notify \\\n        -F \"Field Title|Body\" \\\n        -F \"Another Field|Body\" \\\n        -c FF0000 \\\n        -f \"The First Footer\" \\\n        -F1 \"Attachment 2 - Field Title|Body\" \\\n        -F1 \"Attachment 2 - Another Field|Body\" \\\n        -F1 \"long:Attachment 2 - Big Long Field|Body\" \\\n        -c1 00FF00 \\\n        -p1 \"Attachment 2 Ready\"\n\nThe following options have no effect when sending a plaintext message:\n\n- `-b` / `--fallback`\n- `-p` / `--pretext`\n- `-c` / `--color`\n- `-s` / `--separator`\n- `-f` / `--footer`\n\n## Options\n\n*-w URL*, *--webhook-url URL*  \n    Slack webhook URL. Required unless the `$SLACK_WEBHOOK_URL` environment\n    variable is set.\n\n*-c CHANNEL*, *--channel CHANNEL*  \n    Slack channel/user to send the message to. If not supplied, the\n    default channel configured on the webhook is used by Slack.\n\n*-i ICON*, *--icon ICON*  \n    Icon to use, either an emoji code like `:megaphone:`, or an image URL.\n    If not supplied, the default icon configured on the webhook is used by\n    Slack.\n\n*-u USER*, *--username USER*  \n    User to send the message as. If not supplied, the default user\n    configured on the webhook is used by Slack.\n\n*-F FIELD*, *--field FIELD*  \n    Send a message field in the format where FIELD is one of the following\n    formats: `Title|Value`, `long:Title|Value`, `short:Title|Value`. The field\n    separator `|` character can be customized with the `-s` / `--separator`\n    option.\n\n*-F[0-9]+ FIELD*, *--field[0-9]+ FIELD*  \n    Same as `-F` / `--field` above, but adds the field a to the message\n    attachment with the specified index. Eg: `-F1 FIELD`,\n    `--field2 FIELD`.\n\n*-b FALLBACK*, *--fallback FALLBACK*  \n    Fallback text to send. This is displayed in notifications. If not\n    supplied, a default fallback is created using a line \"Title: Value\"\n    for each field. Ignored if at least one field is not supplied with\n    `-F` / `--field`.\n\n*-b[0-9]+ FALLBACK*, *--fallback[0-9]+ FALLBACK*  \n    Same as `-f` / `--fallback` above, but adds the fallback text to the\n    message attachment with the specified index. Eg: `-b1 FALLBACK`,\n    `--fallback2 FALLBACK`.\n\n*-p PRETEXT*, *--pretext PRETEXT*  \n    Message pretext, displayed above the attachment. Ignored if at least one\n    field is not supplied with `-F` / `--field`.\n\n*-p[0-9]+ PRETEXT*, *--pretext[0-9]+ PRETEXT*  \n    Same as `-p` / `--pretext` above, but adds the pretext to the message\n    attachment with the specified index. Eg: `-p1 PRETEXT`,\n    `--pretext2 PRETEXT`.\n\n*-c COLOR*, *--color COLOR*  \n    Color of the attachment in CSS hex format (i.e. `#FF0000`). Ignored if at\n    least one field is not supplied with `-F` / `--field`.\n\n*-c[0-9]+ COLOR*, *--color[0-9]+ COLOR*  \n    Same as `-c` / `--color` above, but adds the color to the message\n    attachment with the specified index. Eg: `-c1 COLOR`,\n    `--color2 COLOR`.\n\n*-f FOOTER*, *--footer FOOTER*  \n    Footer text, displayed below the attachment. Ignored if at least one\n    field is not supplied with `-F` / `--field`.\n\n*-f[0-9]+ FOOTER*, *--footer[0-9]+ FOOTER*  \n    Same as `--footer` above, but adds the footer to the message\n    attachment with the specified index. Eg: `-f1 FOOTER`,\n    `--footer2 FOOTER`.\n\n*-P*, *--print-payload*  \n    Print the Slack payload instead of sending it.\n\n*-h*, *--help*  \n    Print this help message.\n\n## Examples\n\nNote: all examples below assume the `$SLACK_WEBHOOK_URL` environment variable\nis set or you must include the `-w` / `--webhook-url` option.\n\nSend a simple text notification\n\n    $ slack-notify \"Warning, something broke\"\n\nOr use a multi-line body\n\n    $ slack-notify \"Subject\n\n    This is the body\"\n\nUsing STDIN\n\n    $ { echo \"Errors\\n\\n\"; tail -5 /var/log/messages } | slack-notify\n\n    $ slack-notify\n    This is a message\n    ^d\n\n    $ slack-notify \u003c\u003c\u003c 'Red alert, Number 1!'\n\nSend a single attachment with 3 fields, the top two short, and the last\none long, with the color set to green, and a simple pretext\n\n    $ slack-notify \\\n        -F \"Date|2023-07-17\" \\\n        -F 'Amount|$10.99' \\\n        -F 'long:Description|Pizza' \\\n        -p 'New Order Received:' \\\n        -c 00FF00\n\nSend two attachments, the first with 2 short fields with the color set to\ngreen, the second with 1 long attachment with the color set to red.\n\n    $ slack-notify \\\n        -F1 'Username|josh' \\\n        -F1 'GitHub|\u003chttps://github.com/itspriddle|itspriddle\u003e' \\\n        -c1 00FF00 \\\n        -p1 'New User Created:' \\\n        -F1 'long:Field 3|Value 3' \\\n        -c2 FF0000\n\n## Optional Configuration\n\n`$SLACK_WEBHOOK_URL` can be set to avoid passing webhooks via `-w` /\n`--webhook-url` when calling this script. Example:\n\n    export SLACK_WEBHOOK_URL=https://hooks.slack.com/services/...\n\n## Installation\n\n`slack-notify` includes the main [`bin/slack-notify`](./bin/slack-notify) bash\nscript and an optional man page\n[`share/man/man1/slack-notify.1`](./share/man/man1/slack-notify.1).\n\nTo install `slack-notify`, the bash script needs to be copied to a directory\nin your `$PATH`. If you want `man slack-notify` to work, the man page needs to\nbe copied to a directory in your `$MANPATH`.\n\n### Install globally via Homebrew on macOS\n\nOn macOS, `slack-notify` can be installed via Homebrew with:\n\n    brew install itspriddle/slack-notify/slack-notify\n\n### Install globally via make\n\nmacOS and most Linux distributions add `/usr/local/bin` to `$PATH` and\n`/usr/local/share/man` to `$MANPATH`. If you are the only user on the machine,\nor if you want to make `slack-notify` available for all users, you can install\nit globally as follows:\n\n    git clone https://github.com/itspriddle/slack-notify\n    cd slack-notify\n    sudo make install PREFIX=/usr/local\n\n### Install locally via make\n\nIf you don't want a global installation, another common pattern is to install\nto `~/.local`. This is enabled on Ubuntu by default.\n\n    git clone https://github.com/itspriddle/slack-notify\n    cd slack-notify\n    make install PREFIX=~/.local\n\nTo test, verify that `slack-notify -V` works and that `man slack-notify`\nprints the man page.\n\nIf you see `slack-notify: command not found`, you need to update your `$PATH`.\nIf you are using Bash, add the following to `~/.bash_profile`, or if you are\nusing ZSH, add it to `~/.zshenv`:\n\n    export PATH=\"$HOME/.local/bin:$PATH\"\n\nIf `man slack-notify` reports `No manual entry for slack-notify`, you need to\nupdate your `$MANPATH`. This can be done by adding the following to\n`~/.manpath` (note, change USER to your username):\n\n    MANDATORY_MANPATH /home/USER/.manpath\n\n### Copy the script manually\n\nThe `slack-notify` script can also be downloaded manually and saved to any\ndirectory in your `$PATH` (such as `/usr/local/bin` or `~/.local/bin` as\ndescribed above).\n\n    wget https://github.com/itspriddle/slack-notify/raw/master/bin/slack-notify\n    chmod +x slack-notify\n    sudo mv slack-notify /usr/local/bin\n    slack-notify -V\n\nInstall the man page:\n\n    wget https://github.com/itspriddle/slack-notify/raw/master/share/man/man1/slack-notify.1\n    mkdir -p /usr/local/share/man/man1\n    mv slack-notify.1 /usr/local/share/man/man1\n    man slack-notify\n\n## Development\n\n### Tests\n\nTests for this project are written using\n[Bats](https://github.com/bats-core/bats-core) and are in the\n[`test/`](./test) directory. To install Bats and run the test suite run:\n\n    make bootstrap\n    make bats\n\nBash files are also checked with [ShellCheck](https://www.shellcheck.net). To\nrun ShellCheck:\n\n    make shellcheck\n\nTo run Bats tests and ShellCheck:\n\n    make test\n\n### Documentation\n\nDocumentation for this project exists in:\n\n- This README file\n- The [`bin/slack-notify`](./bin/slack-notify) script's comments at the top of\n  the file (shown when `slack-notify --help` is used)\n- The Markdown file at\n  [`doc/man/slack-notify.1.md`](./doc/man/slack-notify.1.md) that the man page\n  is generated from\n\nIf documentation is updated it should be done in all of the places above.\n\nThe man page is written in Markdown in the\n[`doc/man/slack-notify.1.md`](./doc/man/slack-notify.1.md) file. The\n[kramdown-man](https://github.com/postmodern/kramdown-man) Ruby Gem is used to\ngenerate a roff file that `man` uses.\n\nIf you have Ruby installed, the kramdown-man gem can be installed as follows:\n\n    gem install kramdown-man\n\nThe roff file can be generated using one of the following:\n\n    make man\n    make share/man/man1/slack-notify.1\n\nThis will regenerate `share/man/man1/slack-notify.1` from the contents of\n`doc/man/slack-notify.1.md`. Both files should be committed to the repo.\n\n## Bug Reports\n\nIssues can be reported on GitHub:\n\n\u003chttps://github.com/itspriddle/slack-notify/issues\u003e\n\n## Author\n\nJoshua Priddle \u003cjpriddle@me.com\u003e\n\n\u003chttps://github.com/itspriddle/slack-notify#readme\u003e\n\n## License\n\nMIT License. See [LICENSE](./LICENSE) in this repo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitspriddle%2Fslack-notify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitspriddle%2Fslack-notify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitspriddle%2Fslack-notify/lists"}