Skip to content
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

[cli] Implement a gp command to get preview URLs #246

Closed
jankeromnes opened this issue Jan 17, 2019 · 3 comments
Closed

[cli] Implement a gp command to get preview URLs #246

jankeromnes opened this issue Jan 17, 2019 · 3 comments

Comments

@jankeromnes
Copy link
Contributor

Some projects' development servers only accept requests with a pre-specified host (e.g. localhost, or example.com) and any request using a different host will get dropped (for example Gitpod preview URLs). Note: This is orthogonal to binding ports on localhost or 0.0.0.0.

@32leaves suggested we could have a gp command that returns preview URLs.

I suggest the following new feature:

$ gp preview-url 4242
https://4242-abcdef01-2345-6789-81e5-e7f1005fb9c8.ws-eu.gitpod.io/

Should we also have a way to list currently running ports? Or maybe implement auto-complete for this? Comments/suggestions very welcome.

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Jan 17, 2019

Note: There are already similar commands like gp url and gp preview:

$ gp url
https://abcdef01-2345-6789-81e5-e7f1005fb9c8.ws-eu.gitpod.io/

$ gp preview http://nyan.cat
# opens given URL in Preview

To stay consistent, maybe my suggested gp preview-url 4242 should be a parameter for gp url instead? E.g. gp url 4242 or gp url --port=4242.

@jankeromnes
Copy link
Contributor Author

Another idea if we add preview URLs to gp url could be to have a gp url -a or gp url --all:

$ gp url --all
Workspace   https://abcdef01-2345-6789-81e5-e7f1005fb9c8.ws-eu.gitpod.io/
Port 4242   https://4242-abcdef01-2345-6789-81e5-e7f1005fb9c8.ws-eu.gitpod.io/
Port 8080   https://8080-abcdef01-2345-6789-81e5-e7f1005fb9c8.ws-eu.gitpod.io/

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Jan 17, 2019

Oh, wow, it actually exists already:

$ gp help url
Prints the URL of this workspace. This command can print the URL of
the current workspace itself, or of a service running in this workspace on a
particular port. For example:
    gp url 8080
will print the URL of a service/server exposed on port 8080.

Usage:
  gp url [port] [flags]

Flags:
  -h, --help   help for url

$ gp url 4242
https://4242-abcdef01-2345-6789-81e5-e7f1005fb9c8.ws-eu.gitpod.io/

That was easy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant