Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

llmwiki-cli

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

llmwiki-cli - npm Package Compare versions

Comparing version
0.2.1
to
0.2.2
+1
-1
package.json
{
"name": "llmwiki-cli",
"version": "0.2.1",
"version": "0.2.2",
"description": "CLI tool for LLM agents to build and maintain personal knowledge bases",

@@ -5,0 +5,0 @@ "repository": {

@@ -14,2 +14,4 @@ # llmwiki-cli

**[Live Demo](https://doum1004.github.io/llmwiki-cli/)** — interactive d3-force graph built from the example wiki in [`test-wiki-page/`](test-wiki-page/).
## Overview

@@ -90,4 +92,11 @@

├── .git/ # Only with --backend git
├── .github/ # Only with --backend git (--viz)
│ └── workflows/
│ └── wiki-viz.yml # GitHub Actions → GitHub Pages visualization
├── .gitignore # Only with --backend git (--viz)
├── .llmwiki.yaml # Wiki config (all backends)
├── SCHEMA.md # Instructions for LLM agents
├── scripts/ # Only with --backend git (--viz)
│ ├── build-graph.js # Builds graph.json from wikilinks
│ └── build-site.js # Generates d3-force visualization
├── raw/ # Immutable source documents

@@ -106,2 +115,10 @@ │ └── assets/ # Downloaded images

**Schema and init:** `wiki init --backend supabase` runs a quick check against `wiki_pages` (required columns, `upsert` on `user_id,wiki_id,path` with nullable `user_id`). If the table is missing or incompatible, the CLI prints **ready-to-run SQL** for PostgreSQL **15+** (`unique nulls not distinct` on `user_id, wiki_id, path`). Apply it in the Supabase SQL Editor, then run `wiki init` again. If initial seed writes still fail with a schema-style error, the same SQL is printed again as a hint.
**`user_id`:** Optional. `NULL` means a single shared partition (works well with the **service role** key for personal tooling). When set, the row is scoped to that auth user. The trigger fills `user_id` from `auth.uid()` when the client leaves it null and a user session exists.
**RLS and auth:** Policies allow the `authenticated` role to read and write rows where `user_id is null or auth.uid() = user_id`. Use the **anon** key in `.llmwiki.yaml` plus a **Supabase Auth access token** (JWT) per session: `LLMWIKI_SUPABASE_ACCESS_TOKEN`, or optional `supabase.access_token` in config (avoid committing secrets). The **service role** key bypasses RLS; do not rely on it for multi-tenant isolation. Older layouts (for example `(wiki_id, path)` only, or non-null `user_id` without the right unique constraint) need a migration or `drop table public.wiki_pages cascade` before applying the printed SQL.
**Storage profiles (all backends):** `wiki profile use <slug>`, `--profile`, `LLMWIKI_PROFILE`, or top-level `profile` in `.llmwiki.yaml` (legacy: `supabase.profile`). For **filesystem** and **git**, pages live under `profiles/<slug>/` inside the wiki repo. For **Supabase**, the same slug selects the composite `wiki_id`. This is organizational separation only, not OS or cryptographic isolation.
## Commands

@@ -113,5 +130,10 @@

wiki init [dir] --backend git --git-token <pat> [--git-repo owner/repo]
wiki init [dir] --backend git --no-viz # Skip visualization scaffolding
wiki init [dir] --backend supabase --supabase-url <url> --supabase-key <key>
wiki init [existing-wiki-dir] --viz # Add visualization to existing git wiki
wiki registry # List all wikis
wiki use [wiki-id] # Set active wiki
wiki profile show # Effective storage root / Supabase wiki_id
wiki profile use <slug> # Save profile in registry (all backends)
wiki profile clear # Remove saved profile
```

@@ -193,2 +215,22 @@

## Git backend and GitHub
- **New repo:** With `--git-token` and no `--git-repo`, the CLI creates **`wiki-<name>` as a public repository** (straightforward to try GitHub Pages). Use `--git-repo owner/existing` to target a repo you already manage.
- **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.
- **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`.
## Graph Visualization
Git-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.
- **Auto-scaffolded**: `wiki init --backend git` creates `.github/workflows/wiki-viz.yml` and `scripts/` build scripts by default
- **On every push**: GitHub Actions parses all `[[wikilinks]]`, builds a force-directed graph, and deploys to Pages
- **Interactive**: color-coded nodes by directory, zoom/pan, click-to-highlight connections, hover tooltips
- **Opt-out**: use `--no-viz` to skip visualization scaffolding
- **Add to existing wiki**: re-run `wiki init <dir> --viz` on an existing git wiki to add visualization files
After 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.
**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).
## Multi-Wiki Support

@@ -221,3 +263,3 @@

bun install
bun test # 210 tests
bun test # 194 tests
bun run build # bundle to dist/wiki.js

@@ -224,0 +266,0 @@ bun run dev -- --help

Sorry, the diff of this file is too big to display