Files
bot-bottle/claude_bottle/cli/list.py
T
didericis 47b882f634
test / run tests/run_tests.py (pull_request) Successful in 14s
refactor(bottles): move 'list active' onto DockerBottlePlatform
Add list_active() abstract method on BottlePlatform; DockerBottlePlatform
implements it with the existing docker ps logic. cli/list.py no longer
calls docker directly — it just dispatches the active branch to the
platform.
2026-05-10 23:19:22 -04:00

25 lines
651 B
Python

"""list: list available agents or active bottles."""
from __future__ import annotations
import argparse
from ..bottles import get_bottle_platform
from ..manifest import Manifest
from ._common import PROG, USER_CWD
def cmd_list(argv: list[str]) -> int:
parser = argparse.ArgumentParser(prog=f"{PROG} list", add_help=True)
parser.add_argument("scope", choices=["available", "active"])
args = parser.parse_args(argv)
if args.scope == "available":
manifest = Manifest.resolve(USER_CWD)
for name in manifest.agents.keys():
print(name)
return 0
get_bottle_platform().list_active()
return 0