{"id":48690521,"url":"https://github.com/doum1004/llmwiki-cli","last_synced_at":"2026-04-16T09:00:34.990Z","repository":{"id":350397063,"uuid":"1206611284","full_name":"doum1004/llmwiki-cli","owner":"doum1004","description":"CLI tool for LLM agents to build and maintain personal knowledge bases","archived":false,"fork":false,"pushed_at":"2026-04-13T04:18:45.000Z","size":280,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-14T07:04:32.453Z","etag":null,"topics":["ai-tools","cli","knowledge-base","llm","wiki"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/doum1004.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"ko_fi":"doum1004"}},"created_at":"2026-04-10T04:47:36.000Z","updated_at":"2026-04-13T10:04:09.000Z","dependencies_parsed_at":"2026-04-14T07:00:36.045Z","dependency_job_id":null,"html_url":"https://github.com/doum1004/llmwiki-cli","commit_stats":null,"previous_names":["doum1004/llmwiki-cli"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/doum1004/llmwiki-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doum1004%2Fllmwiki-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doum1004%2Fllmwiki-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doum1004%2Fllmwiki-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doum1004%2Fllmwiki-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doum1004","download_url":"https://codeload.github.com/doum1004/llmwiki-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doum1004%2Fllmwiki-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31831849,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T07:17:56.427Z","status":"ssl_error","status_checked_at":"2026-04-15T07:17:30.007Z","response_time":63,"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-tools","cli","knowledge-base","llm","wiki"],"created_at":"2026-04-11T05:16:10.492Z","updated_at":"2026-04-16T09:00:34.982Z","avatar_url":"https://github.com/doum1004.png","language":"TypeScript","funding_links":["https://ko-fi.com/doum1004"],"categories":[],"sub_categories":[],"readme":"# llmwiki-cli\n\n[![npm version](https://img.shields.io/npm/v/llmwiki-cli?style=flat-square\u0026color=cb3837\u0026logo=npm)](https://www.npmjs.com/package/llmwiki-cli)\n![total downloads](https://img.shields.io/npm/dt/llmwiki-cli)\n[![CI](https://img.shields.io/github/actions/workflow/status/doum1004/llmwiki-cli/ci.yml?branch=main\u0026style=flat-square\u0026label=CI\u0026logo=github)](https://github.com/doum1004/llmwiki-cli/actions/workflows/ci.yml)\n[![license](https://img.shields.io/npm/l/llmwiki-cli?style=flat-square\u0026color=blue)](./LICENSE)\n[![bun](https://img.shields.io/badge/built%20with-bun-f9f1e1?style=flat-square\u0026logo=bun)](https://bun.sh)\n[![ko-fi](https://img.shields.io/badge/donate-Ko--fi-FF5E5B?style=flat-square\u0026logo=ko-fi\u0026logoColor=white)](https://ko-fi.com/doum1004)\n\nA CLI tool for LLM agents to build and maintain personal knowledge bases.\n\nInspired by [Andrej Karpathy's LLM Wiki](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f).\n\n**[Live Demo](https://doum1004.github.io/llmwiki-cli/)** — interactive d3-force graph built from the example wiki in [`test-wiki-page/`](test-wiki-page/).\n\n## Overview\n\nThe CLI is the hands -- it reads, writes, searches, and manages wiki files. The LLM is the brain -- it decides what to create, update, and connect.\n\n```\nLLM Agent (Claude Code / Codex)\n|\n| shells out to:\n|   $ wiki init my-wiki --domain \"machine learning\"\n|   $ wiki write wiki/concepts/attention.md \u003c\u003c'EOF' ... EOF\n|   $ wiki index add \"concepts/attention.md\" \"Overview of attention\"\n|   $ wiki search \"scaling laws\"\n|   $ wiki lint\n|\nv\nwiki CLI (StorageProvider abstraction)\n|\nv\nfilesystem | git (auto-commit + auto-push)\n```\n\n**Key principle**: The CLI never calls any LLM API. It is a pure storage tool with pluggable backends.\n\n## Install\n\n```bash\nnpm install -g llmwiki-cli\n```\n\nThis gives you two commands: `wiki` (primary, 4 chars) and `llmwiki` (fallback if `wiki` conflicts).\n\n## Storage Backends\n\n| Backend | Description | Init |\n|---------|-------------|------|\n| `filesystem` (default) | Plain markdown files on disk | `wiki init my-wiki` |\n| `git` | Filesystem + auto-commit + auto-push to GitHub | `wiki init my-wiki --backend git --git-token \u003cpat\u003e` |\n\n## Quick Start\n\n```bash\n# Create a new wiki (filesystem backend, default)\nwiki init my-wiki --name \"My Notes\" --domain \"research\"\n\n# Or with git + GitHub sync\nwiki init my-wiki --name \"My Notes\" --domain \"research\" --backend git --git-token ghp_xxx\n\n# Write a page\nwiki write wiki/concepts/attention.md \u003c\u003c'EOF'\n---\ntitle: Attention Mechanism\ncreated: 2025-01-20\ntags: [transformers, NLP]\n---\nThe attention mechanism allows models to focus on relevant parts of the input.\nSee also [[transformers]] and [[self-attention]].\nEOF\n\n# Add to index and log\nwiki index add \"concepts/attention.md\" \"Overview of attention mechanisms\"\nwiki log append ingest \"Attention mechanism page\"\n\n# Search and lint\nwiki search \"attention\"\nwiki lint\n```\n\n## Wiki Structure\n\nWhen you run `wiki init` (filesystem or git backend), it creates:\n\n```\nmy-wiki/\n├── .git/                  # Only with --backend git\n├── .github/               # Only with --backend git (--viz)\n│   └── workflows/\n│       └── wiki-viz.yml   # GitHub Actions → GitHub Pages visualization\n├── .gitignore             # Only with --backend git (--viz)\n├── .llmwiki.yaml          # Wiki config (all backends)\n├── SCHEMA.md              # Instructions for LLM agents\n├── scripts/               # Only with --backend git (--viz)\n│   ├── build-graph.js     # Builds graph.json from wikilinks\n│   └── build-site.js      # Generates d3-force visualization\n├── raw/                   # Immutable source documents\n│   └── assets/            # Downloaded images\n└── wiki/                  # LLM-generated pages\n    ├── index.md           # Master index of all pages\n    ├── log.md             # Chronological activity log\n    ├── entities/          # People, orgs, products\n    ├── concepts/          # Ideas, frameworks, theories\n    ├── sources/           # One summary per ingested source\n    └── synthesis/         # Cross-cutting analysis\n```\n\n**Storage profiles:** `wiki profile use \u003cslug\u003e`, `--profile`, `LLMWIKI_PROFILE`, or top-level `profile` in `.llmwiki.yaml`. Pages live under `profiles/\u003cslug\u003e/` inside the wiki directory. This is organizational separation only, not OS or cryptographic isolation.\n\n## Commands\n\n### Wiki Management\n```bash\nwiki init [dir] --name \u003cname\u003e --domain \u003cdomain\u003e --backend \u003ctype\u003e\nwiki init [dir] --backend git --git-token \u003cpat\u003e [--git-repo owner/repo]\nwiki init [dir] --backend git --no-viz              # Skip visualization scaffolding\nwiki init [existing-wiki-dir] --viz                 # Add visualization to existing git wiki\nwiki registry                                       # List all wikis\nwiki use [wiki-id]                                  # Set active wiki\nwiki profile show                                   # Effective storage root and profile\nwiki profile use \u003cslug\u003e                             # Save profile in registry\nwiki profile clear                                  # Remove saved profile\n```\n\n### Reading \u0026 Writing\n```bash\nwiki read \u003cpath\u003e                                    # Print page to stdout\nwiki write \u003cpath\u003e                                   # Write stdin to page\nwiki append \u003cpath\u003e                                  # Append stdin to page\nwiki list [dir] [--tree] [--json]                   # List pages\nwiki search \u003cquery\u003e [--limit N] [--all] [--json]    # Search pages\n```\n\n### Index \u0026 Log\n```bash\nwiki index show                                     # Print master index\nwiki index add \u003cpath\u003e \u003csummary\u003e                     # Add entry to index\nwiki index remove \u003cpath\u003e                            # Remove entry\nwiki log show [--last N] [--type T]                 # Print log entries\nwiki log append \u003ctype\u003e \u003cmessage\u003e                    # Append log entry\n```\n\n### Health \u0026 Links\n```bash\nwiki lint [--json]                                  # Health check\nwiki links \u003cpath\u003e                                   # Outbound + inbound links\nwiki backlinks \u003cpath\u003e                               # Inbound links only\nwiki orphans                                        # Pages with no inbound links\nwiki status [--json]                                # Wiki overview stats\n```\n\n## LLM Agent Skill Guide\n\nRun `wiki skill` to print the full guide, or see [`docs/SKILL.md`](docs/SKILL.md) for the source. Covers workflows, command patterns, page format, and common gotchas for LLM agents.\n\n## How LLM Agents Use This\n\nThe generated `SCHEMA.md` in each wiki contains complete instructions. Here are the typical workflows:\n\n### Ingest a Source\n```bash\n# Save raw source\nwiki write raw/paper.md \u003c\u003c'EOF'\n\u003cpaste full text of paper\u003e\nEOF\n\n# Create structured summary\nwiki write wiki/sources/attention-paper.md \u003c\u003c'EOF'\n---\ntitle: Attention Is All You Need\ncreated: 2025-01-20\ntags: [transformers, attention, NLP]\nsource: https://arxiv.org/abs/1706.03762\n---\nSummary of the attention paper...\nLinks to [[transformers]] and [[self-attention]].\nEOF\n\n# Update bookkeeping\nwiki index add \"sources/attention-paper.md\" \"Attention Is All You Need (2017)\"\nwiki log append ingest \"Attention paper\"\n```\n\n### Answer a Question\n```bash\nwiki search \"attention mechanism\"\nwiki read wiki/concepts/attention.md\nwiki links wiki/concepts/attention.md    # see related pages\nwiki log append query \"How does multi-head attention work?\"\n```\n\n### Maintain Wiki Health\n```bash\nwiki lint                  # find broken links, orphans, missing frontmatter\nwiki orphans               # pages nobody links to\nwiki status                # overview stats\n```\n\n## Git backend and GitHub\n\n- **New repo:** With `--git-token` and no `--git-repo`, the CLI creates **`wiki-\u003cname\u003e` as a public repository** (straightforward to try GitHub Pages). Use `--git-repo owner/existing` to target a repo you already manage.\n- **Token not committed:** `.llmwiki.yaml` stores **`git.repo` only**, not your PAT, so GitHub’s push secret scanning does not reject commits. For **`wiki write` / `wiki append`** (auto-push), set **`LLMWIKI_GIT_TOKEN`**, **`GITHUB_TOKEN`**, or **`GIT_TOKEN`** in your environment.\n- **PAT permissions:** The token must be allowed to update **GitHub Actions workflow** files (classic PAT: include the **`workflow`** scope; fine-grained: grant workflow/Actions write). Otherwise the first push after init can fail on `.github/workflows/wiki-viz.yml`.\n\n## Graph Visualization\n\nGit-backend wikis automatically include a GitHub Actions workflow that builds an interactive d3-force graph visualization of your wiki's link structure and deploys it to GitHub Pages.\n\n- **Auto-scaffolded**: `wiki init --backend git` creates `.github/workflows/wiki-viz.yml` and `scripts/` build scripts by default\n- **On every push**: GitHub Actions parses all `[[wikilinks]]`, builds a force-directed graph, and deploys to Pages\n- **Interactive**: color-coded nodes by directory, zoom/pan, click-to-highlight connections, hover tooltips\n- **Opt-out**: use `--no-viz` to skip visualization scaffolding\n- **Add to existing wiki**: re-run `wiki init \u003cdir\u003e --viz` on an existing git wiki to add visualization files\n\nAfter a successful first push, init also tries to enable **GitHub Pages** (build: GitHub Actions). You can still configure it under **Settings → Pages → Source: GitHub Actions** if needed.\n\n**Branch name:** New git wikis rename the default branch to **`main`** before the first push so the **`github-pages`** Actions environment (which often only allows `main`) accepts deployment. If you see *“Branch master is not allowed to deploy to github-pages”*, rename locally with `git branch -M main`, push `main`, and under **Settings → General** set the **default branch** to `main` (and optionally delete the old `master` branch on GitHub).\n\n## Multi-Wiki Support\n\nThe CLI supports multiple wikis via a global registry at `~/.config/llmwiki/`:\n\n```bash\nwiki init ~/wikis/ml --name ml --domain \"machine learning\"\nwiki init ~/wikis/personal --name personal --domain \"personal notes\"\nwiki registry        # lists both\nwiki use ml          # switch active wiki\nwiki --wiki personal read wiki/index.md   # target specific wiki\nwiki search \"neural networks\" --all       # search across all wikis\n```\n\n**Wiki resolution order**: `--wiki` flag \u003e cwd `.llmwiki.yaml` \u003e walk up directories \u003e registry default.\n\n## Requirements\n\n- Node.js \u003e= 18 (or Bun)\n- Git (for `--backend git` only)\n\n## Development\n\n```bash\ngit clone https://github.com/doum1004/llmwiki-cli\ncd llmwiki-cli\nbun install\nbun test            # 194 tests\nbun run build       # bundle to dist/wiki.js\nbun run dev -- --help\n```\n\n## DATA\n\n![Visitors](https://visitor-badge.laobi.icu/badge?page_id=doum1004.llmwiki-cli)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoum1004%2Fllmwiki-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoum1004%2Fllmwiki-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoum1004%2Fllmwiki-cli/lists"}