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 CLI support with auto-auth helper command #3

Merged
merged 7 commits into from
Apr 1, 2019

Conversation

dhleong
Copy link
Owner

@dhleong dhleong commented Apr 1, 2019

Includes a CLI that can be installed globally supporting:

babbling auto-auth  
babbling cast <url>
  • auto-auth Reads cookies and tokens from Chrome into a config file to enable easier PlayerBuilder instantiation, and also enables the babbling cast command

In addition, so you don't have to specify the device every time you can use:

babbling config device "My Chromecast"

for example, to always cast to a device called "My Chromecast."

Once auto-auth is complete, you can acquire a PlayerBuilder with all apps authenticated using:

const builder = await PlayerBuilder.autoInflate()

// we don't yet use the `device` config, so add it:
builder.addDevice(new ChromecastDevice("My Chromecast"));

// add extra config if desired (it gets merged)
builder.withApp(YoutubeApp, { deviceName: "Smart Home" });

// done!
builder.build();

Babbling will handle the file reading and app auth for you!

This also contains some inital (untested) support for the "read"
part of this feature.

Chromagnon will be published in a bit
I'm not super happy with this yet; we should probably default to
"some" device if none is specified, and support selecting one
to cast to and storing that in the config.json
"Auth" is somewhat clearer, and less likely to be confused with
the config keys
@dhleong dhleong merged commit 530ce09 into master Apr 1, 2019
@dhleong dhleong deleted the dhleong/config-helper branch April 1, 2019 00:34
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.

1 participant