Files
AirCoding/AirPlan/docs/spec/AirPlan-ParaV2/AirContextServer/scripts/cmd_init.py
AirCoding ae44be31d5 chore: push all design docs, V2 plan specs, and current working state
Includes AirPlan design documents, AircOding-alpha1-plan, AirPlanV2,
AirPlan-ParaV2, AirPlan-Para V1 reference docs, and all working code
changes across packages.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-12 17:12:29 +08:00

31 lines
968 B
Python
Executable File

#!/usr/bin/env python3
"""Backend for /aircontext-init."""
from __future__ import annotations
import os
import sys
from pathlib import Path
_HERE = Path(__file__).resolve().parent
sys.path.insert(0, str(_HERE))
from core.config_loader import ensure_aircontext_dir, validate_config # noqa: E402
def main() -> int:
plugin_root = Path(os.environ.get("CLAUDE_PLUGIN_ROOT", _HERE.parent))
project = Path(os.environ.get("CLAUDE_PROJECT_DIR", os.getcwd()))
air = project / "AirContext"
created = ensure_aircontext_dir(air, plugin_root=plugin_root)
print(f"AirContext directory: {air}")
print("Templates installed." if created else "Templates already present (no overwrite).")
err = validate_config(air / "config.yaml")
if err:
print(f"Config status: needs attention — {err}")
else:
print("Config status: OK (compaction will activate on next session).")
return 0
if __name__ == "__main__":
sys.exit(main())