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

Add kamal app open command to open app in a web browser #1070

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jeromedalbert
Copy link
Contributor

@jeromedalbert jeromedalbert commented Oct 7, 2024

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's fly 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:

  • right after deploying your app
  • when switching between different Kamal-enabled repos
  • in copy/paste-able Readme instructions
  • any time you're in the command line and want to easily open the app in your browser

Solution

Add a kamal app open command. It opens the primary role's (usually web) first domain defined in proxy 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.

To open the app in a web browser
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

Successfully merging this pull request may close these issues.

2 participants