rename group command to groups to have consistency into the cli
This commit is contained in:
@@ -122,7 +122,7 @@ browser-cli/
|
|||||||
|
|
||||||
All commands are run with `uv run browser-cli [--browser ALIAS] <command>`.
|
All commands are run with `uv run browser-cli [--browser ALIAS] <command>`.
|
||||||
|
|
||||||
If exactly one browser instance is connected, commands auto-target it. Use `--browser ALIAS` when multiple browser instances are connected. `tabs list`, `tabs count`, `group list`, `group count`, and `windows list` are the only commands that aggregate across all active browsers when `--browser` is omitted; in that mode they show the source browser alias or UUID. You can inspect the active instances with `browser-cli clients` and assign a persistent profile alias from inside the target browser with `browser-cli rename-profile --browser <current-alias> <new-alias>`. Closed browsers are removed from the client registry automatically.
|
If exactly one browser instance is connected, commands auto-target it. Use `--browser ALIAS` when multiple browser instances are connected. `tabs list`, `tabs count`, `groups list`, `groups count`, and `windows list` are the only commands that aggregate across all active browsers when `--browser` is omitted; in that mode they show the source browser alias or UUID. You can inspect the active instances with `browser-cli clients` and assign a persistent profile alias from inside the target browser with `browser-cli rename-profile --browser <current-alias> <new-alias>`. Closed browsers are removed from the client registry automatically.
|
||||||
|
|
||||||
Important: profile aliases are browser-instance aliases, not window aliases. Window aliases created with `windows rename` are only for targeting windows in commands like `nav open --window work`. If a browser instance has no explicit profile alias set, the native host gives it a generated UUID alias so multiple unaliased browsers stay distinct.
|
Important: profile aliases are browser-instance aliases, not window aliases. Window aliases created with `windows rename` are only for targeting windows in commands like `nav open --window work`. If a browser instance has no explicit profile alias set, the native host gives it a generated UUID alias so multiple unaliased browsers stay distinct.
|
||||||
|
|
||||||
@@ -203,19 +203,19 @@ browser-cli tabs merge-windows # pull all tabs into the current wi
|
|||||||
### Tab groups
|
### Tab groups
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
browser-cli group list # list all tab groups
|
browser-cli groups list # list all tab groups
|
||||||
browser-cli group count # count groups
|
browser-cli groups count # count groups
|
||||||
browser-cli group query "work" # search groups by name
|
browser-cli groups query "work" # search groups by name
|
||||||
browser-cli group tabs 42 # list tabs inside group ID 42
|
browser-cli groups tabs 42 # list tabs inside group ID 42
|
||||||
|
|
||||||
browser-cli group create "research" # create a new group
|
browser-cli groups create "research" # create a new group
|
||||||
browser-cli group add-tab research # open a blank tab in the group
|
browser-cli groups add-tab research # open a blank tab in the group
|
||||||
browser-cli group add-tab research https://example.com # open URL in the group
|
browser-cli groups add-tab research https://example.com # open URL in the group
|
||||||
browser-cli group add-tab 42 https://example.com # by group ID
|
browser-cli groups add-tab 42 https://example.com # by group ID
|
||||||
|
|
||||||
browser-cli group close 42 # ungroup the group
|
browser-cli groups close 42 # ungroup the group
|
||||||
browser-cli group move research --forward # move group right
|
browser-cli groups move research --forward # move group right
|
||||||
browser-cli group move 42 --backward # move group left
|
browser-cli groups move 42 --backward # move group left
|
||||||
```
|
```
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ def _print_groups(groups: list[dict], *, show_browser: bool = False) -> None:
|
|||||||
console.print(table)
|
console.print(table)
|
||||||
|
|
||||||
|
|
||||||
@click.group("group")
|
@click.group("groups")
|
||||||
def group_group():
|
def group_group():
|
||||||
"""Manage tab groups."""
|
"""Manage tab groups."""
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -162,7 +162,7 @@ def test_group_count_multi_browser_shows_total():
|
|||||||
BrowserTarget("work", "work", "/tmp/work.sock"),
|
BrowserTarget("work", "work", "/tmp/work.sock"),
|
||||||
],
|
],
|
||||||
), patch("browser_cli.commands.groups.send_command", side_effect=fake_send_command):
|
), patch("browser_cli.commands.groups.send_command", side_effect=fake_send_command):
|
||||||
result = CliRunner().invoke(main, ["group", "count"])
|
result = CliRunner().invoke(main, ["groups", "count"])
|
||||||
|
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
assert "Browser" in result.output
|
assert "Browser" in result.output
|
||||||
@@ -175,7 +175,7 @@ def test_group_list_leaves_unnamed_group_cell_empty():
|
|||||||
"browser_cli.commands.groups.send_command",
|
"browser_cli.commands.groups.send_command",
|
||||||
return_value=[{"id": 42, "title": "", "color": "grey", "collapsed": False, "tabCount": 1}],
|
return_value=[{"id": 42, "title": "", "color": "grey", "collapsed": False, "tabCount": 1}],
|
||||||
):
|
):
|
||||||
result = CliRunner().invoke(main, ["group", "list"])
|
result = CliRunner().invoke(main, ["groups", "list"])
|
||||||
|
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
assert "(unnamed)" not in result.output
|
assert "(unnamed)" not in result.output
|
||||||
|
|||||||
Reference in New Issue
Block a user