Skip to content

feat: add --app flag support to slack create for linking existing apps#565

Open
srtaalej wants to merge 1 commit into
mainfrom
ale-app-id-flag
Open

feat: add --app flag support to slack create for linking existing apps#565
srtaalej wants to merge 1 commit into
mainfrom
ale-app-id-flag

Conversation

@srtaalej
Copy link
Copy Markdown
Contributor

Changelog

slack create now accepts the --app flag alongside --template to scaffold a project and automatically link it to an existing app by fetching its manifest from App Settings.

Summary

This PR adds --app [ID] support to slack create. When used with --template, the CLI will:

  1. Resolve an authenticated workspace that has access to the specified app
  2. Fetch the app's manifest from the platform (apps.manifest.export)
  3. Scaffold the project from the template (existing behavior)
  4. Write the remote manifest to the project's manifest.json
  5. Link the app to the project (defaults to local/dev unless the manifest uses slack-hosted runtime)

The --name flag takes precedence over the remote manifest's display name when both are provided.
Using --app without --template returns an error with guidance.

Example:

slack create my-project -t slack-samples/bolt-js-starter-template --app A0123456789

Preview

  📂 Project Create
     Cloning template slack-samples/bolt-js-starter-template
     To path ~/programming/slack-cli/my-project

  📦 Project Dependencies
     Added my-project/.slack
     Added my-project/.slack/.gitignore
     Added my-project/.slack/config.json
     Added my-project/.slack/hooks.json
     Updated app manifest source to "project" (local)
     Added package @slack/cli-hooks@1.3.2
     Installed dependencies using npm install

  📋 Next Steps
     Learn more about the project in the README.md
     Change into your project with cd my-project/
     Start developing and see changes in real-time with slack run

Testing

make test testdir=cmd/project testname=TestCreateCommand_AppFlag  # — 8 integration tests
make test testdir=cmd/project testname=Test_resolveAuthForApp  # — auth resolution unit tests
make test testdir=cmd/project testname=Test_writeManifestToProject  # — manifest write unit test
make test testdir=cmd/project testname=Test_linkAppToProject   # — app linking unit tests

Manual verification:

  1. ./bin/slack create my-project -t slack-samples/bolt-js-starter-template --app <real-app-id>
  2. Confirmed .slack/apps.dev.json contains linked app with correct team/app IDs
  3. Confirmed manifest.json matches remote app's manifest
  4. Confirmed --app without --template returns helpful error
  5. Confirmed --name overrides manifest display name when provided

Notes

  • Follow-up: manifest merging — Currently the remote manifest fully overwrites the template's
    manifest.json. A future PR will implement git-style merging where template and remote manifests
    are combined.

Requirements

@srtaalej srtaalej self-assigned this May 28, 2026
@srtaalej srtaalej added enhancement M-T: A feature request for new functionality semver:minor Use on pull requests to describe the release version increment labels May 28, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

❌ Patch coverage is 65.88235% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.63%. Comparing base (c693443) to head (0d8bfd3).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/project/create_app.go 61.11% 16 Missing and 5 partials ⚠️
cmd/project/create.go 74.19% 4 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #565      +/-   ##
==========================================
- Coverage   71.66%   71.63%   -0.04%     
==========================================
  Files         226      227       +1     
  Lines       19115    19200      +85     
==========================================
+ Hits        13699    13754      +55     
- Misses       4209     4230      +21     
- Partials     1207     1216       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@srtaalej srtaalej marked this pull request as ready for review May 28, 2026 15:26
@srtaalej srtaalej requested a review from a team as a code owner May 28, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality semver:minor Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant