-
Notifications
You must be signed in to change notification settings - Fork 13
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
Feature request: CLI version #28
Comments
I'm willing to spend some time on a CLI app. Some thoughts first (also on the cache, because it kinda ties in). In an ideal world:
How about (one or more of these) solutions:
What functionality did you have in mind, @alessioalex? |
What about disabling cache by default? This has a nice feature that if On Monday, 4 May 2015, Vincent Weevers [email protected] wrote:
|
That's cool, I'd really use some help here 😄
Agree, CLI would be a nice feature to have.
Makes sense - we may use NPM preinstall/postinstall script for that purpose.
I'm not sure if you have seen #6 (included in 0.4.5). Currently, when you try to launch a browser that wasn't available while the cache file was created, the file will automatically get updated. And when it comes to the browser detection, it works without the cache, so it won't cause any problems as well.
Check the
+1
Sounds OK, but first we should redesign the flow of the app to be less cache/config dependent (It should only try to detect the browser you really want to launch, not all available ones). Also, we'll need to change the way the profiles are handled (follow the way we handle Firefox right now - use Anyway, that's a topic for a separate ticket, so let's focus on CLI here. We should think how the CLI will look like. My guess would be: # no arguments - list all available browsers
$ browser-launcher2
# open a URL in a default browser (?)
$ browser-launcher2 "http://google.com"
# open a URL in a specific browser
$ browser-launcher2 "http://google.com" --browser/-b "chrome"
# I'm still not sure how to pass a browser version
# additionally, we'll have to enable some options:
# --proxy/-p <proxy_address>
# --options/-o <additional arguments for the instance>
# and flags:
# --detached/-d
# --headless/-H
# --no-proxy/-n
# update the cache
$ browser-launcher2 --update/-u
# show usage info
$ browser-launcher2 --help/-h
# show current version
$ browser-launcher2 --version/-v |
I would prefer explicit commands, because it makes parsing input easier, avoids confusion, we'll be able to have different flags per command, and it leaves room for future features. In the same order as yours: browser-launcher2 list
browser-launcher2 launch "http://google.com"
browser-launcher2 launch "http://google.com" -b chrome
browser-launcher2 update
browser-launcher2 --help
# without --help, you'll get usage info as well
browser-launcher2
browser-launcher2 --version And then also add npm-style shortcuts like browser-launcher2 l "http://google.com" -b chrome
browser-launcher2 u |
What are the use cases for the CLI? |
That's two that I can think of. Edit: A third one:
|
BTW/FYI: note that I wrapped
|
On second thought, I like yours better, @gregpabian. It's concise and adheres to the "do one thing and do it well" principle. This is a launcher, first and foremost; listing and updating are extras. I forgot that for a moment. I'll start on a PR soon. |
@vweevers I'm glad we agree on that, I'm looking forward to see your PR :) |
See #37 |
Would be great for running demos so you don't have to manually open the browser.
The text was updated successfully, but these errors were encountered: