Skip to main content

The Slack CLI contract implementation for Bolt Python

Project description

Python Slack Hooks

Pypi - Badge PyPI - Version Codecov
Python Versions

This library defines the contract between the Slack CLI and Bolt for Python.

Overview

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

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

The latest minor version of Bolt v1 is recommended.

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 library.

The CLI will always use the version of the python-slack-hooks that is specified in the project's requirements.txt.

Supported Hooks

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

Hook Name CLI Command File Description
check-update slack update check_update.py Checks the project's Slack dependencies to determine whether or not any libraries need to be updated.
doctor slack doctor doctor.py Returns runtime versions and other system dependencies required by the application.
get-hooks All get_hooks.py Fetches the list of available hooks for the CLI from this repository.
get-manifest slack manifest get_manifest.py Converts a manifest.json file into a valid manifest JSON payload.
start slack run start.py While 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.

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

{
  "hooks": {
    "get-hooks": "python3 -m slack_cli_hooks.hooks.get_hooks",
    "start": "python3 app.py"
  }
}

Contributing

Contributions are always welcome! Please review the contributing guidelines for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slack_cli_hooks-0.3.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slack_cli_hooks-0.3.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file slack_cli_hooks-0.3.0.tar.gz.

File metadata

  • Download URL: slack_cli_hooks-0.3.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for slack_cli_hooks-0.3.0.tar.gz
Algorithm Hash digest
SHA256 88e1e78528d94d686bdb46a6242d023975479472b97625aa73c1c953775d5663
MD5 fa4842c95c2d161f3baab01dc82636b2
BLAKE2b-256 4a02abc3639125c62f756e852bb0d72aebc778b1d798b4561cfea44bf6062b7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for slack_cli_hooks-0.3.0.tar.gz:

Publisher: pypi-release.yml on slackapi/python-slack-hooks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file slack_cli_hooks-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for slack_cli_hooks-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3639d4f5b56f822da7fb93660996849df5d2b8544cca968a46ee012b89c94fd1
MD5 f4e081f1ea2748af310e8d00f58446e0
BLAKE2b-256 0f45e183cc4e65ae3e092b89134f4016fa83982318a8ea1a3bb6c5769adf4033

See more details on using hashes here.

Provenance

The following attestation bundles were made for slack_cli_hooks-0.3.0-py3-none-any.whl:

Publisher: pypi-release.yml on slackapi/python-slack-hooks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page