Skip to content

feat: alias env set and env unset as primary commands#460

Merged
zimeg merged 6 commits intomainfrom
zimeg-feat-dotenv-set-unset-alias
Apr 3, 2026
Merged

feat: alias env set and env unset as primary commands#460
zimeg merged 6 commits intomainfrom
zimeg-feat-dotenv-set-unset-alias

Conversation

@zimeg
Copy link
Copy Markdown
Member

@zimeg zimeg commented Apr 2, 2026

Changelog

The env commands were aliased to env set and env unset to match more common shell conventions. These commands were recommended as add and remove before, which became confusing when existing variables were updated.

Summary

This PR aliases the env set and env unset commands to be the preferred command of setting and unsetting environment variables.

Preview

env

Reference

Requirements

@zimeg zimeg added this to the Next Release milestone Apr 2, 2026
@zimeg zimeg self-assigned this Apr 2, 2026
@zimeg zimeg added enhancement M-T: A feature request for new functionality changelog Use on updates to be included in the release notes semver:minor Use on pull requests to describe the release version increment labels Apr 2, 2026
@zimeg zimeg requested review from a team as code owners April 2, 2026 03:59
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.06%. Comparing base (c7106d2) to head (047c85f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #460      +/-   ##
==========================================
+ Coverage   71.04%   71.06%   +0.01%     
==========================================
  Files         220      220              
  Lines       18520    18522       +2     
==========================================
+ Hits        13158    13162       +4     
+ Misses       4183     4181       -2     
  Partials     1179     1179              

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

@zimeg zimeg force-pushed the zimeg-feat-dotenv-set-unset-alias branch from bb9ca9a to a1c20f8 Compare April 2, 2026 04:06
@zimeg zimeg changed the base branch from zimeg-feat-dotenv-remove to main April 2, 2026 04:07
Copy link
Copy Markdown
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.

🌐 Comments to the kind reviewers!

cmd := &cobra.Command{
Use: "add <name> [value] [flags]",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🔭 note: While this command is changed we also prefer the square brackets with follow up in #459 since the "name" argument has a form fallback-

Copy link
Copy Markdown
Member

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

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

✅ Great work on a wide, clean sweep that gracefully switches the primary commands. This feels so much better to type and use!

cmd := &cobra.Command{
Use: "list [flags]",
Short: "List all environment variables for the app",
Short: "List all environment variables of the project",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

praise: Nice catch!

### Storing deployed environment variables {#deployed-env-vars}

When your app is [deployed](/tools/deno-slack-sdk/guides/deploying-to-slack), it will no longer use the `.env` file. Instead, you will have to add the environment variables using the [`env add`](/tools/slack-cli/reference/commands/slack_env_add) command. Environment variables added with `env add` will be made available to your deployed app's [custom functions](/tools/deno-slack-sdk/guides/creating-custom-functions) just as they are locally; see examples in the next section.
When your app is [deployed](/tools/deno-slack-sdk/guides/deploying-to-slack), it will no longer use the `.env` file. Instead, you will have to add the environment variables using the [`env set`](/tools/slack-cli/reference/commands/slack_env_set) command. Environment variables added with `env set` will be made available to your deployed app's [custom functions](/tools/deno-slack-sdk/guides/creating-custom-functions) just as they are locally; see examples in the next section.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

praise: The power of the docs being part of the repo. Thanks for making this sweeping change so smooth!

Comment on lines +81 to +82
EnvSetSuccess = "SLACK_TRACE_ENV_SET_SUCCESS"
EnvUnsetSuccess = "SLACK_TRACE_ENV_UNSET_SUCCESS"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

question: Does our E2E rely on these traces at all?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@mwbrooks Not at this time but we do check for expected outputs. I have a PR in draft that we can use to make this more stable if we're alright with these changes for the next release?

Use: "add <name> [value] [flags]",
Short: "Add an environment variable to the project",
Use: "set [name] [value] [flags]",
Aliases: []string{"add"},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

note: Nice to see add remains an alias for backwards compatibility.

Use: "remove <name> [flags]",
Short: "Remove an environment variable from the app",
Use: "unset [name] [flags]",
Aliases: []string{"remove"},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

note: Nice to see remove remains an alias for backwards compatibility.

Copy link
Copy Markdown
Contributor

@srtaalej srtaalej left a comment

Choose a reason for hiding this comment

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

⭐ ⭐ ⭐ working great! left a few comments about leftover references to "removing" but LGTM 🚀

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looking great!! i noticed there are still a few references to removing in the file 👁️‍🗨️
line 120 "Select a variable to remove"
line 150 "Successfully removed \"%s\" from the app's environment variables"
might be nice to update these too 🚀

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@srtaalej Thanks for catching this! I saw a few comments you left similar in #461 and will save these changes for such 🎁

@zimeg
Copy link
Copy Markdown
Member Author

zimeg commented Apr 3, 2026

@mwbrooks @srtaalej Thanks both too for the kind readings of this PR! I'll merge it now with follow up noted in #461 with adjacent question to not block this at this time 🌲 🌚

@zimeg zimeg merged commit 5ee9e10 into main Apr 3, 2026
8 checks passed
@zimeg zimeg deleted the zimeg-feat-dotenv-set-unset-alias branch April 3, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog Use on updates to be included in the release notes 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.

3 participants