npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

slacktool

v0.1.2

Published

Slack utils

Downloads

5

Readme

Slack Utils

This is a set of tool that helps working with Slack in bulk such as: listing channels, archiving, etc...

Installation

$ npm install -g slacktool

or

$ npx slacktool

Configuration

All the subcommands and interactions require a Slack access token (Api token) to work. You need to pass the token as a parameter

Generating your token

To get started, you can generate an APP token here: https://api.slack.com/tutorials/tracks/getting-a-token

Slack App manifest example

display_information:
  name: slacktool
  description: An app for slack utils
  background_color: "#d982b5"
features:
  app_home:
    home_tab_enabled: false
    messages_tab_enabled: true
    messages_tab_read_only_enabled: true
  bot_user:
    display_name: Slack Utils
    always_online: true
oauth_config:
  scopes:
    user:
      - channels:history
      - channels:read
      - channels:write
      - chat:write
      - files:read
      - files:write
      - groups:history
      - groups:read
      - groups:write
      - im:history
      - im:read
      - im:write
      - links:read
      - links:write
      - mpim:history
      - mpim:read
      - mpim:write
      - pins:read
      - pins:write
      - reactions:read
      - reactions:write
      - reminders:read
      - reminders:write
      - team:read
      - usergroups:read
      - usergroups:write
      - users.profile:read
      - users:read
      - users:write
    bot:
      - app_mentions:read
      - channels:history
      - channels:join
      - channels:manage
      - channels:read
      - chat:write.customize
      - chat:write.public
      - chat:write
      - files:read
      - files:write
      - groups:history
      - groups:read
      - groups:write
      - im:history
      - im:read
      - im:write
      - links:read
      - links:write
      - mpim:history
      - mpim:read
      - mpim:write
      - pins:read
      - pins:write
      - reactions:read
      - reactions:write
      - reminders:read
      - reminders:write
      - team:read
      - usergroups:read
      - usergroups:write
      - users:read
      - users:write
      - users.profile:read
settings:
  event_subscriptions:
    bot_events:
      - app_mention
  interactivity:
    is_enabled: true
  org_deploy_enabled: false
  socket_mode_enabled: true
  token_rotation_enabled: false

Getting help :smiley:

$ slacktool --version
v0.1.0

$ slacktool --help
  Usage: slacktool [options] [command]

  Options:
    -V, --version         output the version number
    -a, --token <token>,  Slack API token
    -h, --help            display help for command

  Commands:
    channels [options]    Works with the channels API
    help [command]        display help for command


  See <https://github.com/mrtrom/slacktool> for more complete docs
  Please report bugs to <https://github.com/mrtrom/slacktool/issues>

Usage

Basic authoization

$ slacktool --token=[YOUR_TOKEN]

Channels

This allows you to interact with Slack channels (conversations). All these subcommands accept filters like --starts-with or --contains. Deleting and Archiving allow --dry-run mode to simulate the behavior without making real changes.

Listing Channels

Listing all your channels

$ slacktool --token=[YOUR_TOKEN] channels --list

Listing all your channels, excluding archived

$ slacktool --token=[YOUR_TOKEN] channels --list --exclude-archived

Listing all your channels with 1 member

$ slacktool --token=[YOUR_TOKEN] channels --list --members 1

Listing all your channels with no members

$ slacktool --token=[YOUR_TOKEN] channels --list --empty-only

Archiving Channels

Remember to first test the execution of this command with the --dry-run argument!!

Watching changes before running this command

$ slacktool --token=[YOUR_TOKEN] channels --archive --exclude-archived --members 1 --dry-run

Archiving all your channels with 1 member

$ slacktool --token=[YOUR_TOKEN] channels --archive --exclude-archived --members 1

Listing all your channels with no members

$ slacktool --token=[YOUR_TOKEN] channels --archive --exclude-archived --empty-only

         

Note: Inspired by https://github.com/santiagobasulto/slack.py