Skip to content

feat(cli): add open app <workspace> <app-slug> command #17032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 21, 2025

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Mar 20, 2025

Fixes #17009

Adds a CLI command coder open app <workspace> <app-slug> that allows opening arbitrary coder_apps via the CLI.

Users can optionally specify a preferred region for workspace applications.

@johnstcn johnstcn self-assigned this Mar 20, 2025
@johnstcn johnstcn force-pushed the cj/cli-open-coder-app branch 2 times, most recently from 70e04ba to a778d6c Compare March 21, 2025 12:38
@johnstcn johnstcn force-pushed the cj/cli-open-coder-app branch from a778d6c to afbe048 Compare March 21, 2025 12:46
@johnstcn johnstcn marked this pull request as ready for review March 21, 2025 13:00
@johnstcn johnstcn requested review from mafredri and hugodutka March 21, 2025 13:00
@@ -54,3 +62,107 @@ func Test_resolveAgentAbsPath(t *testing.T) {
})
}
}

func Test_buildAppLinkURL(t *testing.T) {
Copy link
Member Author

@johnstcn johnstcn Mar 21, 2025

Choose a reason for hiding this comment

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

review: I adapted the test cases from app.test.ts. If you have other suggestions for test cases, I'd be happy to add them!

u.RawQuery = q.Encode()
// encodeURIComponent replaces spaces with %20 but url.QueryEscape replaces them with +.
// We replace them with %20 to match the TypeScript implementation.
u.RawQuery = strings.ReplaceAll(u.RawQuery, "+", "%20")
Copy link
Member Author

Choose a reason for hiding this comment

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

review: I'm not sure if this is strictly necessary? Did it for completeness' sake.

Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

I'd like to see a slightly better UX, but otherwise this looks great. Nice work!

@johnstcn johnstcn requested a review from mafredri March 21, 2025 15:04
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Niiice, thanks for improving the UX!

@johnstcn johnstcn merged commit 0474888 into main Mar 21, 2025
32 checks passed
@johnstcn johnstcn deleted the cj/cli-open-coder-app branch March 21, 2025 15:28
@github-actions github-actions bot locked and limited conversation to collaborators Mar 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow coder open to work with any generic coder_app
2 participants