codehome v0.2.2
On this page

codehome is a plugin runtime for developer tools, providing a CLI, server, event bus, state stores, check framework, and SDK for building extensible dev tool plugins.

#codehome

Plugin runtime for dev tools: server, auth, event bus, check framework, and SDK. Provides commands, API routes, checks, event handlers, and UI panels through a manifest-driven plugin system.

#API Reference

#codehome

#codehome.bus

Unified event bus: subscribe, filter, and broadcast events.

#fire

python
def fire(event: Event) -> Coroutine[Any, Any, list[FilterResult] | None]

Fire an event through the application bus (async).

#fire_sync

python
def fire_sync(event: Event) -> list[FilterResult] | None

Fire an event through the application bus (sync, for CLI).

#on

python
def on(event_name: str) -> Callable[[_F], _F]

Mark a function as an event subscriber (no-op at runtime).

The AST parser (v plugins rescan) discovers these decorators and writes events.toml. The decorator itself does nothing at import time.

#codehome.checks

Unified check framework: registry, runner, formatter.

The check framework provides a decorator-based registry for defining checks (lint, type-check, build verification, etc.), a concurrent runner with dependency-aware wave scheduling, and a terminal formatter for human-readable output.

Nothing in this package imports a concrete check definition. Check modules live elsewhere and register themselves via :func:register_check on import -- mirroring the step registration pattern in :mod:codehome.tests.framework.

#codehome.commands

Re-export stubs for commands that moved to plugins/core/commands/.

The _load_core_command helper searches config.toml plugin paths (and the ROOT/plugins fallback) for the named module inside plugins/core/commands/, so these stubs work whether the codehome package lives alongside the plugins or in a separate repository.

#_load_core_command

python
def _load_core_command(module_name: str, filename: str) -> ModuleType

Lazily load a core plugin command module by filename.

Results are cached so repeated calls return the same module object.

#codehome.conductor

#codehome.mcp

#codehome.plugins

Plugin framework: modular, manifest-driven extensions for the v CLI.

Plugins are self-contained packages that declare commands, checks, and dashboard integrations via a plugin.toml manifest. They integrate with the existing CLI and check systems but are managed independently.

Pipeline: discover -> merge state -> load -> register.

#codehome.serve

Local dev orchestration server — wesktop ASGI server and SSE events.

#_migrate_port_file

python
def _migrate_port_file() -> None

One-time migration: rename dashboard.port to server.port.

#_read_scheme

python
def _read_scheme() -> str

Read the scheme field from the port file, defaulting to 'http'.

#read_server_info_raw

python
def read_server_info_raw() -> tuple[int, int] | None

Read (port, pid) from the port file without liveness checking.

Returns None only if the file is missing or malformed. Used by v server stop / restart to find a zombie process whose port file is still on disk but whose HTTP /api/ping no longer responds.

#read_server_info

python
def read_server_info() -> tuple[int, int] | None

Read the running server's (port, pid) from the port file.

Returns (port, pid) if the server is running and responding, None otherwise. Verifies the server is actually alive via /api/ping so stale port files don't mislead callers.

#read_server_url

python
def read_server_url() -> str | None

Read the running server's URL from the port file.

Returns the full URL (scheme://host:port) if the server is running, None otherwise. The scheme is 'https' when the server was started with TLS certs, 'http' otherwise. Verifies the server is actually responding (not just a stale file).

#codehome.shared

#codehome.state

Plugin storage APIs -- Config (TOML), State (JSON), Files (opaque), Locks.