8000 GitHub - rneatherway/gh-slack: Utility for archiving a slack conversation as markdown · GitHub
[go: up one dir, main page]

Skip to content
rneatherwayPublic

About

Utility for archiving a slack conversation as markdown

Topics

Resources

Stars

183 stars

Watchers

1 watching

Forks

Latest commit

 

History

198 Commits

Folders and files

Repository files navigation

gh-slack

CI Release

This project provides a means of archiving a Slack conversation or thread as markdown. For convenience it is installable as a gh extension.

Installation

gh extension install https://github.com/rneatherway/gh-slack

Upgrading

gh extension upgrade gh-slack

Usage

Usage:
  gh-slack [command]

  If no command is specified, the default is "read". The default command also requires a permalink argument <START> for the first message to fetch.
  Use "gh-slack read --help" for more information about the default command behaviour.

Examples:
  gh-slack --details --issue <issue-url> <slack-permalink>  # defaults to read command
  gh-slack read <slack-permalink>
  gh-slack read -i <issue-url> <slack-permalink>
  gh-slack send -m <message> -c <channel-name> -t <team-name>
  gh-slack send -m <message> --thread <slack-permalink>
  gh-slack api post chat.postMessage -b '{"channel":"123","blocks":[...]}
  eval $(gh-slack auth -t <team-name>)
  
  # Example configuration (add to gh's configuration file at $HOME/.config/gh/config.yml):
  extensions:
    slack:
      team: foo
      channel: ops
      bot: robot        # Can be a user id (most reliable), bot profile name or username

Available Commands:
  api         Send an API call to slack
  auth        Prints authentication information for the Slack API (treat output as secret)
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  read        Reads a Slack channel and outputs the messages as markdown
  send        Sends a message to a Slack channel

Flags:
  -h, --help      help for gh-slack
  -v, --verbose   Show verbose debug information

Use "gh-slack [command] --help" for more information about a command.

Configuration

The send subcommand supports storing default values for the team, bot and channel required parameters in gh's own configuration file using a block like:

extensions:
  slack:
    team: foo
    channel: ops
    bot: robot        # Can be a user id (most reliable), bot profile name or username

This is particularly useful if you want to use the send subcommand to interact with a bot serving chatops in a standard operations channel.

Use --thread <slack-permalink> to reply in an existing thread. The permalink supplies the channel and thread. Its workspace supplies the team unless --team or the configured team overrides it for authentication. A raw thread_ts, such as 1712345678.123456, also works when the team and channel are supplied through flags or config.

Limitations

Many and varied, but at least:

  • No paging is used when fetching messages, so if the conversation is too long the output will be truncated.

Development

To release a new version, simply tag it. The goreleaser workflow will take care of the rest. E.g:

git tag 0.0.6
git push origin 0.0.6

About

Utility for archiving a slack conversation as markdown

Topics

Resources

Stars

183 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages

0