Add kamal app open
command to open app in a web browser
#1070
+45
−0
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.
Problem
Kamal is a no-PaaS tool with PaaS-like ergonomics, where you can easily open a production Rails (or other) console, a shell session, tail logs, etc. A small feature that could be implemented to further align with this vision is a command to open the app in a web browser, similar to Heroku's
heroku open
or Fly.io'sfly apps open
.This would allow for quick access to a deployed web application, from the CLI, without having to manually copy/paste the URL from one of your browser tabs or your
config/deploy.yml
or some other file. Examples where this can be useful:Solution
Add a
kamal app open
command. It opens the primary role's (usuallyweb
) first domain defined inproxy
host(s)
, or falls back to the primary role's first IP address.The implementation is short, so adding a dependency for finding the OS opening command (with a gem like launchy) felt like too much. But I can change the PR if needed.