Skip to content

Commit 9e6bc44

Browse files
mwbrookszimeg
andauthored
docs: update Slack CLI and Install Scripts to use the new https://slack.dev docs (#34)
* docs: update all references to https://slack.dev when possible * docs: include reference to pages of docs with changed paths * Update .github/cli-sdk-specification.md Co-authored-by: Eden Zimbelman <[email protected]> * Update .github/cli-sdk-specification.md Co-authored-by: Eden Zimbelman <[email protected]> * Update .github/cli-sdk-specification.md Co-authored-by: Eden Zimbelman <[email protected]> * Update .github/cli-sdk-specification.md Co-authored-by: Eden Zimbelman <[email protected]> * Update .github/cli-sdk-specification.md Co-authored-by: Eden Zimbelman <[email protected]> * docs: use docs.slack.dev app manifest reference page --------- Co-authored-by: @zimeg <[email protected]> Co-authored-by: Eden Zimbelman <[email protected]>
1 parent 85749e2 commit 9e6bc44

File tree

23 files changed

+50
-48
lines changed

23 files changed

+50
-48
lines changed

.github/MAINTAINERS_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ Steps to merge a pull request:
766766
When in doubt, find the other maintainers and ask.
767767

768768
[circleci]: ../.circleci/config.yml
769-
[commands]: https://api.slack.com/automation/cli/commands
769+
[commands]: https://tools.slack.dev/slack-cli/reference/commands/slack
770770
[commit]: https://www.conventionalcommits.org/en/v1.0.0/
771771
[contributing]: ./CONTRIBUTING.md
772772
[dev-release]: https://github.com/slackapi/slack-cli/releases/tag/dev-build

.github/cli-sdk-specification.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Some hooks may return data as part of their functionality. The CLI will use the
5050

5151
### ↪️ Discover hook scripts and default configuration with `get-hooks`
5252

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

5555
A project includes a `hooks.json` file in its `.slack` directory which by default contains a single hook (`get-hooks`). The SDK is responsible for implementing this hook and returning to the CLI a JSON object with all hook definitions and their relevant default configuration (one hook to rule them all 💍).
5656

@@ -95,7 +95,7 @@ For example, the hook name `run-v2` may be the successor to the hook named `run`
9595

9696
## 📄 Hook Specification
9797

98-
Hooks are entry points for the CLI to initiate inter-process communication with the SDK. SDKs should implement one hook: `get-hooks`. It is the recommended approach for SDKs to enable communication with the CLI (for more details, see the [Hook Resolution](#hook-resolution) section).
98+
Hooks are entry points for the CLI to initiate inter-process communication with the SDK. SDKs should implement one hook: `get-hooks`. It is the recommended approach for SDKs to enable communication with the CLI (for more details, see the [Hook Resolution](#hook-resolution) section).
9999

100100
A hook encapsulates an isolated piece of functionality that the SDK provides to app developers; the CLI delegates execution of the functionality to the SDK via hook invocation in a separate process. SDKs are responsible for ensuring that hook processes exit with a status code of 0; otherwise the CLI will surface the `sdk_hook_invocation_failed` error to the end-user and report the hook process’ `STDOUT` and `STDERR` to the CLI process’ `STDOUT`.
101101

@@ -137,11 +137,11 @@ This hook should return the CLI-SDK interface in [JSON](#interface-format) forma
137137

138138
This hook allows for the application under development to be created on `api.slack.com/apps` as well as installed to workspaces that the CLI has been authorized to.
139139

140-
Implementing this hook signals to the CLI that the SDK manages the [application manifest](https://api.slack.com/concepts/manifests#fields). Even if this hook is not present, the CLI should fall back to checking if a `manifest.json` or `manifest.yaml` exists in the project directory and read that file directly.
140+
Implementing this hook signals to the CLI that the SDK manages the [application manifest](https://docs.slack.dev/app-manifests/). Even if this hook is not present, the CLI should fall back to checking if a `manifest.json` or `manifest.yaml` exists in the project directory and read that file directly.
141141

142142
#### Output
143143

144-
The [application manifest](https://api.slack.com/concepts/manifests#fields) in JSON format to `STDOUT`.
144+
The [app manifest](https://docs.slack.dev/reference/app-manifest) in JSON format to `STDOUT`.
145145

146146
#### Support
147147
| Deno | Bolt JS | Bolt Python | Bolt Java |
@@ -150,7 +150,7 @@ The [application manifest](https://api.slack.com/concepts/manifests#fields) in J
150150

151151
### 🪝 `build` (optional)
152152

153-
Implementing this hook allows for the CLI to [deploy function code to Slack's managed infrastructure](https://api.slack.com/automation/deploy). The work of assembling the application bundle according to Slack's application bundle format is delegated to the SDK via this hook.
153+
Implementing this hook allows for the CLI to [deploy function code to Slack's managed infrastructure](https://tools.slack.dev/deno-slack-sdk/guides/deploying-to-slack). The work of assembling the application bundle according to Slack's application bundle format is delegated to the SDK via this hook.
154154

155155
The application bundle format has few restrictions, but the critical ones are:
156156
- It must have a `manifest.json` at the root of the package
@@ -159,9 +159,9 @@ The application bundle format has few restrictions, but the critical ones are:
159159

160160
The above requirements come from the [deno-slack-runtime](https://github.com/slackapi/deno-slack-runtime) project, which implements the expected Slack deployment bundle format. It contains a hard-coded [reference](https://github.com/slackapi/deno-slack-runtime/blob/main/src/mod.ts#L73) to the above-mentioned `functions/` sub-directory, and combines it with the [specific custom function `callback_id`](https://github.com/slackapi/deno-slack-runtime/blob/main/src/mod.ts#L17-L19) to resolve an import path for userland function source code.
161161

162-
*Note: This hook should only be implemented by official Slack SDKs and is only relevant to apps [deployed to Slack's managed infrastructure](https://api.slack.com/automation/deploy).*
162+
*Note: This hook should only be implemented by official Slack SDKs and is only relevant to apps [deployed to Slack's managed infrastructure](https://tools.slack.dev/deno-slack-sdk/guides/deploying-to-slack).*
163163

164-
#### Input
164+
#### Input
165165

166166
Two command-line flags are provided as part of the hook invocation:
167167
- `--source`: the path to the root of the application project directory
@@ -178,13 +178,13 @@ No further output over STDOUT required from the SDK other than writing the appli
178178

179179
### 🪝 `start` (optional)
180180

181-
The `slack run` CLI command will invoke the `start` hook to initiate a local-run development mode allowing for quick iteration during app development. This hook is responsible for actually running the app, but has two operating modes: one where the hook manages the connection to Slack via [Socket Mode](https://api.slack.com/apis/connections/socket), and one where it does not. Which mode should be employed by the CLI when invoking this hook is dictated by the `config.sdk-managed-connection-enabled` property in the response from [`get-hooks`](#get-hooks).
181+
The `slack run` CLI command will invoke the `start` hook to initiate a local-run development mode allowing for quick iteration during app development. This hook is responsible for actually running the app, but has two operating modes: one where the hook manages the connection to Slack via [Socket Mode](https://docs.slack.dev/apis/events-api/using-socket-mode/), and one where it does not. Which mode should be employed by the CLI when invoking this hook is dictated by the `config.sdk-managed-connection-enabled` property in the response from [`get-hooks`](#get-hooks).
182182

183183
#### Non-SDK-managed connection
184184

185185
This section applies when `config.sdk-managed-connection-enabled` is undefined or set to `false` in `hooks.json` or in the [`get-hooks`](#get-hooks) hook response.
186186

187-
When the app developer wants to initiate a development-mode local run of their application via the `slack run` CLI command, by default the CLI will create a [Socket Mode](https://api.slack.com/apis/connections/socket) connection to the Slack backend and start listening for events on behalf of the app.
187+
When the app developer wants to initiate a development-mode local run of their application via the `slack run` CLI command, by default the CLI will create a [Socket Mode](https://docs.slack.dev/apis/events-api/using-socket-mode/) connection to the Slack backend and start listening for events on behalf of the app.
188188

189189
Any events coming down the wire from Slack will be fed over `STDIN` to this hook for the SDK to process. *Each event incoming from Slack will invoke this hook independently*, meaning one `start` hook process will be spawned per incoming event. The SDK should process each incoming event and output a JSON object to `STDOUT` representing the response to send back to Slack over the socket connection managed by the CLI.
190190

@@ -207,7 +207,7 @@ Several parameters are passed to the SDK over `STDIN` as JSON. The format of thi
207207

208208
| Field | Description | Required |
209209
| ------- | ----------- | -------- |
210-
| body | Object whose keys represent the incoming Slack event payload as described in [Events API Event Types](https://api.slack.com/events?filter=Events). The particular content of this key is dependent on the incoming event type. | Yes |
210+
| body | Object whose keys represent the incoming Slack event payload as described in [Events API Event Types](https://docs.slack.dev/reference/events?APIs=Events). The particular content of this key is dependent on the incoming event type. | Yes |
211211
| context | Object representing variables relevant for the locally-running application. | Yes |
212212
| context.bot_access_token | String; a bot access token that the SDK can provide to developer functions for issuing calls to the Slack API. | Yes |
213213
| context.app_id | String; the current application ID. | Yes |
@@ -218,7 +218,7 @@ Note: The CLI always provides the `SLACK_APP_TOKEN` and `SLACK_BOT_TOKEN` enviro
218218

219219
##### Output
220220

221-
Each incoming event from the socket connection will invoke this hook separately. As such, this hook's response to `STDOUT` should be the JSON response to the Slack event sent to the app. The CLI will handle [acknowledging events](https://api.slack.com/apis/connections/socket#acknowledge) by sending back the proper `envelope_id` attribute to the Slack backend. Therefore, the SDK’s `start` hook response `STDOUT` should be the `payload` of the response and nothing else. It is recommended to use the `v2` (`message-boundaries`) [protocol](#protocol) to more easily delineate logging/diagnostics from event responses to be sent to Slack.
221+
Each incoming event from the socket connection will invoke this hook separately. As such, this hook's response to `STDOUT` should be the JSON response to the Slack event sent to the app. The CLI will handle [acknowledging events](https://docs.slack.dev/apis/events-api/using-socket-mode/#acknowledge) by sending back the proper `envelope_id` attribute to the Slack backend. Therefore, the SDK’s `start` hook response `STDOUT` should be the `payload` of the response and nothing else. It is recommended to use the `v2` (`message-boundaries`) [protocol](#protocol) to more easily delineate logging/diagnostics from event responses to be sent to Slack.
222222

223223
##### Support
224224
| Deno | Bolt JS | Bolt Python | Bolt Java |
@@ -229,11 +229,11 @@ Each incoming event from the socket connection will invoke this hook separately.
229229

230230
This section applies when `config.sdk-managed-connection-enabled` is set to `true` in `hooks.json` or in the [`get-hooks`](#get-hooks) hook response.
231231

232-
Implementing the `start` hook with `config.sdk-managed-connection-enabled` set to `true` will instruct the CLI to delegate connection management to the hook implementation as defined in our [Implementing Socket Mode documentation](https://api.slack.com/apis/connections/socket#implementing). Because establishing a network connection and handling incoming events is assumed to be a long-running process, invoking this hook will block the CLI process.
232+
Implementing the `start` hook with `config.sdk-managed-connection-enabled` set to `true` will instruct the CLI to delegate connection management to the hook implementation as defined in our [Implementing Socket Mode documentation](https://docs.slack.dev/apis/events-api/using-socket-mode/#implementing). Because establishing a network connection and handling incoming events is assumed to be a long-running process, invoking this hook will block the CLI process.
233233

234234
##### Input
235235

236-
The application's app-level token and bot access token will be provided as environment variables to the hook process (`SLACK_CLI_XAPP` and `SLACK_CLI_XOXB` respectively, as well as `SLACK_APP_TOKEN` and `SLACK_BOT_TOKEN`). The SDK should use the app token to [create a socket connection](https://api.slack.com/apis/connections/socket#call) with the Slack backend on behalf of the app. Additionally, the SDK may use the provided bot token to facilitate API calls to the Slack API.
236+
The application's app-level token and bot access token will be provided as environment variables to the hook process (`SLACK_CLI_XAPP` and `SLACK_CLI_XOXB` respectively, as well as `SLACK_APP_TOKEN` and `SLACK_BOT_TOKEN`). The SDK should use the app token to [create a socket connection](https://docs.slack.dev/apis/events-api/using-socket-mode/#call) with the Slack backend on behalf of the app. Additionally, the SDK may use the provided bot token to facilitate API calls to the Slack API.
237237

238238
All Bolt SDKs leverage this `start` hook operating mode.
239239

@@ -428,7 +428,7 @@ This script is provided by the developer and is meant to simplify app management
428428

429429
If this script isn't provided, an attempt is made to deploy the app to Slack's managed infrastructure. This is expected for Deno apps but will fail for Bolt apps.
430430

431-
#### Input
431+
#### Input
432432

433433
Access to `STDIN` is necessary for certain scripts.
434434

@@ -538,7 +538,7 @@ The CLI will employ the following algorithm in order to resolve the command to b
538538
}
539539
}
540540
```
541-
#### Complete example returned by SDK from the get-hooks script implemented by Deno SDK (this is in-memory)
541+
#### Complete example returned by SDK from the get-hooks script implemented by Deno SDK (this is in-memory)
542542
```
543543
{
544544
"runtime": "deno",
@@ -565,17 +565,17 @@ The CLI will employ the following algorithm in order to resolve the command to b
565565
### Types of developers
566566

567567
1. App Developers are using the CLI and SDK to create and build a project
568-
2. SDK Developers are building and maintaining the CLI and/or SDKs (controlled by Slack or community-driven)
568+
2. SDK Developers are building and maintaining the CLI and/or SDKs (controlled by Slack or community-driven)
569569

570570
### Types of SDKs
571571

572-
1. Slack Deno SDK - Run on Slack
572+
1. Slack Deno SDK - Run on Slack
573573
2. Bolt Frameworks (JavaScript, Python, and Java) - Remote using Slack's Bolt Framework
574574
3. No SDK at all - Run on Slack, Remote Self-Hosted
575575
4. Community SDKs, frameworks, and custom apps (e.g. Ruby, Golang, etc), if they exist
576576

577577
### Other definitions
578578

579-
* hooks.json - The CLI-SDK Interface implemented as a JSON object ({...}) or JSON file (hooks.json).
579+
* hooks.json - The CLI-SDK Interface implemented as a JSON object ({...}) or JSON file (hooks.json).
580580
* command - This refers to a CLI command, eg. `slack doctor`
581-
* hook - This refers to some CLI functionality delegated to the SDK and is defined at the level of the hooks.json file
581+
* hook - This refers to some CLI functionality delegated to the SDK and is defined at the level of the hooks.json file

cmd/datastore/datastore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func NewCommand(clients *shared.ClientFactory) *cobra.Command {
5353
"This command is supported for apps deployed to Slack managed infrastructure but",
5454
"other apps can attempt to run the command with the --force flag.",
5555
"",
56-
`Discover the datastores: {{LinkText "https://api.slack.com/automation/datastores"}}`,
56+
`Discover the datastores: {{LinkText "https://tools.slack.dev/deno-slack-sdk/guides/using-datastores"}}`,
5757
}, "\n"),
5858
Example: style.ExampleCommandsf([]style.ExampleCommand{
5959
{

cmd/env/env.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func NewCommand(clients *shared.ClientFactory) *cobra.Command {
4242
"This command is supported for apps deployed to Slack managed infrastructure but",
4343
"other apps can attempt to run the command with the --force flag.",
4444
"",
45-
`Explore more: {{LinkText "https://api.slack.com/automation/environment-variables"}}`,
45+
`Explore more: {{LinkText "https://tools.slack.dev/slack-cli/guides/using-environment-variables-with-the-slack-cli"}}`,
4646
}, "\n"),
4747
Example: style.ExampleCommandsf([]style.ExampleCommand{
4848
{

cmd/externalauth/externalauth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func NewCommand(clients *shared.ClientFactory) *cobra.Command {
3939
"This command is supported for apps deployed to Slack managed infrastructure but",
4040
"other apps can attempt to run the command with the --force flag.",
4141
"",
42-
`Explore providers: {{LinkText "https://api.slack.com/automation/external-auth"}}`,
42+
`Explore providers: {{LinkText "https://tools.slack.dev/deno-slack-sdk/guides/integrating-with-services-requiring-external-authentication"}}`,
4343
}, "\n"),
4444
Example: style.ExampleCommandsf([]style.ExampleCommand{
4545
{

cmd/function/function.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func NewCommand(clients *shared.ClientFactory) *cobra.Command {
4040
"Inspect and configure the custom functions included in an app with this command.",
4141
"Functions can be added as a step in Workflow Builder and shared among teammates.",
4242
"",
43-
`Learn more about functions: {{LinkText "https://api.slack.com/automation/functions/overview"}}`,
43+
`Learn more about functions: {{LinkText "https://tools.slack.dev/deno-slack-sdk/guides/creating-functions"}}`,
4444
}, "\n"),
4545
Example: style.ExampleCommandsf([]style.ExampleCommand{
4646
{Command: "function distribute", Meaning: "Select a function and choose distribution options"},

cmd/help/help.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,6 @@ const helpTemplate string = `{{.Long}}
107107
For more information about a specific command, run:
108108
$ {{.CommandPath}}{{if eq .Name (GetProcessName)}} <command>{{end}} <subcommand> --help
109109
110-
For guides and documentation, head over to {{LinkText "https://api.slack.com/automation"}}{{end}}
110+
For guides and documentation, head over to {{LinkText "https://tools.slack.dev/slack-cli"}}{{end}}
111111
112112
`

cmd/project/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func printCreateSuccess(ctx context.Context, clients *shared.ClientFactory, appP
200200
Emoji: "compass",
201201
Text: "Explore the documentation to learn more",
202202
Secondary: []string{
203-
"Read the README.md or peruse the docs over at " + style.Highlight("api.slack.com/automation"),
203+
"Read the README.md or peruse the docs over at " + style.Highlight("https://tools.slack.dev/deno-slack-sdk"),
204204
"Find available commands and usage info with " + style.Commandf("help", false),
205205
},
206206
}))

cmd/project/create_template.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ func confirmExternalTemplateSelection(cmd *cobra.Command, clients *shared.Client
276276
// getSelectionTemplate returns a custom formatted template used for selecting a
277277
// project template during creation
278278
func getSelectionTemplate(clients *shared.ClientFactory) string {
279-
samplesURL := style.LinkText("api.slack.com/automation/samples")
279+
samplesURL := style.LinkText("https://docs.slack.dev/samples")
280280
switch clients.Config.WithExperimentOn(experiment.BoltFrameworks) {
281281
case true:
282282
return fmt.Sprintf(`

cmd/project/samples.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
{{- range $ix, $option := .PageEntries}}
1313
{{- template "option" $.IterateOption $ix $option}}
1414
{{- end}}
15-
{{- " Guided tutorials can be found at "}}{{color "32+u"}}{{"api.slack.com/automation/samples"}}{{color "reset"}}
15+
{{- " Guided tutorials can be found at "}}{{color "32+u"}}{{"https://docs.slack.dev/samples"}}{{color "reset"}}
1616
{{end}}

0 commit comments

Comments
 (0)