bird-chinese-community/BIRD.skills / birdcc-installer
birdcc-installer
VerifiedInstall or migrate BIRD 2/3 editor support and @birdcc/cli. Use for the BIRD2 LSP VS Code extension, the separate TextMate syntax extension or extension pack, VS Code forks, BIRD.nvim, BIRD.vim, manual Neovim LSP wiring, JetBrains TextMate bundles, birdcc CLI installation, offline VSIX setup, or migrations from BIRD2.nvim/BIRD2.vim. Route config diagnostics to bird-agent and GitHub Actions to birdcc-cicd.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.5 KB |
| agents/openai.yaml | config | 585 B |
| assets/logo-small.png | binary | 2.9 KB |
| assets/logo.png | binary | 6.5 KB |
| evals/evals.json | config | 4.2 KB |
| metadata.json | config | 817 B |
| plugin.json | config | 509 B |
| references/cli.md | markdown | 1.6 KB |
| references/editors.md | markdown | 4.8 KB |
| references/offline.md | markdown | 1.5 KB |
| scripts/check_cli.py | script | 2.3 KB |
| scripts/detect_editor.py | script | 5.3 KB |
| scripts/detect_ide.py | script | 18.3 KB |
scripts/detect_ide.py
View on GitHub# /// script
# requires-python = ">=3.10"
# dependencies = []
# ///
"""Detect installed IDEs and generate marketplace-first onboarding data for birdcc."""
from __future__ import annotations
import argparse
import json
import os
import platform
import shlex
import shutil
import subprocess
import sys
from dataclasses import asdict, dataclass, field
from pathlib import Path
BIRD_VSCODE_EXTENSION_PACK_ID = "birdcc.bird2-extension-pack"
BIRD_VSCODE_LSP_EXTENSION_ID = "birdcc.bird2-lsp"
BIRD_VSCODE_SYNTAX_EXTENSION_ID = "birdcc.vscode-bird2-conf"
@dataclass(frozen=True)
class Product:
id: str
name: str
family: str
cli: tuple[str, ...]
marketplace: str
mac_apps: tuple[str, ...] = ()
win_dirs: tuple[str, ...] = ()
linux_desktop: tuple[str, ...] = ()
@dataclass
class Detection:
id: str
name: str
family: str
marketplace: str
found_by: str
executable: str | None = None
app_path: str | None = None
version: str | None = None
extension_status: str = "unknown"
install_command: list[str] | None = None
marketplace_hint: str | None = None
agent_message: str | None = None
notes: list[str] = field(default_factory=list)
PRODUCTS: tuple[Product, ...] = (
Product(
"vscode",
"Visual Studio Code",
"vscode-like",
("code",),
"Visual Studio Marketplace",
("Visual Studio Code.app",),
("Microsoft VS Code",),
("code.desktop", "visual-studio-code.desktop"),
),
Product(
"vscode-insiders",
"Visual Studio Code Insiders",
"vscode-like",
("code-insiders",),
"Visual Studio Marketplace",
("Visual Studio Code - Insiders.app",),
("Microsoft VS Code Insiders",),
("code-insiders.desktop",),
),
Product(
"vscodium",
"VSCodium",
"vscode-like",
("codium", "vscodium"),
"OpenVSX",
("VSCodium.app",),
("VSCodium",),
("codium.desktop", "vscodium.desktop"),
),
Product(
"code-oss",
"Code - OSS",
"vscode-like",
("code-oss",),
"OpenVSX",
("Code - OSS.app",),
("Code - OSS",),
("code-oss.desktop",),
),
Product(
"cursor",
"Cursor",
"vscode-like",
("cursor",),
"Cursor / VS Code-compatible extensions",
("Cursor.app",),
("Cursor",),
("cursor.desktop",),
),
Product(
"windsurf",
"Windsurf",
"vscode-like",
("windsurf",),
"OpenVSX",
("Windsurf.app",),
("Windsurf",),
("windsurf.desktop",),
),
Product(
"trae",
"Trae",
"vscode-like",
("trae",),
"VS Code-compatible extensions",
("Trae.app",),
("Trae",),
("trae.desktop",),
),
Product(
"kiro",
"Kiro",
"vscode-like",
("kiro",),
"OpenVSX",
("Kiro.app",),
("Kiro",),
("kiro.desktop",),
),
Product(
"code-server",
"code-server",
"vscode-like",
("code-server",),
"OpenVSX / configured extension gallery",
),
Product(
"openvscode-server",
"OpenVSCode Server",
"vscode-like",
("openvscode-server",),
"OpenVSX / configured extension gallery",
),
Product(
"idea",
"IntelliJ IDEA",
"jetbrains",
("idea", "idea.sh", "idea64.exe"),
"JetBrains Marketplace",
(
"IntelliJ IDEA.app",
"IntelliJ IDEA CE.app",
"IntelliJ IDEA Ultimate.app",
),
("JetBrains\\IntelliJ IDEA", "JetBrains\\IntelliJ IDEA Community Edition"),
),
Product(
"webstorm",
"WebStorm",
"jetbrains",
("webstorm", "webstorm.sh", "webstorm64.exe"),
"JetBrains Marketplace",
("WebStorm.app",),
("JetBrains\\WebStorm",),
),
Product(
"pycharm",
"PyCharm",
"jetbrains",
("pycharm", "pycharm.sh", "pycharm64.exe"),
"JetBrains Marketplace",
(
"PyCharm.app",
"PyCharm CE.app",
"PyCharm Professional.app",
),
("JetBrains\\PyCharm", "JetBrains\\PyCharm Community Edition"),
),
Product(
"goland",
"GoLand",
"jetbrains",
("goland", "goland.sh", "goland64.exe"),
"JetBrains Marketplace",
("GoLand.app",),
("JetBrains\\GoLand",),
),
Product(
"clion",
"CLion",
"jetbrains",
("clion", "clion.sh", "clion64.exe"),
"JetBrains Marketplace",
("CLion.app",),
("JetBrains\\CLion",),
),
)
def decode_output(data: bytes | None) -> str:
if data is None:
return ""
return data.decode("utf-8", errors="replace").strip()
def run(cmd: list[str], timeout: int = 8) -> tuple[int, str, str]:
try:
p = subprocess.run(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
timeout=timeout,
check=False,
)
return p.returncode, decode_output(p.stdout), decode_output(p.stderr)
except subprocess.TimeoutExpired as exc:
stdout = decode_output(exc.stdout)
stderr = decode_output(exc.stderr)
return 124, stdout, f"command timed out after {timeout}s: {stderr}".strip()
except Exception as exc:
return 127, "", str(exc)
def q(cmd: list[str]) -> str:
return subprocess.list2cmdline(cmd) if os.name == "nt" else " ".join(
shlex.quote(x) for x in cmd
)
def first_line(text: str) -> str | None:
for line in text.splitlines():
line = line.strip()
if line:
return line
return None
def path_cli(product: Product) -> tuple[str, str] | None:
for name in product.cli:
exe = shutil.which(name)
if exe:
return exe, "path"
return None
def mac_cli_or_app(product: Product) -> tuple[str | None, str | None, str] | None:
if platform.system() != "Darwin":
return None
for base in (Path("/Applications"), Path.home() / "Applications"):
for app_name in product.mac_apps:
app = base / app_name
if not app.exists():
continue
for cli_name in product.cli:
bundled = app / "Contents/Resources/app/bin" / cli_name
if bundled.exists():
return str(bundled), str(app), "macos-app-bundled-cli"
return None, str(app), "macos-app"
return None
def windows_cli(product: Product) -> tuple[str, str] | None:
if platform.system() != "Windows":
return None
roots = [
os.getenv("LOCALAPPDATA"),
os.getenv("APPDATA"),
os.getenv("ProgramFiles"),
os.getenv("ProgramFiles(x86)"),
]
suffixes = []
for cli in product.cli:
suffixes.extend((f"bin\\{cli}", f"resources\\app\\bin\\{cli}"))
for root in filter(None, roots):
for app_dir in product.win_dirs:
for suffix in suffixes:
candidate = Path(root) / app_dir / suffix
if candidate.exists():
return str(candidate), "windows-known-path"
return None
def linux_desktop(product: Product) -> tuple[str, str] | None:
if platform.system() not in {"Linux", "FreeBSD"}:
return None
bases = (
Path("/usr/share/applications"),
Path("/usr/local/share/applications"),
Path.home() / ".local/share/applications",
)
for base in bases:
for desktop_id in product.linux_desktop:
desktop = base / desktop_id
if desktop.exists():
return str(desktop), "linux-desktop-entry"
return None
def resolve(product: Product) -> tuple[str | None, str | None, str] | None:
if hit := path_cli(product):
return hit[0], None, hit[1]
if hit := mac_cli_or_app(product):
return hit
if hit := windows_cli(product):
return hit[0], None, hit[1]
if hit := linux_desktop(product):
return None, hit[0], hit[1]
return None
def list_vscode_extensions(exe: str) -> set[str] | None:
rc, out, _ = run([exe, "--list-extensions"], timeout=15)
if rc != 0:
return None
return {line.strip().lower() for line in out.splitlines() if line.strip()}
def supports_flag(exe: str, flag: str) -> bool:
rc, out, err = run([exe, "--help"], timeout=8)
return rc in {0, 1} and flag in f"{out}\n{err}"
def marketplace_hint(product: Product, vscode_ext: str) -> str:
if product.family == "jetbrains":
return (
"Import the BIRD TextMate bundle from the vscode-bird2-conf VSIX; "
"there is no verified native BIRD JetBrains plugin."
)
if product.marketplace == "Visual Studio Marketplace":
return f"Search/install in Visual Studio Marketplace: {vscode_ext}"
if "OpenVSX" in product.marketplace:
return f"Search/install in OpenVSX: {vscode_ext}"
return f"Search/install in the {product.name} extensions panel: {vscode_ext}"
def deep_link(product: Product, vscode_ext: str) -> str | None:
if product.family == "vscode-like":
return f"{product.id}:extension/{vscode_ext}"
return None
def agent_message(product: Product, status: str, vscode_ext: str) -> str:
prefix = f"Detected {product.name} is installed."
if status == "installed":
if vscode_ext == BIRD_VSCODE_EXTENSION_PACK_ID:
capabilities = (
"syntax highlighting, diagnostics, lint, formatting, and navigation"
)
elif vscode_ext == BIRD_VSCODE_LSP_EXTENSION_ID:
capabilities = "diagnostics, lint, formatting, and navigation"
elif vscode_ext == BIRD_VSCODE_SYNTAX_EXTENSION_ID:
capabilities = "syntax highlighting"
else:
capabilities = "the requested extension's features"
return prefix + f" The requested extension is installed, providing {capabilities}."
if product.family == "vscode-like":
if vscode_ext == BIRD_VSCODE_EXTENSION_PACK_ID:
recommendation = (
" Consider installing the BIRD extension pack for syntax highlighting, "
"diagnostics, formatting, completion, and navigation."
)
elif vscode_ext == BIRD_VSCODE_SYNTAX_EXTENSION_ID:
recommendation = (
" Consider installing the BIRD syntax extension for TextMate highlighting."
)
else:
recommendation = (
" Consider installing the BIRD LSP extension for diagnostics, formatting, "
"completion, and navigation."
)
return (
prefix
+ recommendation
)
return (
prefix
+ " Import the BIRD TextMate bundle for syntax highlighting. "
"Use birdcc from the terminal for diagnostics and formatting."
)
def detect(product: Product, vscode_ext: str) -> Detection | None:
resolved = resolve(product)
if not resolved:
return None
exe, app, found_by = resolved
item = Detection(
id=product.id,
name=product.name,
family=product.family,
marketplace=product.marketplace,
found_by=found_by,
executable=exe,
app_path=app,
)
if exe:
rc, out, err = run([exe, "--version"], timeout=6)
item.version = first_line(out) or first_line(err)
if product.family == "vscode-like":
if not exe:
item.extension_status = "unknown"
item.notes.append(
"Application detected, but no CLI was found. Guide the user to install the Shell Command or search for BIRD in the extensions panel."
)
else:
installed = list_vscode_extensions(exe)
if installed is not None:
item.extension_status = (
"installed" if vscode_ext.lower() in installed else "missing"
)
else:
item.extension_status = "unknown"
if supports_flag(exe, "--install-extension"):
item.install_command = [exe, "--install-extension", vscode_ext]
else:
item.notes.append(
"The CLI does not advertise --install-extension; guide the user to install via the IDE extensions panel."
)
elif product.family == "jetbrains":
item.extension_status = "manual"
item.notes.append(
"No verified native BIRD JetBrains plugin is published. "
"Guide the user to import the vscode-bird2-conf TextMate bundle."
)
item.marketplace_hint = marketplace_hint(product, vscode_ext)
item.agent_message = agent_message(product, item.extension_status, vscode_ext)
return item
def build_pretty_text(detections: list[Detection]) -> str:
if not detections:
return "No supported IDE detected."
lines: list[str] = []
for x in detections:
lines.append(f"\n{x.name} [{x.id}]")
lines.append(f" marketplace: {x.marketplace}")
lines.append(f" found_by: {x.found_by}")
lines.append(f" status: {x.extension_status}")
if x.version:
lines.append(f" version: {x.version}")
if x.executable:
lines.append(f" cli: {x.executable}")
if x.app_path:
lines.append(f" app: {x.app_path}")
if x.marketplace_hint:
lines.append(f" hint: {x.marketplace_hint}")
if x.install_command:
lines.append(f" install: {q(x.install_command)}")
if x.agent_message:
lines.append(f" agent: {x.agent_message}")
for note in x.notes:
lines.append(f" note: {note}")
return "\n".join(lines)
def build_ui_directives(detections: list[Detection], vscode_ext: str) -> dict:
buttons = []
for item in detections:
if item.extension_status == "installed":
continue
product = next((p for p in PRODUCTS if p.id == item.id), None)
if product is None:
continue
link = deep_link(product, vscode_ext)
if not link:
continue
buttons.append(
{
"ide_id": item.id,
"title": f"Open BIRD plugin in {item.name}",
"description": "Open the extension marketplace and jump to the BIRD extension",
"action_type": "open_url",
"url": link,
}
)
if vscode_ext == BIRD_VSCODE_EXTENSION_PACK_ID:
vscode_description = (
"VS Code-like editors can install the BIRD extension pack for syntax and LSP features"
)
elif vscode_ext == BIRD_VSCODE_SYNTAX_EXTENSION_ID:
vscode_description = (
"VS Code-like editors can install the BIRD TextMate syntax extension"
)
else:
vscode_description = "VS Code-like editors can install the BIRD LSP extension"
return {
"message": (
f"Detected your local development environment. {vscode_description}; "
"JetBrains users should import the TextMate bundle. "
"Would you like me to open an available extension page?"
),
"buttons": buttons,
}
def main(argv: list[str] | None = None) -> int:
p = argparse.ArgumentParser(
description="Detect installed VS Code-like and JetBrains IDEs for birdcc plugin onboarding."
)
p.add_argument("--vscode-extension", default=BIRD_VSCODE_EXTENSION_PACK_ID)
p.add_argument(
"--jetbrains-plugin",
default=None,
help="Deprecated compatibility option; JetBrains setup uses a manual TextMate import.",
)
p.add_argument(
"--install",
action="store_true",
help="Run install commands. Requires --confirmed after explicit user approval.",
)
p.add_argument(
"--confirmed",
action="store_true",
help="Confirm that the user explicitly approved running external install commands.",
)
p.add_argument("--pretty", action="store_true", help="Include human-readable text in the JSON output.")
args = p.parse_args(argv)
detections = [
item
for product in PRODUCTS
if (item := detect(product, args.vscode_extension))
]
install_results = []
if args.install:
if not args.confirmed:
install_results.append(
{
"error": "Install requires both --install and --confirmed. Please obtain explicit user approval before running external install commands.",
"skipped": True,
}
)
else:
for item in detections:
if item.extension_status == "installed" or not item.install_command:
continue
rc, out, err = run(item.install_command, timeout=120)
install_results.append(
{
"id": item.id,
"name": item.name,
"command": q(item.install_command),
"exit_code": rc,
"stdout": out[-3000:],
"stderr": err[-3000:],
}
)
payload = {
"purpose": "birdcc-ecosystem-onboarding",
"platform": {
"system": platform.system(),
"release": platform.release(),
"machine": platform.machine(),
},
"extensions": {
"vscode": args.vscode_extension,
"jetbrains": args.jetbrains_plugin,
},
"detected": [
{
**asdict(x),
"install_command_text": q(x.install_command) if x.install_command else None,
}
for x in detections
],
"agent_ui_directives": build_ui_directives(
detections, args.vscode_extension
),
"install_results": install_results,
"summary": {
"detected": len(detections),
"already_installed": sum(x.extension_status == "installed" for x in detections),
"actionable": sum(bool(x.install_command) for x in detections),
},
}
if args.pretty:
payload["pretty"] = build_pretty_text(detections)
json.dump(payload, sys.stdout, ensure_ascii=False, indent=2)
print()
return 0
if __name__ == "__main__":
raise SystemExit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |