Skip to content

Comments

feat(create): show generated app name in hint line instead of input default#340

Open
srtaalej wants to merge 5 commits intomainfrom
ale-feat-app-naming
Open

feat(create): show generated app name in hint line instead of input default#340
srtaalej wants to merge 5 commits intomainfrom
ale-feat-app-naming

Conversation

@srtaalej
Copy link
Contributor

@srtaalej srtaalej commented Feb 12, 2026

Changelog

The slack create command now prompts for a custom app name if the randomly generated default isn't quite right for whatever reason. We prompt this before scaffolding the new project from a template!

When making new project directories with a custom app name, we now replace spaces with a dash (instead of removing spaces altogether) to make navigation a bit better across systems. 🦋

Fixes

  • fix: replace spaces with hyphens in app directory namesslack create with an app name containing spaces (e.g. "my cool app") now produces my-cool-app instead of mycoolapp. Leading and trailing whitespace is also trimmed.
  • fix: generate default app name in non-TTY mode — Running slack create -t <template> | cat (or in scripts) no longer errors with "app name is required". A random name is generated automatically when no name is provided and the terminal is non-interactive.

Summary

This PR enables users to input an app name if one wasn't provided on slack create. Generated name can still be used by pressing Enter.

Screenshot 2026-02-12 at 12 49 48 PM

Test plan

  • make test testdir=cmd/project testname=TestCreateCommand passes
  • make test testdir=internal/pkg/create testname=TestGetProjectDirectoryName passes
  • Manual: ./bin/slack create shows generated name in gray hint, input field is empty
  • Manual: ./bin/slack create -t slack-samples/bolt-js-starter-template | cat generates a default name instead of erroring

Requirements

@srtaalej srtaalej self-assigned this Feb 12, 2026
@srtaalej srtaalej requested a review from a team as a code owner February 12, 2026 17:51
@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 Feb 12, 2026
@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.78%. Comparing base (113aa42) to head (a120396).

Files with missing lines Patch % Lines
cmd/project/create.go 89.47% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #340      +/-   ##
==========================================
+ Coverage   64.73%   64.78%   +0.05%     
==========================================
  Files         212      212              
  Lines       17809    17823      +14     
==========================================
+ Hits        11528    11546      +18     
+ Misses       5207     5202       -5     
- Partials     1074     1075       +1     

☔ 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 changed the title fix(create): show generated app name in hint line instead of input default feat(create): show generated app name in hint line instead of input default Feb 17, 2026
@zimeg zimeg added the changelog Use on updates to be included in the release notes label Feb 17, 2026
@zimeg zimeg added this to the Next Release milestone Feb 17, 2026
Copy link
Member

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

@srtaalej LGTM and I think a kind change to the create experience - revising the generated name after a template is cloned is quite burdensome I've found!

Approving now with the logic working well, but I left a few thoughts about how we're organizing this code. Also a note on prompts, but nothing so blocking! 🚀

Comment on lines 153 to 154
// GenerateRandomAppName will create a random app name based on two words and a number
func GenerateRandomAppName() string {
Copy link
Member

Choose a reason for hiding this comment

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

🪬 question: Can we move this logic into cmd/project/create.go instead of exporting from pkg? I'm hoping we can move all of these "inputs" to the command level as we move away from internal/pkg long-term!

Copy link
Member

Choose a reason for hiding this comment

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

⭐ ramble: We might prefer erroring below - L165 - instead of attempting to generate this too!

Copy link
Member

Choose a reason for hiding this comment

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

🤖 ramble: Also, so unrelated, but we might want to replace " " spaces with "-" in that getAppDirName function... While still removing surrounding spaces of course!

It's strange to combine words otherwise IMHO!

type InputPromptConfig struct {
Required bool // Whether the input must be non-empty
Required bool // Whether the input must be non-empty
Default string // Default value pre-filled in the prompt
Copy link
Member

Choose a reason for hiding this comment

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

👁️‍🗨️ question: Is this used in the defaulting prompt logic above?

No blocker but I'm hoping we can move toward huh instead of updating these packages overall!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch - default is not used! missed that before committing 😬

Copy link
Member

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

Edit: I notice we're not guarding against the CI case!

$ slack create -t slack-samples/bolt-js-starter-template | cat

We should avoid prompting for this - I'll leave a note with ideas next!

Copy link
Member

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

📫 Here's the comment on interactive inputs!

Our current input prompt implementation doesn't seem to error as we'd hope for this input, but let's guard against this at the callsite instead of updating prompts further I think!

Copy link
Member

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

@srtaalej I'm perhaps too soon to review again, but want to callout the test case we want to protect before merging this changeset, perhaps with unit test:

$ lack create -t slack-samples/bolt-js-starter-template | cat
Check /Users/eden.zimbelman/.slack/logs/slack-debug-20260218.log for error logs
app name is required

Instead of erroring for this command we can fallback to the default generated name as requiring new arguments might break existing scripts 👾

Comment on lines 47 to +49
"creates a bolt application from prompts": {
Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) {
cm.IO.On("IsTTY").Return(true)
Copy link
Member

Choose a reason for hiding this comment

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

🧪 suggestion: We might want to include a test case alongside af97eca changes - do we have a unit test that's checking for --template arguments while IsTTY is also set to false?

Comment on lines 168 to +159
// trim whitespace
appName = strings.ReplaceAll(appName, " ", "")
appName = strings.TrimSpace(appName)
appName = strings.ReplaceAll(appName, " ", "-")
Copy link
Member

Choose a reason for hiding this comment

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

📣 note: Let's call this out in the changelog as a fix as well! I'll make a few changes to this since we'll also want to keep it focused on just developer-facing features-

@zimeg
Copy link
Member

zimeg commented Feb 18, 2026

🗣️ ramble: We could leave a note for later if that is a breaking change we'll want - sharing this for quick reference:

https://github.com/slackapi/slack-cli/blob/main/.github/MAINTAINERS_GUIDE.md#deprecating-features-and-flags

@srtaalej srtaalej requested review from mwbrooks and zimeg February 19, 2026 17:25
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.

2 participants