Get project information.
(arguments: dict[str, Any], project_root: Path)
| 1568 | |
| 1569 | |
| 1570 | async def project_info(arguments: dict[str, Any], project_root: Path) -> CallToolResult: |
| 1571 | """Get project information.""" |
| 1572 | include_git = arguments.get("include_git_status", True) |
| 1573 | |
| 1574 | info: list[str] = [] |
| 1575 | |
| 1576 | # Basic project info |
| 1577 | info.append("FastLED Project Information") |
| 1578 | info.append("=" * 30) |
| 1579 | |
| 1580 | # Check if key files exist |
| 1581 | key_files = [ |
| 1582 | "library.json", |
| 1583 | "library.properties", |
| 1584 | "platformio.ini", |
| 1585 | "pyproject.toml", |
| 1586 | ] |
| 1587 | for file in key_files: |
| 1588 | file_path = project_root / file |
| 1589 | status = "✓" if file_path.exists() else "✗" |
| 1590 | info.append(f"{status} {file}") |
| 1591 | |
| 1592 | # Count examples |
| 1593 | examples_dir = project_root / "examples" |
| 1594 | if examples_dir.exists(): |
| 1595 | example_count = len( |
| 1596 | [ |
| 1597 | d |
| 1598 | for d in examples_dir.iterdir() |
| 1599 | if d.is_dir() and not d.name.startswith(".") |
| 1600 | ] |
| 1601 | ) |
| 1602 | info.append(f"📁 {example_count} examples available") |
| 1603 | |
| 1604 | # Git status |
| 1605 | if include_git: |
| 1606 | try: |
| 1607 | git_result = await run_command( |
| 1608 | ["git", "status", "--porcelain"], project_root |
| 1609 | ) |
| 1610 | if git_result.strip(): |
| 1611 | info.append( |
| 1612 | f"\n🔄 Git status: {len(git_result.strip().split())} files modified" |
| 1613 | ) |
| 1614 | else: |
| 1615 | info.append("\n[OK] Git status: Working tree clean") |
| 1616 | except Exception: |
| 1617 | info.append("\n❓ Git status: Unable to determine") |
| 1618 | |
| 1619 | return CallToolResult(content=[TextContent(type="text", text="\n".join(info))]) |
| 1620 | |
| 1621 | |
| 1622 | async def run_specific_command( |
no test coverage detected