Home

Awesome

bash_unit CI Shellcheck CI GH Language GH stars GH tag GH License basher install

teams-cli

Send messages to MS Teams channels from CLI

🔥 Usage

Program : teams-cli  by p.forret@brightfish.be
Version : v0.0.2 (2023-01-02 12:23)
Purpose : Send messages to MS Teams channels from CLI
Usage   : teams-cli [-h] [-q] [-v] [-f] [-l <log_dir>] [-t <tmp_dir>] [-C <COLOR>] [-I <URL_IMAGE>] [-T <TITLE>] [-U <URL_WEBHOOK>] <action> <template> <body?>
Flags, options and parameters:
    -h|--help        : [flag] show usage [default: off]
    -q|--quiet       : [flag] no output [default: off]
    -v|--verbose     : [flag] also show debug messages [default: off]
    -f|--force       : [flag] do not ask for confirmation (always yes) [default: off]
    -l|--log_dir <?> : [option] folder for log files   [default: ./log]
    -t|--tmp_dir <?> : [option] folder for temp files  [default: ./tmp]
    -C|--COLOR <?>   : [option] color of the message  [default: 666666]
    -I|--URL_IMAGE <?>: [option] public image URL to include  [default: https://raw.githubusercontent.com/cinemapub/teams-cli/master/icon/unsplash.white.jpg]
    -T|--TITLE <?>   : [option] Title of the message  [default: Update]
    -U|--URL_WEBHOOK <?>: [option] MS Teams Webhook URL to use as destination
    <action>         : [choice] action to perform  [options: send,md,check,env,update]
    <template>       : [choice] template to use  [options: simple,image,hero]
    <body>           : [parameter] Body of the message (optional)

### TIPS & EXAMPLES
* use teams-cli send to send an update tp Teams
  teams-cli -T "title" send simple "body"
* use teams-cli md to pipe an update tp Teams
  ( ... generate text ) | teams-cli -T "Title" md
* use teams-cli check to check if this script is ready to execute and what values the options/flags are
  teams-cli check
* use teams-cli env to generate an example .env file
  teams-cli env > .env
* use teams-cli update to update to the latest version
  teams-cli update
* >>> bash script created with pforret/bashew
* >>> for bash development, also check IO:print pforret/setver and pforret/IO:progressbar

⚡️ Examples

> teams-cli send simple "this is my text"

> teams-cli -C FF6600 -T "This is the Title" send simple "this is my text"

> teams-cli -I "https://media2.giphy.com/media/3o7aCZDlmQZLe4Q4V2/giphy.gif" send hero "this is my text"

🚀 Installation

with basher

$ basher install cinemapub/teams-cli

or with git

$ git clone https://github.com/cinemapub/teams-cli.git
$ cd teams-cli

On the MS Teams side:

📝 Acknowledgements

© 2023 Peter Forret