Skip to content

feat: list available ".env" variable names for non-hosted apps#437

Open
zimeg wants to merge 1 commit intozimeg-feat-load-hook-dotenvfrom
zimeg-feat-dotenv-list
Open

feat: list available ".env" variable names for non-hosted apps#437
zimeg wants to merge 1 commit intozimeg-feat-load-hook-dotenvfrom
zimeg-feat-dotenv-list

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Mar 25, 2026

Changelog

The slack env list command will now list the environment variables available from the .env file for apps that aren't run on Slack infrastructure.

Summary

This PR lists available .env variable names for non-hosted apps to match what's available to hooks and the run command.

Preview

demo

Reviewers

Your check is so appreciated. The following commands might recommend testing:

$ slack create asdf -t slack-samples/bolt-js-starter-template
$ cd asdf
$ echo "EXAMPLE_TOKEN=12" > .env
$ slack install
$ slack env list
$ slack create asdf -t slack-samples/deno-starter-template
$ cd asdf
$ slack deploy
$ slack env add   # Perhaps odd examples can be used
$ slack env list

When done please do delete these apps! This is the environment command kindplace 🌲 ✨

Requirements

@zimeg zimeg added this to the Next Release milestone Mar 25, 2026
@zimeg zimeg self-assigned this Mar 25, 2026
@zimeg zimeg requested a review from a team as a code owner March 25, 2026 06:32
@zimeg zimeg added enhancement M-T: A feature request for new functionality semver:minor Use on pull requests to describe the release version increment labels Mar 25, 2026
@codecov
Copy link

codecov bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 86.66667% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.28%. Comparing base (fb0cce1) to head (9b8c7a1).

Files with missing lines Patch % Lines
cmd/env/list.go 86.66% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@                       Coverage Diff                       @@
##           zimeg-feat-load-hook-dotenv     #437      +/-   ##
===============================================================
+ Coverage                        70.27%   70.28%   +0.01%     
===============================================================
  Files                              220      220              
  Lines                            18534    18540       +6     
===============================================================
+ Hits                             13024    13031       +7     
+ Misses                            4336     4335       -1     
  Partials                          1174     1174              

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

Copy link
Member Author

@zimeg zimeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

   *  Thoughts for the fantastic reviewers!  *

Image

Comment on lines +38 to +44
"List environment variables available to the app at runtime.",
"",
"This command is supported for apps deployed to Slack managed infrastructure but",
"other apps can attempt to run the command with the --force flag.",
"Commands that run in the context of a project source environment variables from",
"the \".env\" file. This includes the \"run\" command.",
"",
"The \"deploy\" command gathers environment variables from the \".env\" file as well",
"unless the app is using ROSI features.",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📸 Preview

Image

return err
}
} else {
dotEnv, err := hooks.LoadDotEnv(clients.Fs)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪝 note: We reuse the logic that hooks has for gathering environment variables for confidence in matching!

🐟 ramble: We don't require app selection before this at this point, but we might consider keeping it to avoid breaking change if it becomes required later. FWIW it's required for hosted apps so this is familiar experience I think!

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