A developer running Connect-Confluence for the first time should not have to know their site name, cloud ID, or token in advance. The current command requires all three as mandatory parameters, which is fine for automation but creates unnecessary friction for interactive sessions.
Request
Desired capability
Running Connect-Confluence interactively with no parameters (or with a -Interactive switch) should:
- Open the Atlassian API token creation page in the default browser, so the user can create or copy a token without hunting for the URL.
- Prompt for credentials (
Username and Token) in the terminal once the user is ready.
- Call
Get-ConfluenceAccessibleResource with the supplied token to enumerate all sites the token can reach.
- If more than one site is returned, present a numbered or named menu and let the user pick one (
$host.UI.PromptForChoice or Out-ConsoleGridView).
- Connect to the chosen site and store the context exactly as the non-interactive path does today.
If only one site is returned, skip the menu and connect directly.
The non-interactive path (-Site, -CloudId, -Username, -Token) is unchanged.
Acceptance criteria
- Running
Connect-Confluence with no mandatory parameters launches the browser and guides the user through token setup and site selection.
- When a token can reach multiple sites, a clear choice list is shown.
- When only one site is reachable, the user is connected without extra prompts.
- The resulting context is identical to what a direct
Connect-Confluence -Site ... -Username ... -Token ... call would produce.
- The interactive path does not break or require changes from callers using the existing strict-parameter path.
Technical decisions
Mechanism for site discovery: Get-ConfluenceAccessibleResource already exists and returns the id (cloud ID), url, name, and scopes for every accessible site. No new API call is needed.
Browser launch: Start-Process with the token-creation URL. Wrapping it in a Write-Host message ("Opening the Atlassian token page in your browser...") so terminal-only environments degrade gracefully.
Site selection UI: $host.UI.PromptForChoice is cross-platform and works in all PowerShell hosts (terminal, VS Code, ISE). Out-ConsoleGridView (PSModule/ConsoleGridView) would be nicer but adds a dependency. Decision: use PromptForChoice by default; consider Out-ConsoleGridView as an optional enhancement if the module gains that dependency.
Parameter set design: Open question — a dedicated -Interactive switch on the existing Connect-Confluence vs. a separate parameter set with no mandatory parameters. Resolve at implementation.
Open: Should the interactive path also accept a -Site filter so a caller can say "I know I want msxorg, just handle the token part interactively"? Defer to implementation.
Implementation plan
Core changes
Tests
Documentation
A developer running
Connect-Confluencefor the first time should not have to know their site name, cloud ID, or token in advance. The current command requires all three as mandatory parameters, which is fine for automation but creates unnecessary friction for interactive sessions.Request
Desired capability
Running
Connect-Confluenceinteractively with no parameters (or with a-Interactiveswitch) should:UsernameandToken) in the terminal once the user is ready.Get-ConfluenceAccessibleResourcewith the supplied token to enumerate all sites the token can reach.$host.UI.PromptForChoiceorOut-ConsoleGridView).If only one site is returned, skip the menu and connect directly.
The non-interactive path (
-Site,-CloudId,-Username,-Token) is unchanged.Acceptance criteria
Connect-Confluencewith no mandatory parameters launches the browser and guides the user through token setup and site selection.Connect-Confluence -Site ... -Username ... -Token ...call would produce.Technical decisions
Mechanism for site discovery:
Get-ConfluenceAccessibleResourcealready exists and returns theid(cloud ID),url,name, andscopesfor every accessible site. No new API call is needed.Browser launch:
Start-Processwith the token-creation URL. Wrapping it in aWrite-Hostmessage ("Opening the Atlassian token page in your browser...") so terminal-only environments degrade gracefully.Site selection UI:
$host.UI.PromptForChoiceis cross-platform and works in all PowerShell hosts (terminal, VS Code, ISE).Out-ConsoleGridView(PSModule/ConsoleGridView) would be nicer but adds a dependency. Decision: usePromptForChoiceby default; considerOut-ConsoleGridViewas an optional enhancement if the module gains that dependency.Parameter set design: Open question — a dedicated
-Interactiveswitch on the existingConnect-Confluencevs. a separate parameter set with no mandatory parameters. Resolve at implementation.Open: Should the interactive path also accept a
-Sitefilter so a caller can say "I know I want msxorg, just handle the token part interactively"? Defer to implementation.Implementation plan
Core changes
Interactiveparameter set toConnect-Confluence(no mandatory parameters)https://id.atlassian.com/manage-profile/security/api-tokensin the default browser viaStart-ProcessUsernameandTokenviaRead-Host/Read-Host -AsSecureStringGet-ConfluenceAccessibleResourceto enumerate accessible sites$host.UI.PromptForChoiceand connect to the chosen site.EXAMPLEinteractive block)Tests
Interactiveparameter set is exportedDocumentation
Connect-Confluencehelp with an interactive usage exampleConnect-Confluence(no arguments) as the recommended first-run experience