Skip to content

Commit 938696c

Browse files
docs: update quickstart, installation, guides, and hook reference files (#504)
* woo * go * go
1 parent eecf995 commit 938696c

8 files changed

Lines changed: 36 additions & 122 deletions

docs/_sidebar.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@
1414
"tools/slack-cli/guides/installing-the-slack-cli-for-mac-and-linux",
1515
"tools/slack-cli/guides/installing-the-slack-cli-for-windows",
1616
"tools/slack-cli/guides/authorizing-the-slack-cli",
17-
"tools/slack-cli/guides/using-slack-cli-with-bolt-frameworks",
1817
"tools/slack-cli/guides/using-slack-cli-on-an-enterprise-grid-organization",
1918
"tools/slack-cli/guides/running-slack-cli-commands",
2019
"tools/slack-cli/guides/developing-locally",
2120
"tools/slack-cli/guides/using-environment-variables-with-the-slack-cli",
22-
"tools/slack-cli/guides/troubleshooting-slack-cli-errors",
2321
"tools/slack-cli/guides/setting-up-ci-cd-with-the-slack-cli",
2422
"tools/slack-cli/guides/deploying-with-the-slack-cli-and-github-actions",
2523
"tools/slack-cli/guides/removing-an-app",
@@ -54,7 +52,7 @@
5452
},
5553
{
5654
"type": "doc",
57-
"id": "tools/slack-cli/reference/hooks/index",
55+
"id": "tools/slack-cli/reference/hooks",
5856
"label": "Hooks"
5957
}
6058
]

docs/guides/authorizing-the-slack-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Authorization Level: Workspace
5555
5656
You should see an entry for the workspace you just authorized. If you don't, get a new authorization ticket with `slack login` to try again.
5757

58-
You're now ready to begin building [Bolt](/tools/slack-cli/guides/using-slack-cli-with-bolt-frameworks) and [Deno Slack SDK](/tools/deno-slack-sdk/guides/getting-started) apps!
58+
You're now ready to begin developing [Bolt](/quickstart) and [Deno Slack SDK](/tools/deno-slack-sdk/guides/getting-started) apps!
5959
6060
### Version update notifications {#version-updates}
6161

docs/guides/installing-the-slack-cli-for-windows.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,23 @@ slug: /tools/slack-cli/guides/installing-the-slack-cli-for-windows
77

88
The Slack CLI is a useful tool for building Slack apps. This is your one-stop shop for installing this tool.
99

