{"id":49539589,"url":"https://github.com/denissvgn/python-wiki-llm","last_synced_at":"2026-05-07T00:01:38.287Z","repository":{"id":350661666,"uuid":"1207765060","full_name":"Denissvgn/python-wiki-llm","owner":"Denissvgn","description":"LLM Wiki CLI keeps codebase docs in sync by extracting architecture from source and guiding AI agents to maintain a living project wiki automatically.","archived":false,"fork":false,"pushed_at":"2026-04-27T21:18:35.000Z","size":2515,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-27T21:25:35.642Z","etag":null,"topics":["ai-agents","automation","cli","code-analysis","developer-tools","documentation","llm","wiki"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Denissvgn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-11T11:21:01.000Z","updated_at":"2026-04-27T21:18:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Denissvgn/python-wiki-llm","commit_stats":null,"previous_names":["denissvgn/python_wiki_llm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Denissvgn/python-wiki-llm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Denissvgn%2Fpython-wiki-llm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Denissvgn%2Fpython-wiki-llm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Denissvgn%2Fpython-wiki-llm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Denissvgn%2Fpython-wiki-llm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Denissvgn","download_url":"https://codeload.github.com/Denissvgn/python-wiki-llm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Denissvgn%2Fpython-wiki-llm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32536582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T12:25:33.646Z","status":"ssl_error","status_checked_at":"2026-05-02T12:24:51.733Z","response_time":132,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","automation","cli","code-analysis","developer-tools","documentation","llm","wiki"],"created_at":"2026-05-02T14:02:25.282Z","updated_at":"2026-05-07T00:01:38.280Z","avatar_url":"https://github.com/Denissvgn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LLM Wiki CLI\n\nLLM Wiki CLI builds and maintains a repo-local architectural wiki for coding\nagents. It scans source code into a compact structural inventory, generates\nMarkdown pages under a wiki directory, validates those pages against the live\ncodebase, and prepares or triggers wiki-sync prompts after commits.\n\nThe PyPI distribution is `agent-wiki-cli`. The installed console command remains\n`llm-wiki`, and the Python import package remains `llm_wiki_cli`.\n\n## What It Creates\n\nThe default wiki lives at `docs/llm_wiki/` and contains:\n\n- `index.md`: table of contents for generated pages.\n- `log.md`: append-only architectural change log.\n- `entities/`: class, struct, interface, and type pages.\n- `modules/`: source-file pages.\n- `workflows/`: detected or manually maintained cross-module flow pages.\n- `infrastructure/`: Dockerfile and Compose pages.\n- `.llm-wiki-manifest.json`: source hash manifest used by incremental sync and strict linting.\n\nThe package has no required Python runtime dependencies. Optional features use\nexternal tools when they are available on `PATH`.\n\n## Supported Inputs\n\n| Area | Implementation | Runtime requirement |\n|---|---|---|\n| Python | stdlib `ast` | Python 3.9+ |\n| TypeScript / TSX | bundled Node script using `ts-morph` | Node.js and npm |\n| Go | bundled Go extractor using `go/ast` | Go toolchain |\n| Rust | bundled Rust extractor using `syn` | Cargo / Rust toolchain |\n| Docker / Compose | built-in parsers | none |\n| MCP server | official Python MCP SDK | `agent-wiki-cli[mcp]`, Python 3.10+ |\n\nTypeScript, Go, and Rust extras are metadata-only; the actual toolchains must be\ninstalled separately. The TypeScript extractor runs `npm install` in its bundled\nextractor directory on first use if `node_modules` is missing.\n\n## Agent Support\n\n| Agent | Schema file | Sync mode |\n|---|---|---|\n| `claude` | `CLAUDE.md` | headless CLI |\n| `aider` | `.aider.conf.yml` | headless CLI |\n| `opencode` | `.opencode/instructions.md` | headless CLI |\n| `copilot` | `.github/copilot-instructions.md` | IDE prompt |\n| `cursor` | `.cursorrules` | IDE prompt |\n| `generic` | `AGENTS.md` | IDE prompt |\n\nHeadless sync delegates to the selected CLI agent. For Claude, this currently\nuses `claude -p --dangerously-skip-permissions`, so enable automation only in an\nenvironment where that is acceptable.\n\n## Installation\n\nFrom PyPI:\n\n```bash\npip install agent-wiki-cli\n```\n\nWith MCP server support:\n\n```bash\npip install \"agent-wiki-cli[mcp]\"\n```\n\nFrom source:\n\n```bash\ngit clone https://github.com/Denissvgn/python-wiki-llm.git\ncd python-wiki-llm\npip install -e \".[dev]\"\n```\n\nThe following extras are accepted for compatibility with documented workflows,\nbut they do not install the external TypeScript, Go, or Rust toolchains:\n\n```bash\npip install \"agent-wiki-cli[typescript,go,rust]\"\n```\n\nUninstall the Python package with:\n\n```bash\npip uninstall agent-wiki-cli\n```\n\n## Quick Start\n\nInitialize the wiki structure and the agent instruction file:\n\n```bash\nllm-wiki init --agent claude\n```\n\nGenerate the initial wiki from an existing codebase:\n\n```bash\nllm-wiki bootstrap --src-dir . --wiki-dir docs/llm_wiki\n```\n\nValidate the wiki:\n\n```bash\nllm-wiki lint --wiki-dir docs/llm_wiki --src-dir .\n```\n\nInstall a post-commit hook:\n\n```bash\nllm-wiki install-hook\n```\n\n`init` writes the selected agent and quality-hint setting to\n`.git/.llm-wiki-agent` when the project is a Git repo. Outside Git, it falls\nback to `\u003cwiki-dir\u003e/.llm-wiki-agent`.\n\n## Automation\n\n`llm-wiki install-hook` installs a `post-commit` hook. The hook mode depends on\nthe configured agent.\n\nFor CLI agents (`claude`, `aider`, `opencode`), the hook starts:\n\n```bash\nllm-wiki trigger-agent --agent \u003cagent\u003e\n```\n\nThe trigger command:\n\n- takes `git diff HEAD~1..HEAD`;\n- skips empty diffs and oversized diffs unless `--force` is used;\n- uses a lock file to prevent concurrent syncs;\n- opens a circuit breaker after repeated failures;\n- builds deep source inventory and call-graph context;\n- writes `.git/llm-wiki-prompt.txt` with owner-only permissions where supported;\n- invokes the selected agent with a prompt that asks it to update, lint, and commit wiki changes.\n\nUseful trigger options:\n\n```bash\nllm-wiki trigger-agent --agent claude --timeout 600 --max-diff-lines 2000\nllm-wiki trigger-agent --agent claude --max-prompt-bytes 2000000\nllm-wiki trigger-agent --agent claude --force\nllm-wiki trigger-agent --reset-breaker\n```\n\nFor IDE agents (`copilot`, `cursor`, `generic`), the hook generates\n`.git/llm-wiki-prompt.txt` with `llm-wiki generate-prompt` and prints a reminder\nto paste that prompt into the IDE chat.\n\nOptional strict pre-commit validation:\n\n```bash\nllm-wiki install-hook --enable-validation\n```\n\nUse `--force` when you intentionally want to replace an existing unrelated hook:\n\n```bash\nllm-wiki install-hook --force\n```\n\n## Command Reference\n\n### `init`\n\nScaffold the wiki structure and agent constraint file.\n\n```bash\nllm-wiki init --agent claude\nllm-wiki init --agent copilot --wiki-dir .wiki\nllm-wiki init --agent cursor --no-quality-hints\n```\n\nSupported agents are `claude`, `aider`, `opencode`, `copilot`, `cursor`, and\n`generic`.\n\n### `bootstrap`\n\nGenerate a full wiki for an existing project.\n\n```bash\nllm-wiki bootstrap --src-dir . --wiki-dir docs/llm_wiki\nllm-wiki bootstrap --overwrite\nllm-wiki bootstrap --depth shallow\nllm-wiki bootstrap --skip-workflows\n```\n\n`bootstrap` writes entity, module, workflow, infrastructure, index, log, and\nmanifest files. `--depth full` is the default and includes docstrings, imports,\nattributes, method signatures, and relationship data where extractors provide\nit.\n\n### `sync`\n\nIncrementally regenerate only pages whose source files changed since the last\nmanifest.\n\n```bash\nllm-wiki sync --src-dir . --wiki-dir docs/llm_wiki\n```\n\nIf an older wiki has `index.md` but no manifest, `sync` seeds\n`.llm-wiki-manifest.json` without modifying pages. If neither a manifest nor an\nexisting wiki is present, run `bootstrap` first.\n\n### `extract`\n\nPrint source inventory as JSON. All registered extractors run; missing optional\ntoolchains are skipped when there are no matching source files.\n\n```bash\nllm-wiki extract --src-dir .\nllm-wiki extract --src-dir . --changed\nllm-wiki extract --src-dir . --summary\nllm-wiki extract --src-dir . --deep\nllm-wiki extract --src-dir . --paths src/foo.py src/bar.ts\nllm-wiki extract --src-dir . --package llm_wiki_cli\nllm-wiki extract --src-dir . --include-empty\n```\n\n### `lint` and `ci-check`\n\nValidate wiki links, orphan pages, entities, modules, workflows,\ninfrastructure, plugin lint rules, and team policy.\n\n```bash\nllm-wiki lint --wiki-dir docs/llm_wiki --src-dir .\nllm-wiki lint --strict --wiki-dir docs/llm_wiki --src-dir .\n```\n\nStrict mode also requires the core wiki structure and a fresh sync manifest.\n\nFor CI:\n\n```bash\nllm-wiki ci-check --src-dir . --wiki-dir docs/llm_wiki\nllm-wiki ci-check --format json --report .git/llm-wiki-ci-report.md\nllm-wiki ci-check --format markdown\n```\n\n`ci-check` always runs strict validation, writes a Markdown report, records a\nlocal metrics event, and exits nonzero on validation failure.\n\n### `context`\n\nBuild a token-budgeted source snapshot for agents.\n\n```bash\nllm-wiki context --budget 8000 --src-dir . --format json\nllm-wiki context --budget 8000 --src-dir . --format markdown\nllm-wiki context --budget 8000 --focus changed\nllm-wiki context --budget 8000 --focus all\n```\n\n`--focus changed` is the default. Changed files get full detail, one-hop import\nneighbors get slim detail, and remaining files get names only.\n\nExternal tools can use the `llm-wiki-context/v1` JSON request protocol:\n\n```bash\nllm-wiki context --request request.json --src-dir .\ncat request.json | llm-wiki context --request - --src-dir .\n```\n\nExample request:\n\n```json\n{\n  \"protocol\": \"llm-wiki-context/v1\",\n  \"budget_tokens\": 8000,\n  \"focus\": [\"changed\", \"neighbors\"],\n  \"format\": \"json\",\n  \"filters\": {\n    \"language\": \"python\"\n  }\n}\n```\n\n### `generate-prompt`\n\nBuild a sync prompt for IDE agents or for manual review.\n\n```bash\nllm-wiki generate-prompt\nllm-wiki generate-prompt --print\nllm-wiki generate-prompt --change-type feature\nllm-wiki generate-prompt --template compact\n```\n\nThe generated prompt includes change-type guidance. Installed prompt templates\ncan override the default prompt body.\n\n### `mcp`\n\nRun a local MCP server exposing read-only wiki tools and resources.\n\n```bash\nllm-wiki mcp --wiki-dir docs/llm_wiki --src-dir .\nllm-wiki mcp --transport http --host 127.0.0.1 --port 8765\n```\n\nThe MCP server exposes wiki search, entity/module fetches, context payloads,\nlint summaries, and status information. HTTP mode is intended for local use and\ndefaults to loopback.\n\n### `install` and `plugins`\n\nInstall and manage local plugins.\n\n```bash\nllm-wiki install ./vendor/my-plugin --yes\nllm-wiki install my-catalog-plugin --dry-run\nllm-wiki plugins list\nllm-wiki plugins validate ./vendor/my-plugin\nllm-wiki plugins remove my-plugin\n```\n\nPlugin manifests can register extractors, prompt templates, lint rules, and\nagent skill blocks. Plugin references are resolved from project-local paths or\n`.llm-wiki/catalog.json`.\n\n### `team`\n\nManage shared team policy for prompt defaults, required plugin components, and\ngenerated-wiki conflict handling.\n\n```bash\nllm-wiki team init --wiki-dir docs/llm_wiki\nllm-wiki team check --src-dir . --wiki-dir docs/llm_wiki\nllm-wiki team resolve-conflicts --wiki-dir docs/llm_wiki\nllm-wiki team resolve-conflicts --write --wiki-dir docs/llm_wiki\n```\n\n`resolve-conflicts` only applies conservative resolutions for generated pages.\nManual workflow conflicts are left for humans to resolve.\n\n### `obsidian`\n\nExport and validate an Obsidian-friendly mirror of the canonical wiki.\n\n```bash\nllm-wiki obsidian export --wiki-dir docs/llm_wiki --vault-dir ~/Vaults/project\nllm-wiki obsidian check --wiki-dir docs/llm_wiki --vault-dir ~/Vaults/project\nllm-wiki obsidian install-plugin --vault-dir ~/Vaults/project\n```\n\nThe mirror adds frontmatter, wikilinks, related links, and sidecar human notes.\nThe canonical source of truth remains `docs/llm_wiki/`.\n\n### `metrics`\n\nShow local quality and automation metrics.\n\n```bash\nllm-wiki metrics --last 30d\nllm-wiki metrics --format json\n```\n\nMetrics are stored locally under `.git/llm-wiki-metrics.jsonl` when available.\n\n### `review`\n\nRun a static wiki-aware review of proposed code changes.\n\n```bash\nllm-wiki review --base main --head HEAD\nllm-wiki review --patch change.patch --format json\n```\n\nThe review command compares code changes with wiki coverage and reports stale or\nmissing documentation risks.\n\n### `upgrade`\n\nRefresh framework-managed artifacts in place.\n\n```bash\nllm-wiki upgrade\nllm-wiki upgrade --agent copilot\nllm-wiki upgrade --force\nllm-wiki upgrade --no-quality-hints\n```\n\n`upgrade` refreshes agent instruction blocks, wiki directories, hooks, plugin\nskill blocks, and persisted local config.\n\n### `migrate`\n\nReconcile older wiki layouts with current canonical names.\n\n```bash\nllm-wiki migrate --dry-run\nllm-wiki migrate --chunk-size 50 --plan-chunks\nllm-wiki migrate --chunk-size 50 --chunk 1\n```\n\n### `status`, `release`, `bump`, and `uninstall`\n\n```bash\nllm-wiki status\nllm-wiki release --stage\nllm-wiki bump --patch --stage\nllm-wiki uninstall --dry-run\nllm-wiki uninstall --remove-wiki\n```\n\n`uninstall` removes project integration artifacts. It does not uninstall the\nCLI itself. To remove the Python package, run `pip uninstall agent-wiki-cli`.\n\n## Security Model\n\nLLM Wiki is a local automation tool. It can generate prompt files containing\ndiffs, source structure, and architectural context. Prompt files are written\ninside `.git/` by default and use owner-only permissions where the platform\nsupports that mode.\n\nHeadless CLI agents can edit files and run commands according to their own\npermission model. Review generated wiki diffs before trusting unattended\nautomation in a shared repository.\n\nThe repository includes community health files:\n\n- `CODE_OF_CONDUCT.md`\n- `SECURITY.md`\n- GitHub issue templates\n\n## Development\n\nRun tests from the repository root:\n\n```bash\npip install -e \".[dev]\"\npython -m pytest\n```\n\nRun the MCP tests with the optional dependency installed:\n\n```bash\npip install -e \".[dev,mcp]\"\npython -m pytest tests/test_mcp.py\n```\n\nBefore release, check metadata and docs:\n\n```bash\npython -m pytest tests/test_package_metadata.py\npython -m build\n```\n\n## Contribution Policy\n\nThis project does not maintain a formal contribution process. You are welcome to\nfreely fork it, adapt it to your workflow, and publish your own changes under\nthe license terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenissvgn%2Fpython-wiki-llm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenissvgn%2Fpython-wiki-llm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenissvgn%2Fpython-wiki-llm/lists"}