prasmussen / chrome-cli

Control Google Chrome from the command line
MIT License
2.61k stars 89 forks source link

add command to list tabs' with the link #77

Closed k-ueki closed 1 year ago

k-ueki commented 1 year ago

Thanks for the maintenance of chrome-cli. Now, there are two types of acquisition of tabs and links respectively, but I had a personal request to acquire tabs and links at once while using chrome-cli. I personally implemented it and used it, but there was the same opinion in the issue, so I submitted a PR.

prasmussen commented 1 year ago

This is great, thank you. Currently the output doesn't look so good on smaller screens because of the large padding. What do we think about this output:

[1869578131] title: Hacker News, url: https://news.ycombinator.com/
[1869578132] title: Lobsters, url: https://lobste.rs/

Ping @tadhg-ohiggins / #72

tadhg-ohiggins commented 1 year ago

This looks great, thank you both!

I think that output format works fine, although I would consider changing the , separator to something less common. Not that hard to work around in any case, though.

k-ueki commented 1 year ago

Thank you both of you for your comment!

I have changed the output format as you say. I considered using a separator other than ,, but I thought it would be rare to include it in the title, so I used it. What do you think?

tadhg-ohiggins commented 1 year ago

I think it's fine, I can split on , url: if the comma becomes a problem. Thanks again!

prasmussen commented 1 year ago

Awesome, thanks for this. I will create a new release later.

prasmussen commented 1 year ago

Btw @tadhg-ohiggins, the json output combined with something like jq can also be useful if you need a specific output:

$ OUTPUT_FORMAT=json chrome-cli list tablinks | jq -r '.tabs[] | "\(.title) => \(.url)"'
Hacker News => https://news.ycombinator.com/
Lobsters => https://lobste.rs/