feat(setup): Add interactive setup wizard for CLI configuration #1636
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a new
fastly setupcommand providing an interactive wizard for configuring the Fastly CLI with API token or SSO authentication.Change summary
After installing the CLI for the first time, it’s not obvious how to set it up or register a profile.
Running
fastly ssois not necessarily what users would try first. When they do, it fails and tells them to usefastly profile create. However,fastly profile createasks for a token, while SSO is usually what users expect to use when setting up the CLI initially.We’ve received feedback from customers who wanted to use the MCP server but struggled to configure the CLI on their first attempt, and I experienced the same confusion myself.
This PR introduces a simple command designed to immediately catch the attention of new users right after installation, before they even need to consult the online documentation.
It checks whether a default profile already exists, lets users register a new profile either with an API token or via SSO, and gracefully handles conflicts with existing profile names.
It also prints a small set of suggested commands that users can run to try out the tool, along with the path where the configuration is stored. This information is especially helpful for first-time users.
The command name is intentionally generic ("setup"), allowing it to be extended in the future to support additional CLI setup tasks, such as enabling or configuring optional components.
While this command doesn’t introduce any new capabilities, it improves the onboarding experience.
It can also be run in non-interactive mode.
This is meant as a proposal. The setup command may feel redundant, and if the consensus is that it doesn’t add enough value, closing the pull request is completely fine :)
All Submissions:
New Feature Submissions:
Changes to Core Features:
User Impact
Improved onboarding experience.
Are there any considerations that need to be addressed for release?
A short documentation page needs to be written for this new command. I’d be happy to do it.
No breaking changes expected.
But this also addresses an old
TODOitem inprofile/create.goabout consolidating the directory check logic that was duplicated in multiple places (and would have had to be duplicated one more time).