Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@slack/cli-hooks

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@slack/cli-hooks

Node implementation of the contract between the Slack CLI and Bolt for JavaScript

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
40
decreased by-4.76%
Maintainers
0
Weekly downloads
 
Created
Source

Slack CLI Hooks

codecov

The @slack/cli-hooks package contains scripts that implement the contract between the Slack CLI and Bolt for JavaScript.

Overview

This library enables inter-process communication between the Slack CLI and applications built with Bolt for JavaScript.

When used together, the CLI delegates various tasks to the Bolt application by invoking processes ("hooks") and then making use of the responses provided by each hook's stdout.

For a complete list of available hooks, read the Supported Hooks section.

Requirements

This package supports Node v18 and higher. It's highly recommended to use the latest LTS version of Node.

An updated version of the Slack CLI is also encouraged while using this package.

Installation

Add this package as a development dependency for your project with the following command:

$ npm install --save-dev @slack/cli-hooks

Follow the installation guide to download the Slack CLI and easily run the scripts included in this package.

Usage

A Slack CLI-compatible Slack application includes a slack.json file that contains hooks specific to that project. Each hook is associated with commands that are available in the Slack CLI. By default, get-hooks retrieves all of the supported hooks and their corresponding scripts as defined in this package.

The CLI will try to use the version of the @slack/cli-hooks specified in your application's package.json. The hooks in this package are automatically added to the ./node_modules/.bin directory of your application when this package is installed.

Supported Hooks

The hooks that are currently supported for use within the Slack CLI include check-update, doctor, get-hooks, get-manifest, and start:

Hook NameCLI CommandFileDescription
check-updateslack updatecheck-update.jsChecks the project's Slack dependencies to determine whether or not any packages need to be updated.
doctorslack doctordoctor.jsReturns runtime versions and other system dependencies required by the application.
get-hooksAllget-hooks.jsFetches the list of available hooks for the CLI from this repository.
get-manifestslack manifestget-manifest.jsConverts a manifest.json file into a valid manifest JSON payload.
startslack runstart.jsWhile developing locally, the CLI manages a socket connection with Slack's backend and utilizes this hook for events received via this connection.

Overriding Hooks

To customize the behavior of a hook, add the hook to your application's slack.json file and provide a corresponding script to be executed.

When commands are run, the Slack CLI will look to the project's hook definitions and use those instead of what's defined in this library, if provided. Only supported hooks will be recognized and executed by the Slack CLI.

Below is an example slack.json file that overrides the default start hook:

{
  "hooks": {
    "get-hooks": "NODE_NO_WARNINGS=1 npx -q --no-install -p @slack/cli-hooks slack-cli-get-hooks",
    "start": "npm run dev"
  }
}

Troubleshooting

Sometimes the hook scripts are installed globally and might not be automatically updated. To determine the source of these scripts, check the node_modules/.bin directory of your project then run the following command:

$ which npx slack-cli-get-hooks # macOS / Linux
C:\> where.exe npx slack-cli-get-hooks # Windows

These hooks can be safely removed and reinstalled at your application directory to ensure you're using the correct version for your project.

Getting help

If you get stuck, we're here to help. The following are the best ways to get assistance working through your issue:

  • Issue Tracker for questions, feature requests, bug reports and general discussion related to these packages. Try searching before you create a new issue.
  • Email us: developers@slack.com
  • Community Slack: a Slack community for developers building all kinds of Slack apps. You can find the maintainers and users of these packages in #lang-javascript.

Keywords

FAQs

Package last updated on 22 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc