ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/aio-surfaces / aio_surfaces/cli.py

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/aio-surfaces / aio_surfaces/cli.py
DateNot specified in source
RepositoryJanady13/aio-surfaces
Revision4d0ef73ec42f209ff4947b559228f1884121ff8f
Branchmain
Path or archive memberaio_surfaces/cli.py
Original SHA-256d63f36d294a92a6d9583f0fbb164693eeff3d8864722366e221b0abd0f29b538
Git blob SHA5c4eca216dcccdd4251dde7ccd8cc947cb48decf
Reading-copy SHA-256d63f36d294a92a6d9583f0fbb164693eeff3d8864722366e221b0abd0f29b538

Original source ↗

Recovered source transcript

"""CLI: aio-surfaces generate <config.yaml> --out ./public/""" from __future__ import annotations import argparse import pathlib import sys from .config import SiteConfig from .render import ( render_aeo_json, render_brand_json, render_entity_json, render_llms_txt, render_robots_txt_aibots, ) def _load_config(path: pathlib.Path) -> SiteConfig: text = path.read_text() if path.suffix in (".yaml", ".yml"): try: import yaml except ImportError: sys.exit( "PyYAML required for YAML configs. " "`pip install aio-surfaces[yaml]` or use JSON." ) data = yaml.safe_load(text) else: import json data = json.loads(text) return SiteConfig.from_dict(data) def cmd_generate(args: argparse.Namespace) -> int: cfg = _load_config(pathlib.Path(args.config)) out = pathlib.Path(args.out) out.mkdir(parents=True, exist_ok=True) (out / "llms.txt").write_text(render_llms_txt(cfg)) (out / "aeo.json").write_text(render_aeo_json(cfg)) (out / "entity.json").write_text(render_entity_json(cfg)) (out / "brand.json").write_text(render_brand_json(cfg)) (out / "robots-aibots.txt").write_text(render_robots_txt_aibots(cfg)) print(f"wrote 5 surfaces to {out}/") return 0 def main(argv: list[str] | None = None) -> int: p = argparse.ArgumentParser( prog="aio-surfaces", description=( "Generate AI-citation surfaces (llms.txt, aeo.json, entity.json, " "brand.json) from a single site config." ), ) sub = p.add_subparsers(dest="cmd", required=True) g = sub.add_parser("generate", help="Generate all surfaces") g.add_argument("config", help="Path to YAML or JSON site config") g.add_argument( "--out", default="./public", help="Output directory (default: ./public)", ) g.set_defaults(func=cmd_generate) args = p.parse_args(argv) return args.func(args) if __name__ == "__main__": sys.exit(main())

Search equations, builds, manuscript text, and recovered sources.