--- name: list-repos description: Lista todos los workspaces registrados con filtros y ordenamiento argument-hint: [--filter term] [--sort field] disable-model-invocation: true user-invocable: true allowed-tools: Bash, Read --- # list-repos Lista todos los workspaces registrados en la base de datos local. ## Sintaxis ```bash /list-repos /list-repos --filter /list-repos --sort # name o date /list-repos --filter etl --sort name ``` ## Prerequisitos - Feature flag `workspace_commands` habilitado - Base de datos SQLite inicializada ## Flujo ### 1. Verificar feature flag Si `workspace_commands.enabled: false`, informar y detener. ### 2. Parsear argumentos - `--filter `: filtrar por nombre/descripción (case-insensitive) - `--sort `: ordenar por `name` o `date` (default: date) ### 3. Ejecutar listado Usa `app.ListWorkspacesCommand(config, filter, sort)`: 1. Obtener workspaces de SQLite 2. Filtrar si hay `--filter` 3. Ordenar según `--sort` 4. Formatear tabla ASCII ### 4. Mostrar resultado ``` Workspaces locales (N repos): | Nombre | Descripción | Última act. | Estado | |--------|-------------|-------------|--------| | ... | ... | ... | activo | URLs Gitea: - repo1: https://... - repo2: https://... ``` ## Troubleshooting - "No hay workspaces": Usar `/create-repo` o `/sync-repos` - "Filtro no encuentra nada": Verificar término o listar sin filtro