### Slack App Management Examples Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_app Common examples for managing Slack apps using the CLI. These demonstrate installing, linking, listing, accessing settings, and uninstalling apps. ```bash $ slack app install # Install a production app to a team ``` ```bash $ slack app link # Link an existing app to the project ``` ```bash $ slack app list # List all teams with the app installed ``` ```bash $ slack app settings # Open app settings in a web browser ``` ```bash $ slack app uninstall # Uninstall an app from a team ``` ```bash $ slack app unlink # Remove a linked app from the project ``` ```bash $ slack app delete # Delete an app and app info from a team ``` -------------------------------- ### Slack CLI Run Command - Basic Usage Example Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_run Demonstrates the simplest way to start a local development server for your Slack app. ```bash $ slack platform run ``` -------------------------------- ### Complete SDK Hook and Config Example Source: https://docs.slack.dev/tools/slack-cli/reference/hooks This example shows a comprehensive configuration returned by the SDK's `get-hooks` script, including definitions for `get-manifest`, `build`, `start` hooks, and detailed `config.watch` settings. ```json { "hooks": { "get-manifest": "deno run -q --unstable --config=deno.jsonc --allow-read --allow-net https://deno.land/x/deno_slack_builder@0.0.8/mod.ts --manifest", "build": "deno run -q --unstable --config=deno.jsonc --allow-read --allow-write --allow-net https://deno.land/x/deno_slack_builder@0.0.8/mod.ts", "start": "deno run -q --unstable --config=deno.jsonc --allow-read --allow-net https://deno.land/x/deno_slack_runtime@0.0.5/local-run.ts" }, "config": { "watch": { "manifest": { "paths": ["manifest.json"] }, "app": { "paths": ["app.js", "listeners/"], "filter-regex": "\\.(ts|js)$" } }, "sdk-managed-connection-enabled": "true" } } ``` -------------------------------- ### Install Slack CLI with Custom Flags Source: https://docs.slack.dev/tools/slack-cli/guides/installing-the-slack-cli-for-windows Example of invoking the Slack CLI installer script with custom flags for version, alias, and skipping Git installation. ```powershell .\install-windows.ps1 -Version 2.1.0 -Alias slackcli -SkipGit $true ``` -------------------------------- ### Slack External Auth Examples Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_external-auth Examples demonstrating how to use subcommands for managing external authentication providers. ```bash # Initiate OAuth2 flow for a selected provider$ slack external-auth add ``` ```bash # Set client secret for an app and provider$ slack external-auth add-secret ``` ```bash # Remove authorization for a specific provider$ slack external-auth remove ``` ```bash # Select authorization for a specific provider in a workflow$ slack external-auth select-auth ``` -------------------------------- ### Slack CLI Examples Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_platform Examples demonstrating how to run, deploy, and monitor apps using the Slack CLI. These showcase common use cases for different subcommands. ```bash $ slack run # Run an app locally in a workspace$ slack deploy --team T0123456 # Deploy to a specific team$ slack activity -t # Continuously poll for new activity logs ``` -------------------------------- ### Slack CLI Trigger Examples Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_trigger Examples demonstrating various uses of the 'slack trigger' command, including accessing, creating, deleting, getting info, listing, and updating triggers. ```bash # Select who can run a trigger$ slack trigger access$ slack trigger create # Create a new trigger# Delete an existing trigger$ slack trigger delete --trigger-id Ft01234ABCD# Get details for a trigger$ slack trigger info --trigger-id Ft01234ABCD# List details for all existing triggers$ slack trigger list# Update a trigger definition$ slack trigger update --trigger-id Ft01234ABCD ``` -------------------------------- ### Slack CLI Common Examples Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack These examples demonstrate common commands for interacting with the Slack CLI, such as logging in, creating apps, and deploying. ```bash $ slack login # Log in to your Slack account$ slack create # Create a new Slack app$ slack init # Initialize an existing Slack app$ slack run # Start a local development server$ slack deploy # Deploy to the Slack Platform$ slack docs # Open Slack developer docs ``` -------------------------------- ### Download Slack CLI Installer Script Source: https://docs.slack.dev/tools/slack-cli/guides/installing-the-slack-cli-for-windows Download the automated installer script to a local file. This is necessary to use custom flags during installation. ```powershell irm https://downloads.slack-edge.com/slack-cli/install-windows.ps1 -outfile 'install-windows.ps1' ``` -------------------------------- ### Slack CLI Auth Examples Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_auth Examples of common slack auth commands: listing accounts, logging in, and logging out. ```bash $ slack auth list # List all authorized accounts$ slack auth login # Log in to a Slack account$ slack auth logout # Log out of a team ``` -------------------------------- ### Verify Slack CLI Installation Source: https://docs.slack.dev/tools/slack-cli/guides/installing-the-slack-cli-for-windows After installation and adding the CLI to your path, run this command to verify that the Slack CLI is installed and accessible. ```powershell $ slack version ``` -------------------------------- ### Example: List All Collaborators Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_collaborator_list This example demonstrates how to list all collaborators associated with an app using the 'slack collaborator list' command. ```bash slack collaborator list ``` -------------------------------- ### Example: List all authorized accounts Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_list This example demonstrates how to list all authorized accounts using the slack auth list command. ```bash $ slack auth list # List all authorized accounts ``` -------------------------------- ### View Available Installation Flags Source: https://docs.slack.dev/tools/slack-cli/guides/installing-the-slack-cli-for-windows Run this command on the downloaded installer script to view all available customization flags for the Slack CLI installation. ```powershell .\install-windows.ps1 -? ``` -------------------------------- ### Slack CLI Collaborator Examples Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_collaborator Examples demonstrating how to add, list, and remove collaborators using the Slack CLI. Ensure you have the correct permissions and app context. ```bash $ slack collaborator add bots@slack.com # Add a collaborator from email$ slack collaborator list # List all of the collaborators# Remove a collaborator by user ID$ slack collaborator remove USLACKBOT ``` -------------------------------- ### Deno SDK Hooks Configuration Source: https://docs.slack.dev/tools/slack-cli/reference/hooks Example of a `hooks.json` configuration for the Deno SDK, specifying commands for `get-manifest`, `build`, and `start`. Note that the legacy format for `watch` will not trigger server reloads. ```json { "runtime": "deno", "hooks": { "get-manifest": "deno run -q --unstable --config=deno.jsonc --allow-read --allow-net https://deno.land/x/deno_slack_builder@0.0.8/mod.ts --manifest", "build": "deno run -q --unstable --config=deno.jsonc --allow-read --allow-write --allow-net https://deno.land/x/deno_slack_builder@0.0.8/mod.ts", "start": "deno run -q --unstable --config=deno.jsonc --allow-read --allow-net https://deno.land/x/deno_slack_runtime@0.0.5/local-run.ts" }, "config": { "watch": { "filter-regex": "^manifest\.(ts|js|json)$", "paths": ["."] } } } ``` -------------------------------- ### Install a production app to a team Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_app_install Use this command to install a production version of your Slack app to your current team. ```bash slack app install ``` -------------------------------- ### Automated Slack CLI Installation with Version and Alias Source: https://docs.slack.dev/tools/slack-cli/guides/installing-the-slack-cli-for-mac-and-linux Install a specific version of the Slack CLI and assign it an alias by passing both flags to the installer script. ```bash curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash -s -- -v 2.1.0 ``` -------------------------------- ### Install PowerShell 7 on Windows Source: https://docs.slack.dev/tools/slack-cli/guides/installing-the-slack-cli-for-windows Run this command in PowerShell to install PowerShell 7 on your machine. This is a prerequisite for installing the Slack CLI. ```powershell iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI" ``` -------------------------------- ### Start Hook for SDK-Managed Connection Source: https://docs.slack.dev/tools/slack-cli/reference/hooks Illustrates how the 'start' hook is used when `sdk-managed-connection-enabled` is true. The hook is responsible for establishing and managing the socket connection to the Slack backend. ```javascript // Example usage within a hook implementation (language agnostic concept) // The actual implementation details will vary based on the SDK (Bolt for JS, Python, Java) // Environment variables like SLACK_APP_TOKEN and SLACK_BOT_TOKEN are provided. // The hook uses these to create a socket connection. // Example (conceptual): // const slackApp = new App({ token: process.env.SLACK_BOT_TOKEN }); // await slackApp.socketMode.run({ appToken: process.env.SLACK_APP_TOKEN }); ``` -------------------------------- ### Slack CLI feedback command examples Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_feedback Examples of using the slack feedback command. Demonstrates giving feedback on the Slack Platform or specifically on the Slack CLI. ```bash # Choose to give feedback on part of the Slack Platform$ slack feedback$ slack feedback --name slack-cli # Give feedback on the Slack CLI ``` -------------------------------- ### Start Local Development Server Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_platform_run Use this command to start a local development server for your Slack app. The server watches for file changes and automatically reloads. ```bash slack platform run ``` -------------------------------- ### Automated Slack CLI Installation Source: https://docs.slack.dev/tools/slack-cli/guides/installing-the-slack-cli-for-mac-and-linux Run this command in your terminal to automatically download and install the Slack CLI and configure it. ```bash curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash ``` -------------------------------- ### Automated Slack CLI Installation for Specific Version Source: https://docs.slack.dev/tools/slack-cli/guides/installing-the-slack-cli-for-mac-and-linux Install a specific version of the Slack CLI by using the -v flag with the automated installer. ```bash curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash -s -- -v 2.1.0 ``` -------------------------------- ### Slack CLI: Examples of Removing Collaborators Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_collaborator_remove These examples demonstrate how to use the 'slack collaborator remove' command. The first example shows how to remove a collaborator when prompted, while the subsequent examples show removal by email address and by user ID. ```bash $ slack collaborator remove # Remove collaborator on prompt ``` ```bash $ slack collaborator remove bot@slack.com # Remove collaborator by email ``` ```bash $ slack collaborator remove USLACKBOT # Remove collaborator using ID ``` -------------------------------- ### Create a new project from a specific template Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_create Specify a template URL using the '-t' flag to start your project from a particular template. ```bash slack create my-project -t slack-samples/deno-hello-world ``` -------------------------------- ### Automated Slack CLI Installation with Alias Source: https://docs.slack.dev/tools/slack-cli/guides/installing-the-slack-cli-for-mac-and-linux Use this command to install the Slack CLI and assign it an alias, useful if another 'slack' binary is already in your PATH. ```bash curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash -s ``` -------------------------------- ### Install a production app to a specific team Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_app_install Installs a production Slack app to a specified team using its ID and environment. ```bash slack app install --team T0123456 --environment deployed ``` -------------------------------- ### Automated Slack CLI Installation Source: https://docs.slack.dev/tools/slack-cli/guides/installing-the-slack-cli-for-windows Execute this command in Windows PowerShell to automatically download and install the Slack CLI. This command also configures the CLI for use. ```powershell irm https://downloads.slack-edge.com/slack-cli/install-windows.ps1 | iex ``` -------------------------------- ### Initialize environment variables Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_env Use `slack env init` to set up environment variables from a template file. This is a good starting point for managing your project's configuration. ```bash slack env init ``` -------------------------------- ### Basic Slack CLI Run Command Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_run Starts a local development server for your Slack app. This is the most basic usage. ```bash slack run [app-file-path] [flags] ``` -------------------------------- ### Create a New Slack Project Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_project Use this command to create a new Slack project. You can optionally specify a template to start from. ```bash slack project create ``` -------------------------------- ### Install a local dev app to a specific team Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_app_install Installs a local development version of your Slack app to a specified team. ```bash slack app install --team T0123456 --environment local ``` -------------------------------- ### Slack CLI Run Command - Flags Example Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_run Shows available flags for the 'slack run' command, including activity level, cleanup, and help. ```bash --activity-level string activity level to display (default "info") --cleanup uninstall the local app after exiting -h, --help help for run --hide-triggers do not list triggers and skip trigger creation prompts --no-activity hide Slack Platform log activity --org-workspace-grant string grant access to a specific org workspace ID (or 'all' for all workspaces in the org) ``` -------------------------------- ### List all teams with the app installed Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_app_list Use this command to see all workspaces where your Slack app is currently installed. No specific flags are required for a basic listing. ```bash slack app list # List all teams with the app installed ``` -------------------------------- ### Run Local Development Server with Custom Entry Point Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_platform_run Specify a custom entry point for your Slack app when starting the local development server. This is useful for apps with non-standard file structures. ```bash slack platform run ./src/app.py ``` -------------------------------- ### Deno Import Map (import_map.json) Source: https://docs.slack.dev/tools/slack-cli/guides/setting-up-ci-cd-with-the-slack-cli Manages module versions and the standard library included in your project. This example specifies versions for `deno-slack-sdk`, `deno-slack-api`, and `mock-fetch`. ```json // import_map.json{ "imports": { "deno-slack-sdk/": "https://deno.land/x/deno_slack_sdk@2.1.5/", "deno-slack-api/": "https://deno.land/x/deno_slack_api@2.1.1/", "mock-fetch/": "https://deno.land/x/mock_fetch@0.3.0/" } } ``` -------------------------------- ### Slack CLI Run Command - Global Flags Example Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_run Lists global flags that can be used with the 'slack run' command for configuration and control. ```bash --accessible use accessible prompts for screen readers -a, --app string use a specific app ID or environment --config-dir string use a custom path for system config directory -e, --experiment strings use the experiment(s) in the command -f, --force ignore warnings and continue executing command --no-color remove styles and formatting from outputs -s, --skip-update skip checking for latest version of CLI -w, --team string select workspace or organization by team name or ID --token string set the access token associated with a team -v, --verbose print debug logging and additional info ``` -------------------------------- ### Install Slack CLI in GitHub Actions Source: https://docs.slack.dev/tools/slack-cli/guides/deploying-the-slack-cli-with-github-actions Installs the Slack CLI using a curl command and bash script. This step is conditional and runs only if the Slack CLI is not found in the cache. ```yaml name: Slack App Deployment on: push: branches: [ main ] jobs: build: runs-on: ubuntu-latest timeout-minutes: 5 steps: - uses: actions/checkout@v4 - name: Install Deno runtime uses: denoland/setup-deno@v1 with: deno-version: v1.x - name: Install Slack CLI if: steps.cache-slack.outputs.cache-hit != 'true' run: | curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash ``` -------------------------------- ### Deploy using Slack CLI with Service Token Source: https://docs.slack.dev/tools/slack-cli/guides/authorizing-the-slack-cli Example of using the `--token` global flag to pass a service token for a specific Slack CLI command like `deploy`. ```bash slack deploy --token ``` -------------------------------- ### Slack CLI Auth Help Flag Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_auth Use the help flag to get information about the auth subcommand. ```bash -h, --help help for auth ``` -------------------------------- ### Slack CLI Challenge Code Input Source: https://docs.slack.dev/tools/slack-cli/guides/authorizing-the-slack-cli This example shows the prompt for entering the challenge code received from Slack after approving permissions. Successful authentication is indicated afterward. ```bash ? Enter challenge code eXaMpLeCoDe✅ You've successfully authenticated! 🎉 Authorization data was saved to ~/.slack/credentials.json 💡 Get started by creating a new app with slack create my-app Explore the details of available commands with slack help ``` -------------------------------- ### Create Project from Sample App Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_project_samples Create a new project by selecting a sample application. Provide a project name to initiate the creation process. ```bash slack samples my-project # Select a sample app to create ``` -------------------------------- ### Add a new entry with an expression Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_datastore_put This example demonstrates adding a new entry to a datastore using a single JSON expression that includes both the datastore name and the item details. ```bash slack datastore put '{"datastore": "tasks", "item": {"id": "42", "description": "Create a PR", "status": "Done"}}' ``` -------------------------------- ### GitHub Actions Workflow for Slack Deployment Source: https://docs.slack.dev/tools/slack-cli/guides/setting-up-ci-cd-with-the-slack-cli This YAML file defines a GitHub Actions workflow to automatically deploy your Deno app to Slack Cloud when a new version tag is pushed. It checks out the repository, installs the Slack CLI, and then executes the deployment command. ```yaml # deploy.ymlname: Deploy to Slack Cloudon: push: tags: [ '*.*.*' ]jobs: deploy: runs-on: macos-latest steps: - name: Set up repo uses: actions/checkout@v3 - name: Install CLI run: curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash - name: Deploy run: slack deploy --app "${{ secrets.APP }}" --workspace "${{ secrets.WORKSPACE }}" --token "${{ secrets.SLACK_SERVICE_TOKEN }}" ``` -------------------------------- ### Create App from Sample Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_samples Use this command to create a new project by selecting a sample app. The command will prompt you to choose a sample if a name is not provided. ```bash slack samples my-project ``` -------------------------------- ### List Available Sample Apps Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_samples Use this command to list all available sample applications. You can filter the list by specifying the runtime language for the app framework. ```bash slack samples --list --language node ``` -------------------------------- ### Slack CLI Help for Samples Command Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_project_samples View help information for the slack project samples command, including available flags and their descriptions. ```bash slack project samples [name] [flags] ``` -------------------------------- ### List Authorized Slack Workspaces Source: https://docs.slack.dev/tools/slack-cli/guides/authorizing-the-slack-cli Verify your Slack CLI setup by listing all authorized workspaces. This command displays workspace and user details, including the last update time and authorization level. ```bash $ slack auth list myworkspace (Team ID: T123ABC456) User ID: U123ABC456 Last updated: 2023-01-01 12:00:00 -07:00 Authorization Level: Workspace ``` -------------------------------- ### Initialize a project Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_init Run this command to initialize a new project for the Slack CLI. It sets up necessary configuration files and dependencies. ```bash slack init # Initialize a project ``` -------------------------------- ### GitHub Actions CI/CD Workflow (deno.yml) Source: https://docs.slack.dev/tools/slack-cli/guides/setting-up-ci-cd-with-the-slack-cli Defines a CI pipeline triggered by pushes or pull requests to the main branch. It sets up the repository, installs Deno, and runs formatting checks, linting, tests, and type checks. ```yaml # deno.yml name: Deno app build and testing on: push: branches: [ main ] pull_request: branches: [ main ] jobs: deno: runs-on: ubuntu-latest timeout-minutes: 5 steps: - name: Set up repo uses: actions/checkout@v3 - name: Install Deno uses: denoland/setup-deno@v1 with: deno-version: v1.x - name: Verify formatting run: deno fmt --check - name: Run linter run: deno lint - name: Run tests run: deno task test - name: Run type check run: deno check *.ts && deno check **/*.ts ``` -------------------------------- ### Initialize an Existing Project with Slack CLI Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_project Run this command in an existing project directory to add Slack CLI support and configuration files. ```bash slack project init ``` -------------------------------- ### Create a New Slack Project from Sample Gallery Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_project This command creates a new Slack project using one of the sample applications available in the gallery. ```bash slack project samples ``` -------------------------------- ### Create a sandbox with a name and password Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_sandbox_create Use this command to create a basic sandbox with a specified name and password. ```bash slack sandbox create --name test-box --password mypass ``` -------------------------------- ### Create a project and link to an existing app Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_create You can create a new project from a template and simultaneously link it to an existing Slack app by providing its ID and environment using the '--app' and '--environment' flags. ```bash slack create my-project -t slack-samples/bolt-js-starter-template --app A0123456789 --environment local ``` -------------------------------- ### Viewing Help Information Source: https://docs.slack.dev/tools/slack-cli/guides/running-slack-cli-commands Run this command to display all available commands in your terminal. To see flags for a specific subcommand, append '--help'. ```bash slack help ``` ```bash slack --help ``` -------------------------------- ### Initialize environment variables Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_env_init Use this command to copy environment variables from a template file (`.env.sample` or `.env.example`) to your project's `.env` file. It only performs the copy if the `.env` file does not already exist. ```bash slack env init # Initialize environment variables from a template file ``` -------------------------------- ### Collect Items from Datastore Starting at a Cursor Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_datastore_query Retrieve items from the datastore starting from a specific cursor. This is essential for fetching subsequent pages of results after an initial query. ```bash slack datastore query --datastore tasks '{"cursor": "eyJfX2NWaV..."}' ``` -------------------------------- ### Get User Details Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_api Fetches detailed information about a specific user. Requires the user ID. ```bash slack api users.info user=U0123456 ``` -------------------------------- ### Get Channel Details Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_api Fetches detailed information about a specific channel. Requires the channel ID. ```bash slack api conversations.info channel=C0123456 ``` -------------------------------- ### Create a project from a subdirectory of a template Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_create If the template contains multiple subdirectories, use the '--subdir' flag to specify which subdirectory to use as your project. ```bash slack create my-project -t org/monorepo --subdir apps/my-app ``` -------------------------------- ### Deploy app to Slack Platform Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_platform_deploy Run this command to deploy your app to the Slack Platform. It will prompt you to select a workspace if not specified. ```bash slack platform deploy [flags] ``` -------------------------------- ### Get a User's Profile Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_api Retrieves the profile information for a specific user. Requires the user ID. ```bash slack api users.profile.get user=U0123456 ``` -------------------------------- ### Slack init command usage Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_init Basic usage of the `slack init` command. This command initializes a project to support the Slack CLI. ```bash slack init [flags] ``` -------------------------------- ### Count all items in a datastore Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_datastore_count Use this command to get a total count of all items stored within a specified datastore. ```bash slack datastore count --datastore tasks ``` -------------------------------- ### Help Flag for Collaborator List Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_collaborator_list Use the help flag to get information about the 'list' command within the collaborator context. ```bash slack collaborator list --help ``` -------------------------------- ### Remove Slack CLI Binary on Windows Source: https://docs.slack.dev/tools/slack-cli/guides/uninstalling-the-slack-cli Use this command in PowerShell to remove the Slack CLI binary from the default installation directory. ```powershell rd -r $HOME\AppData\Local\slack-cli ``` -------------------------------- ### Print App Manifest from Project Configurations Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_manifest_info Use this command to display the app manifest based on your local project configurations. This is useful for reviewing the current state of your app's configuration before deployment or for debugging. ```bash slack manifest info ``` -------------------------------- ### Organization Authorization Example Source: https://docs.slack.dev/tools/slack-cli/guides/using-slack-cli-on-an-enterprise-grid-organization This output confirms organization-level authorization, which is the standard for developers using the Slack CLI on Enterprise Grid organizations. ```bash OrgName (Team ID: E123ABC456)User ID: U123ABC456Last Updated: 2023-12-31 23:59:59 -7:00Authorization Level: Organization ``` -------------------------------- ### Create a new project from a template Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_create Use this command to create a new Slack project. You can specify a project name directly. ```bash slack create my-project ``` -------------------------------- ### Grant function access to everyone Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_function_access Share a specific function with all members of the installed workspace. Ensure you provide the correct callback ID for the function. ```bash slack function access --name callback_id --everyone ``` -------------------------------- ### Set PowerShell Language Mode Source: https://docs.slack.dev/tools/slack-cli/guides/installing-the-slack-cli-for-windows If the installer fails, ensure your PowerShell session's language mode is set to 'FullLanguage'. This command sets it. ```powershell $ExecutionContext.SessionState.LanguageMode = "FullLanguage" ``` -------------------------------- ### Deploy to a specific app ID or environment Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_deploy Use the -a or --app flag to specify a particular app ID or environment for deployment. ```bash slack deploy -a T0123456 ``` -------------------------------- ### Get trigger details by ID Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_trigger_info Use this command to fetch information for a specific trigger, identified by its unique ID. You can optionally specify the workspace. ```bash slack trigger info --trigger-id Ft01234ABCD ``` -------------------------------- ### List all authorized accounts Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_auth_list Use this command to see all accounts currently authorized with your Slack CLI installation. No specific flags are required for basic usage. ```bash slack auth list # List all authorized accounts ``` -------------------------------- ### Basic deploy command Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_deploy Use this command to deploy your app to the Slack Platform. It will prompt you to select a workspace if not specified. ```bash slack deploy ``` -------------------------------- ### Legacy Workspace Authorization Example Source: https://docs.slack.dev/tools/slack-cli/guides/using-slack-cli-on-an-enterprise-grid-organization This output represents a legacy workspace-specific authorization level, which is no longer grantable to new developers on Enterprise Grid organizations. ```bash WorkspaceName (Team ID: T123ABC456)User ID: U123ABC456Last Updated: 2023-12-31 23:59:59 -7:00Authorization Level: Workspace ``` -------------------------------- ### Create a project with a specific name Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_create Use the '--name' flag to explicitly set the name for your new project, overriding any name provided as an argument. ```bash slack create --name my-project ``` -------------------------------- ### Get trigger details by ID and App Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_trigger_info Retrieve details for a specific trigger within a particular application. This command requires both the trigger ID and the App ID. ```bash slack trigger info --trigger-id Ft01234ABCD --app A0123456 ``` -------------------------------- ### Slack CLI Help for List Command Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_env_list Displays help information for the 'slack env list' command, including available flags. ```bash slack env list [flags] ``` -------------------------------- ### Basic Trigger Creation Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_trigger_create Use this command to create a trigger by interactively selecting an app and providing a trigger definition. ```bash slack trigger create ``` -------------------------------- ### Override Specific Hooks with Custom Commands Source: https://docs.slack.dev/tools/slack-cli/reference/hooks Customize hook behavior by overriding default commands in `hooks.json`. This example shows overriding `get-hooks` and `get-manifest`, and adding a new `custom-hook`. ```json { "hooks": { "get-hooks": "deno run -q --unstable --allow-read --allow-net https://deno.land/x/deno_slack_hooks@0.0.4/mod.ts", // This is a user-defined custom hook that overrides the default "get-manifest" "get-manifest": "deno run -q --unstable --config=deno.jsonc --allow-read --allow-net https://deno.land/x/deno_slack_builder@0.0.8/mod.ts --manifest", // This is a user-defined custom hook that adds new functionality "custom-hook": "deno run my-custom-hook.ts" } } ``` -------------------------------- ### Slack CLI Authorization Ticket Source: https://docs.slack.dev/tools/slack-cli/guides/authorizing-the-slack-cli This is an example of the authorization ticket displayed in the terminal after running `slack login`. It includes a slash command to run in Slack and a prompt for a challenge code. ```bash $ slack login 📋 Run the following slash command in any Slack channel or DM This will open a modal with user permissions for you to approve Once approved, a challenge code will be generated in Slack/slackauthticket ABC123defABC123defABC123defABC123defXYZ? Enter challenge code ``` -------------------------------- ### Create a temporary sandbox with TTL Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_sandbox_create Create a sandbox that will be automatically archived after a specified time-to-live duration. This is useful for temporary development environments. ```bash slack sandbox create --name test-box --password mypass --domain test-box --archive-ttl 1d ``` -------------------------------- ### Customize Watch Paths in .slack/hooks.json Source: https://docs.slack.dev/tools/slack-cli/guides/developing-locally Override default watch paths to specify which directories the Slack CLI should monitor for changes. This example watches JavaScript files in 'src/' but not 'scripts/'. ```json { "config": { "watch": { "manifest": { "paths": ["manifest.json"] }, "app": { "paths": ["src/"] } } } } ``` -------------------------------- ### Slack CLI Datastore Command Structure Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_datastore The general syntax for interacting with the datastore using the Slack CLI. ```bash slack datastore [flags] ``` -------------------------------- ### Get items from datastore by IDs Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_datastore_bulk-get Use this command to retrieve specific items from a datastore by providing their IDs within a JSON object. The `--datastore` flag specifies the target datastore. ```bash slack datastore bulk-get --datastore tasks '{"ids": ["12", "42"]}' ``` -------------------------------- ### Create a sandbox with a specific archive date Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_sandbox_create Create a sandbox that will be archived on a precise date. This allows for long-term planning of sandbox lifecycles. ```bash slack sandbox create --name test-box --password mypass --domain test-box --archive-date 2025-12-31 ``` -------------------------------- ### List all developer sandboxes Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_sandbox_list Use this command to view all developer sandboxes associated with your account. No additional flags are required. ```bash slack sandbox list ``` -------------------------------- ### Get an item from the datastore Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_datastore_get Retrieves a single item from the specified datastore using a JSON object to define the item's ID. Requires the `--datastore` flag to specify the target datastore. ```bash slack datastore get --datastore tasks '{"id": "42"}' ``` -------------------------------- ### Slack CLI Help for 'add' command Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_collaborator_add Displays help information for the 'slack collaborator add' command. ```bash slack collaborator add [email|user_id] [flags] ## Flags ``` -h, --help help for add -P, --permission-type string collaborator permission type ("owner" or "reader") (default "owner") ``` ``` -------------------------------- ### List Project Environment Variables Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_env_list Use this command to view all environment variables that are accessible to your project. These variables are typically loaded from a .env file. ```bash slack env list # List all environment variables ``` -------------------------------- ### Display App Activity Logs Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_activity Use this command to display the app activity logs for a specific app. This is the basic usage of the command. ```bash slack platform activity ``` -------------------------------- ### Get an item from the datastore with an expression Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_datastore_get Retrieves a single item from the datastore by providing a JSON expression that includes both the datastore name and the item's ID. This method is useful when the datastore is not specified via a flag. ```bash slack datastore get '{"datastore": "tasks", "id": "42"}' ``` -------------------------------- ### Get items from datastore using a JSON expression Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_datastore_bulk-get This command retrieves items from a datastore by using a JSON expression that includes both the datastore name and the item IDs. This provides a more structured way to query for multiple items. ```bash slack datastore bulk-get '{"datastore": "tasks", "ids": ["12", "42"]}' ``` -------------------------------- ### List all environment variables Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_env Use `slack env list` to view all environment variables currently configured for your project. This helps in verifying your settings. ```bash slack env list ``` -------------------------------- ### Link a specific app with environment Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_app_link Link a specific app to your project by providing its Team ID, App ID, and environment. This avoids interactive prompts. ```bash slack app link --team T0123456789 --app A0123456789 --environment deployed ``` -------------------------------- ### Deploy to all workspaces in an organization Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_deploy Grant access to all workspaces within an organization for deployment by using '--org-workspace-grant all'. ```bash slack deploy --org-workspace-grant all ``` -------------------------------- ### Slack Project Command Structure Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_project This is the general structure for using the slack project command. Replace `` with a specific action like `create`, `init`, or `doctor`. ```bash slack project [flags] ``` -------------------------------- ### Sandbox command structure Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_sandbox This is the basic structure for using the sandbox command. Use subcommands like create, delete, or list to perform specific actions. ```bash slack sandbox [flags] ``` -------------------------------- ### slack env init command usage Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_env_init Basic usage of the `slack env init` command. This command initializes environment variables from a template file. ```bash slack env init [flags] ``` -------------------------------- ### Help for list command Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_list View help information for the slack list command, including available flags. ```bash slack list [flags] -h, --help help for list ``` -------------------------------- ### Force deployment and ignore warnings Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_deploy Use the -f or --force flag to ignore warnings and continue with the deployment command. ```bash slack deploy -f ``` -------------------------------- ### Print Slack CLI Version Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_version Use this command to display the current version of the Slack CLI. ```bash slack version [flags] ``` -------------------------------- ### Create a new AI Agent app Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_create To create a new AI Agent app, use the 'agent' keyword followed by the desired app name. ```bash slack create agent my-agent-app ``` -------------------------------- ### Basic slack env command structure Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_env This is the general syntax for using the `slack env` command. Replace `` with `init`, `set`, `list`, or `unset`. ```bash slack env [flags] ``` -------------------------------- ### Create or replace datastore entries Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_datastore_bulk-put Use this command to create or replace multiple entries in a specified datastore. Provide the datastore name and a JSON object containing the items to be added or updated. ```bash slack datastore bulk-put --datastore tasks '{"items": [{"id": "12", "description": "Create a PR", "status": "Done"}, {"id": "42", "description": "Approve a PR", "status": "Pending"}]}' ``` -------------------------------- ### Slack CLI Samples Command Flags Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_project_samples Explore the flags available for the slack project samples command, such as specifying the app framework runtime language or listing samples non-interactively. ```bash -h, --help help for samples --language string runtime for the app framework ex: "deno", "node", "python" --list prints samples without interactivity ``` -------------------------------- ### Slack CLI Project Create Command Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_project_create This is the basic syntax for creating a new Slack project using the Slack CLI. You can provide a name for your project or use 'agent ' to create an AI Agent app. ```bash slack project create [name | agent ] [flags] ``` -------------------------------- ### Use custom config directory Source: https://docs.slack.dev/tools/slack-cli/reference/commands/slack_deploy Specify a custom path for the system config directory using the --config-dir flag. ```bash slack deploy --config-dir "/path/to/config" ```