A time-like command that will send end of an arbitrary command output and some other info (like exit status) to matrix room.
Consider this project a "bash-oneliner" to do some stuff fast. It's not supposed to be beautiful and shiny, it just must work.
- Run any arbitrary command with colors, tty window size and other fancy stuff
- Collect time information (real/user/sys, like
time command) - Send that info to the matrix room
- Project functionality considered final, so no breaking changes are possible, only fixes, tests and minor updates (like new options)
How it looks like
$ ttm ansible-playbook --with args
# ... scroll-scroll-scroll
PLAY RECAP *****************************************************************************************************************************
gitlab.com : ok=33 changed=0 unreachable=0 failed=0 skipped=147 rescued=0 ignored=0
real 15.166239745s
user 10.330419s
sys 2.213327sttm report
ansible-playbook --with args# end of log (if configured)
PLAY RECAP *****************************************************************************************************************************
gitlab.com : ok=33 changed=0 unreachable=0 failed=0 skipped=147 rescued=0 ignored=0real 15.166239745s
user 10.330419s
sys 2.213327sExit code: 0
# get the ttm app first, from the "How to get" section
# ttm configuration, check the "Configuration" section below to get the full (pretty impressive) list of available options
export TTM_HOMESERVER="https://matrix.example.com"
export TTM_TOKEN="matrix_access_token"
export TTM_ROOM="!XODRhTLplrymaFicdK:etke.cc"
# synax: ttm <any-command> [with any args]
ttm echo "that command will be sent to matrix, alongside with time stats, exit code and neat html formatting"All ttm config options are env vars
- TTM_HOMESERVER - the real address of your matrix HS, not a delegated url, eg:
https://matrix.example.com - TTM_ROOM - matrix room id or alias, eg:
!XODRhTLplrymaFicdK:etke.ccor#ttm:etke.cc
auth can be done with access token or login/password, that's up to you
login/password if you want to login with matrix user login and password
- TTM_LOGIN - matrix login (localpart), eg:
ttm, not@ttm:example.com - TTM_PASSWORD - matrix password, eg:
superSecurePassword
access token if you want to login with existing session
- TTM_TOKEN - matrix session access token
- TTM_LOG - send full log information to matrix, allowed values:
0,1; default:0 - TTM_MSGTYPE - message type, allowed values:
m.text,m.notice; default:m.text - TTM_NOHTML - do not send html-formatted message, only plaintext (increases allowed log size x2), allowed values:
0,1; default:0 - TTM_NOTEXT - do not send plaintext message, only html (increases allowed log size x2), allowed values:
0,1; default:0 - TTM_NOTICEFAIL - send message with
TTM_MSGTYPE="m.notice"if exit code is not 0, allowed values:0,1; default:0 - TTM_NOTIME - do not send time information to matrix, allowed values:
0,1; default:0
following env vars still available and work, but were replaced:
- TTM_ROOMID (use TTM_ROOM instead) - matrix room id or alias (eg:
!fsafaFSAsf:example.comor#ttm:etke.cc)
ttm developed by etke.cc, say hello in #ttm:etke.cc matrix room (or ask questions, if you have any)