10-
:::warning[PowerShell is required for installing the Slack CLI on Windows machines; an alternative shell will not work.]
10+
<details>
11+
<summary>Prerequisite: installing PowerShell </summary>
12+
13+
PowerShell is required for installing the Slack CLI on Windows machines; an alternative shell will not work.
14+
15+
Run the following command to install PowerShell 7 on your machine:
16+
17+
```pwsh
18+
iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI"
19+
```
20+
21+
The following articles may also be helpful should you run into any issues:
22+
23+
- [Installing PowerShell on Windows](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4)
24+
- [How to install and update PowerShell 6](https://www.thomasmaurer.ch/2019/03/how-to-install-and-update-powershell-6/)
1125

12-
:::
26+
</details>
1327

1428
<Tabs groupId="installation">
1529
<TabItem value="Automated" label="Automated Installation">
@@ -109,16 +123,3 @@ Using slack v4.0.1
109123

110124
</TabItem>
111125
</Tabs>
112-
113-
## Installing PowerShell {#powershell}
114-
115-
Run the following command to install PowerShell 7 on your machine:
116-
117-
```pwsh
118-
iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI"
119-
```
120-
121-
The following articles may also be helpful should you run into any issues:
122-
123-
- [Installing PowerShell on Windows](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4)
124-
- [How to install and update PowerShell 6](https://www.thomasmaurer.ch/2019/03/how-to-install-and-update-powershell-6/)

docs/guides/removing-an-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ All good things must come to an end. You can `uninstall` your app if you need to
1111

1212
## Uninstall an app from your team {#uninstall-app}
1313

14-
Removing an app from a workspace doesn't have to be a permanent decision. Sometimes uninstalling the app to remove it's active presence in channels is sufficient! This option has the added benefit of reinstallation at a later time without recreating the entire app.
14+
Removing an app from a workspace doesn't have to be a permanent decision. Sometimes uninstalling the app to remove its active presence in channels is sufficient! This option has the added benefit of reinstallation at a later time without recreating the entire app.
1515

1616
To uninstall an app using the CLI, use the [`uninstall`](/tools/slack-cli/reference/commands/slack_app_uninstall/) command. Then, choose the workspace you want to remove the app from:
1717

docs/guides/troubleshooting-slack-cli-errors.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

docs/guides/using-slack-cli-with-bolt-frameworks.md

Lines changed: 0 additions & 57 deletions
This file was deleted.

docs/index.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# Slack CLI
22

3-
The Slack command-line interface (CLI) allows you to create and manage Slack apps from the command line. Use it in combination with the Deno Slack SDK, or the Bolt frameworks for JavaScript and Python.
3+
The Slack command-line interface (CLI) allows you to create and manage Slack apps from the command line. Use it in combination with the Bolt frameworks for JavaScript and Python, or the Deno Slack SDK.
44

5-
Follow the installation guide for either [MacOS / Linux](/tools/slack-cli/guides/installing-the-slack-cli-for-mac-and-linux) or [Windows](/tools/slack-cli/guides/installing-the-slack-cli-for-windows) to get set up. Then, follow the the [Authorization guide](/tools/slack-cli/guides/authorizing-the-slack-cli) to connect your workspace.
5+
:::tip[Follow our [quickstart guide](/quickstart) to get set up with the Slack CLI and have a working app using the Bolt frameworks!]
6+
:::
7+
8+
For more detailed instructions, follow the installation guide for either [MacOS / Linux](/tools/slack-cli/guides/installing-the-slack-cli-for-mac-and-linux) or [Windows](/tools/slack-cli/guides/installing-the-slack-cli-for-windows). Then, follow the the [Authorization guide](/tools/slack-cli/guides/authorizing-the-slack-cli) to connect your workspace.
69

710
## Getting help
811

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,24 @@
22

33
Communication between the CLI and the application SDK is managed by a project-level configuration file called `hooks.json`. This file is included in our app templates and defines script _hooks_.
44

5-
Hooks are small scripts that are _executed_ by the CLI and _implemented_ by the SDK. These commands perform actions on the project.
6-
7-
The `hooks.json` file allows the CLI and SDK a standard way to communicate while remaining decoupled and abstracted. This interface is a key design of the Slack CLI: many application and project level tasks are delegated from the CLI to the SDK. This delegation, decoupling and abstraction allows for language-agnostic SDK implementations.
8-
9-
## Core concepts {#core-concepts}
10-
11-
### Hooks: How the CLI and the SDK communicate {#communication}
12-
13-
Hooks are scripts that execute when a specific event happens or a Slack CLI command is invoked.
5+
Hooks are small scripts that are _executed_ by the CLI and _implemented_ by the SDK when a specific event happens or a Slack CLI command is invoked. These scripts perform actions on the project.
146

157
A hook script may be triggered when:
8+
- generating the app manifest.
9+
- bundling function code before deployment to Slack infrastructure.
10+
- handling an application event during local development runs.
11+
12+
## Hooks: How the CLI and the SDK communicate {#communication}
1613

17-
- generating the app manifest
18-
- bundling function code before deployment to Slack infrastructure
19-
- handling an application event during local development runs
14+
The `hooks.json` file allows the CLI and SDK a standard way to communicate while remaining decoupled and abstracted. This interface is a key design of the Slack CLI: many application and project level tasks are delegated from the CLI to the SDK. This delegation, decoupling and abstraction allows for language-agnostic SDK implementations.
2015

2116
When an event occurs, the CLI will execute a hook script by spawning a separate process, possibly passing a JSON object through `STDIN` and/or other parameters via command line flags to the hook script process, and waiting for a JSON response via the spawned process’ `STDOUT`. This system is heavily inspired by git hooks.
2217

2318
Since communication over hooks involves inter-process communication (one process running the CLI communicating with another process managed by the SDK ie. the hook), the exit code of the hook process signals success or failure to the CLI process. The CLI will assume an exit code of 0 from a hook process signals success, while any other exit code signals failure.
2419

2520
Some hooks may return data as part of their functionality. The CLI will use the `STDOUT` and `STDERR` of the hook process to transmit its response. For details on how a hook process can shape its response, and delineate diagnostic data from response data, see the section on [protocol negotiation](#protocol).
2621

27-
### Discover hook scripts and default configuration with `get-hooks` {#discover}
22+
## Discovering hook scripts and default configuration with `get-hooks` {#discover}
2823

2924
In order for the CLI to reliably discover the hooks for the [Deno SDK](https://github.com/slackapi/deno-slack-sdk), [Bolt Frameworks](https://docs.slack.dev/tools/), and future community-driven SDKs, the CLI employs a service-discovery-like approach to querying the SDK for what functionality it supports.
3025

@@ -34,7 +29,7 @@ App developers do not need to edit or change their `hooks.json` file when upgrad
3429

3530
Refer to the [CLI-SDK JSON interface](#interface-format) section for other examples.
3631

37-
### CLI-SDK protocol negotiation {#protocol}
32+
## CLI-SDK protocol negotiation {#protocol}
3833

3934
As the needs of app developers evolve, so will the interface and the rules of communication between the CLI and the SDK. These rules are negotiated via the initial `get-hooks` handshake and are specified via the `protocol-version` field returned by the SDK.
4035

@@ -45,7 +40,7 @@ At the time of writing, only two protocol versions are supported:
4540

4641
If at any point protocol negotiation fails or does not adhere to the rules of communication, the CLI will fall back to using the default protocol.
4742

48-
#### Working implementations of protocol negotiation
43+
### Working implementations of protocol negotiation
4944

5045
- In the CLI:
5146
- [List of protocols supported by the CLI](https://github.com/slackapi/slack-cli/blob/d2349b6328820d2dcb01312abd4d8b3694f5137e/internal/hooks/protocol.go#L21-L22)
@@ -57,13 +52,13 @@ If at any point protocol negotiation fails or does not adhere to the rules of co
5752
- [node-slack-sdk’s implementation](https://github.com/slackapi/node-slack-sdk/blob/main/packages/cli-hooks/src/protocols.js)
5853
- [python-slack-sdk’s implementation](https://github.com/slackapi/python-slack-hooks/blob/main/slack_cli_hooks/protocol/__init__.py)
5954

60-
### Ensuring backwards compatibility {#compatibility}
55+
## Ensuring backwards compatibility {#compatibility}
6156

6257
A hook’s name space (CLI) and its associated script implementation (SDK) will change over time. This can break backwards compatibility and require App Developers to juggle different CLI versions and SDK versions in order to maintain compatibility. It’s a frustrating situation that can ruin the developer experience.
6358

6459
An additive approach to hook names or configuration settings allows us to keep hooks backwards-compatible for as long as possible and allows for a smoother upgrade experience. This approach also allows for tools to provide generous timeframes for supporting old hooks vs. new ones, allowing for deprecation windows and gradual rollouts. For configuration settings, an additive approach is accomplished by adding new configuration values that are not Golang defaults (e.g. bool defaults to false).
6560

66-
For example, the hook name `run-v2` may be the successor to the hook named `run`. The SDK can implement either hook and the CLI will trigger the latest version, possibly falling back to earlier versions of the hook where applicable. The CLI can also warn of impending removal of older hooks, providing hints to the developer when tooling behaviour changes.
61+
For example, the hook name `run-v2` may be the successor to the hook named `run`. The SDK can implement either hook and the CLI will trigger the latest version, possibly falling back to earlier versions of the hook where applicable. The CLI can also warn of impending removal of older hooks, providing hints to the developer when tooling behavior changes.
6762

6863
## Hook specification {#specification}
6964

0 commit comments

Comments
 (0)