MCPcopy Index your code
hub / github.com/github/spec-kit / list_installed

Method list_installed

src/specify_cli/extensions/__init__.py:1820–1866  ·  view source on GitHub ↗

List all installed extensions with metadata. Returns: List of extension metadata dictionaries

(self)

Source from the content-addressed store, hash-verified

1818 continue
1819
1820 def list_installed(self) -> List[Dict[str, Any]]:
1821 """List all installed extensions with metadata.
1822
1823 Returns:
1824 List of extension metadata dictionaries
1825 """
1826 result = []
1827
1828 for ext_id, metadata in self.registry.list().items():
1829 # Ensure metadata is a dictionary to avoid AttributeError when using .get()
1830 if not isinstance(metadata, dict):
1831 metadata = {}
1832 ext_dir = self.extensions_dir / ext_id
1833 manifest_path = ext_dir / "extension.yml"
1834
1835 try:
1836 manifest = ExtensionManifest(manifest_path)
1837 result.append(
1838 {
1839 "id": ext_id,
1840 "name": manifest.name,
1841 "version": metadata.get("version", "unknown"),
1842 "description": manifest.description,
1843 "enabled": metadata.get("enabled", True),
1844 "priority": normalize_priority(metadata.get("priority")),
1845 "installed_at": metadata.get("installed_at"),
1846 "command_count": len(manifest.commands),
1847 "hook_count": len(manifest.hooks),
1848 }
1849 )
1850 except ValidationError:
1851 # Corrupted extension
1852 result.append(
1853 {
1854 "id": ext_id,
1855 "name": ext_id,
1856 "version": metadata.get("version", "unknown"),
1857 "description": "⚠️ Corrupted extension",
1858 "enabled": False,
1859 "priority": normalize_priority(metadata.get("priority")),
1860 "installed_at": metadata.get("installed_at"),
1861 "command_count": 0,
1862 "hook_count": 0,
1863 }
1864 )
1865
1866 return result
1867
1868 def get_extension(self, extension_id: str) -> Optional[ExtensionManifest]:
1869 """Get manifest for an installed extension.

Callers 12

extension_listFunction · 0.95
extension_removeFunction · 0.95
extension_infoFunction · 0.95
extension_updateFunction · 0.95
extension_enableFunction · 0.95
extension_disableFunction · 0.95
extension_set_priorityFunction · 0.95
test_list_installedMethod · 0.95

Calls 4

ExtensionManifestClass · 0.85
normalize_priorityFunction · 0.85
listMethod · 0.45
getMethod · 0.45