zxfccmm4/Obsidian-OpenCode-Knowledge
About
ð§ AI ç¥è¯åºäžé®éšçœ²æš¡æ¿ | Obsidian + OpenCode 驱åšçæ¬å°ç¥è¯ç®¡çæ¹æ¡
AI & Machine LearningMeasured star growth
- in 24h
- +1
- in 7 days
- +1
- in 15 days
- +2
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.en.md
Originalð§ Obsidian + AI Agent Knowledge Base
A local AI knowledge management solution for non-technical users. Supports OpenCode / Claude Code / Codex. No coding required, one-click deployment, ready to use out of the box.
Note: This project was originally designed for Chinese users, but international users are welcome! The interface and documentation can be adapted for English usage.
âš Key Features
| Feature | Description |
|---|---|
| ð¥ Auto Ingest | Drop articles, PDFs, screenshots to AI, automatically organized into structured notes |
| ð± Social Media Collection | Xiaohongshu, Douyin, Twitter, Weibo and more â auto-classify, analyze, and digest into knowledge (powered by OpenCLI) |
| ð Smart Query | Chat with AI: "Have I written about XX before?" |
| ð¥ Regular Health Check | AI automatically checks knowledge base health, finds broken links, duplicates, orphaned pages |
| ð Local Storage | Your note files stay on your computer; when you use AI, content is sent to your configured model provider |
| ð ïž One-Click Deploy | Run the script, setup completes in 5 minutes |
ð Quick Start
ð Platform support: The one-click script currently supports macOS only (it relies on
open, Homebrew, etc.). Linux users can runsetup.shmanually after replacingopenwithxdg-open; Windows users should use WSL2.
Option 1: Let AI Deploy for You (Zero Effort)
Send this message to any AI assistant (ChatGPT, Claude, GLM, etc.) and it will handle the entire deployment automatically:
Deploy an AI knowledge base for me: https://github.com/zxfccmm4/Obsidian-OpenCode-Knowledge/blob/main/GUIDE_FOR_AI.md
ð The AI assistant will read
GUIDE_FOR_AI.mdfor the complete deployment procedure, including environment checks, installation, and configuration.
Option 2: Manual Installation (3 Steps)
# Step 1: Clone the repository
git clone https://github.com/zxfccmm4/Obsidian-OpenCode-Knowledge.git
cd Obsidian-OpenCode-Knowledge
# Step 2: Run the setup script (macOS)
bash setup.sh
# Step 3: Open the generated "My Knowledge Base" folder in Obsidian
ð For detailed steps, see
deployment-guide.md(Chinese deployment guide)
Choose an AI Agent
The knowledge base supports four AI agents. Pick one with --agent during deployment (default: opencode):
| Agent | Obsidian Plugin | Best For |
|---|---|---|
| OpenCode â (default) | â claudian (default) / opencode-obsidian | Native 6 providers, best experience |
| Claude Code | â claudian | Anthropic ecosystem, strong reasoning |
| Codex | â claudian | OpenAI ecosystem |
| Pi | â claudian | Open-source lightweight, 15+ providers |
bash setup.sh --agent opencode # default, recommended for most users
bash setup.sh --agent claude-code # Claude Code
bash setup.sh --agent codex # OpenAI Codex
bash setup.sh --agent pi # Pi (open-source lightweight)
Obsidian plugin: defaults to claudian (supports all four agents). OpenCode can also use
--plugin opencode-obsidianto switch to the native serve mode. ð For a detailed comparison and selection guide, seedocs/agents.md
Start With a Read-Only Check
If you do not want to install anything yet, or you just want to verify the repo and local environment first, run:
bash scripts/verify.sh
What setup.sh Does
The setup script handles everything automatically:
- Choose AI Agent â pick one of opencode / claude-code / codex (default: opencode)
- Checks Node.js â verifies Node.js is installed, offers to install via Homebrew if missing
- Installs the Chosen Agent â installs the corresponding CLI globally via npm (opencode-ai / @anthropic-ai/claude-code / @openai/codex)
- Installs OpenCLI â installs the CLI tool for web automation and social media scraping (100+ site adapters)
- Creates Your Vault â copies the
vault-template/to your chosen location; if the folder already exists you can keep your notes and only refresh rules/skills, or rename the old folder as a backup â nothing is ever deleted - Distributes Skills & Rules â places skills into the agent-specific directory; generates
AGENTS.md(claude-code also generatesCLAUDE.md) - Configures AI Service â choose from 6 providers and generate the config file for the chosen agent
- Handles Existing Config â if the agent config already exists, the script asks first and makes a backup; OpenCode / Claude Code / Pi configs only get their model and key updated, other settings are kept
- Sets Up Obsidian Plugin â writes the claudian plugin
data.json(OpenCode can switch to the native plugin with--plugin opencode-obsidian); existing plugin settings are kept
Automation Mode
If you're letting an AI agent, script, or CI run the installer, these options help:
--non-interactive: skips prompts and relies on explicit flags or safe defaults--dry-run: previews the flow without installing dependencies or writing files
Example:
bash setup.sh --dry-run --non-interactive --vault "$HOME/Desktop/My Knowledge Base" --provider skip
For a real non-interactive install, a common flag combination looks like:
bash setup.sh --non-interactive --vault "$HOME/Desktop/My Knowledge Base" --provider openai --api-key "<KEY>" --keep-existing --overwrite-config
If the folder already exists:
--keep-existingkeeps your notes and only refreshes rules and skills;--overwrite-existingrenames the old folder as a backup and creates a fresh vault. Neither deletes anything.
ð Upgrade & Uninstall
After deployment, to get the latest rules, skills, or scripts:
# Update the repo first, then upgrade your knowledge base (only rules/skills, never touches your notes)
git pull
bash scripts/upgrade.sh --agent <your-agent> --vault "$HOME/Desktop/My Knowledge Base"
# e.g.: bash scripts/upgrade.sh --agent claude-code --vault "$HOME/Desktop/My Knowledge Base"
upgrade.shonly refreshesAGENTS.md/CLAUDE.md, skills, and helper scripts;raw/wiki/assets/are left untouched; anAI_CONFIG.mdyou have edited is kept as-is and the new template is saved asAI_CONFIG.md.new. Without--agent, the agent is detected from the vault (codex / pi must be specified).
To clean up (remove the agent config / plugin config / optionally delete the vault and npm packages):
bash scripts/uninstall.sh --agent <your-agent> --vault "$HOME/Desktop/My Knowledge Base"
# Full clean: bash scripts/uninstall.sh --agent codex --vault <path> --remove-vault --remove-packages --non-interactive
â ïž
--remove-vaultpermanently deletes all your notes and requires a second confirmation.
See CHANGELOG.md for version history.
ðïž Architecture Overview
This solution works with three components, with the AI Agent being one of three choices:
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â âââââââââââââââ ââââââââââââââââââââââââ âââââââââââââââ â
â â Obsidian âââââºâ AI Agent (pick 1) âââââºâ AGENTS.md â â
â â (Notes App) â â OpenCode/Claude/Codexâ â (AI Rules) â â
â âââââââââââââââ ââââââââââââââââââââââââ âââââââââââââââ â
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
| Component | Purpose | What It Means for You |
|---|---|---|
| Obsidian | Local note-taking app | Write notes like using a regular notebook |
| AI Agent | AI model interface | Chat with AI directly in Obsidian (pick one of OpenCode / Claude Code / Codex) |
| AGENTS.md | AI behavior guide | AI knows how to organize, query, and check your knowledge base |
All three agents share the same rules and skills; they differ only in installation method and config format. See
docs/agents.md.
ð Directory Structure
After installation, your knowledge base structure looks like this:
My Knowledge Base/
âââ ð AGENTS.md # AI rules (system-maintained)
âââ ð AI_CONFIG.md # âïž AI configuration (user-customizable)
âââ ð raw/ # Raw materials (PDFs/articles/screenshots)
â âââ organized by topic...
â âââ ð social/ # Social media raw content (by knowledge domain)
â âââ consumer-research/ # Reviews, comparisons, recommendations
â âââ skills-methods/ # Tutorials, guides, best practices
â âââ industry-insights/ # Trends, business analysis
â âââ lifestyle/ # Travel, food, fashion, home
â âââ opinions/ # Commentary, value perspectives
â âââ creative/ # Design, copywriting, marketing cases
â âââ resources/ # Tool recommendations, book lists
âââ ð wiki/ # AI-organized notes
â âââ index.md # ð Global index (auto-updated by AI)
â âââ log.md # ð Operation log (auto-recorded by AI)
â âââ topic notes... # Including digested social media knowledge
âââ ð assets/ # Image assets
âââ ð .opencode/ # AI skills dir (opencode)
â # claude-code uses .claude/skills/
â # codex uses ~/.codex/skills/ (user-level)
âââ ð skill/ # AI skills (shared across all agents)
âââ obsidian-cli/ # Obsidian operation capabilities
âââ obsidian-markdown/ # Markdown generation capabilities
âââ defuddle/ # Web content extraction capabilities
âââ opencli-usage/ # OpenCLI command reference (100+ adapters)
âââ smart-search/ # Intelligent search router
âââ opencli-browser/ # Browser automation
âââ opencli-autofix/ # Adapter auto-repair
âââ opencli-explorer/ # Adapter development guide
âââ opencli-oneshot/ # Quick CLI generation
Pre-installed Skills
The template comes with 9 pre-installed skills (source of truth: vault-template/.opencode/skill/). At deploy time they are distributed to the agent-specific directory (.opencode/skill/ / .claude/skills/ / ~/.codex/skills/). The skill content is shared across all three agents:
| Skill | Purpose |
|---|---|
obsidian-cli |
Read, create, search notes in your Obsidian vault |
obsidian-markdown |
Generate and edit Obsidian-flavored Markdown |
defuddle |
Extract clean content from web pages |
opencli-usage |
OpenCLI command reference (100+ site adapters) |
smart-search |
Intelligent search router across multiple platforms |
opencli-browser |
Browser automation for AI agents |
opencli-autofix |
Automatically fix broken site adapters |
opencli-explorer |
Guide for creating new site adapters |
opencli-oneshot |
Quick 4-step template for adding a single command |
ð Daily Usage Examples
ð¥ Ingest (Add to Knowledge Base)
Drop content you want to save to AI:
Add this to my wiki:
[paste article content / web link / describe what you want to record]
AI will automatically:
- Save raw materials to the
raw/directory - Organize into structured notes in
wiki/ - Update the global index and operation log
ð± Social Media Collection (Social Ingest)
After scraping content from Xiaohongshu, Douyin, Twitter, Weibo, etc. (using tools like opencli):
Scraped this:
[paste scraped note content]
Add this Xiaohongshu post
AI will automatically:
- Classify by knowledge domain (consumer research / skills & methods / industry insights / lifestyle / opinions / creative inspiration / resources)
- Assess credibility (sponsored content detection, evidence quality)
- Archive raw content to
raw/social/<domain>/
OpenCLI supports automatic content scraping via Chrome browser, reusing your login sessions. See OpenCLI project.
â ïž Compliance & responsible use: Automated scraping may violate the Terms of Service of some platforms â especially Chinese ones like Xiaohongshu, Douyin, and Weibo. This project is for personal learning and research only. You bear the risk of scraping frequency, content redistribution, and commercial use. Respect platform ToS and local laws, and be aware of account risk-control (rate limiting, suspension). Neither this project nor OpenCLI is liable for consequences of misuse.
- Digest and merge or create wiki articles (removing social media slang, keeping useful info)
- Auto-merge multiple posts on the same topic (e.g., multiple café reviews â city café guide)
- Update global index and operation log
Supported platforms: Xiaohongshu, Douyin, Twitter/X, Weibo, Bilibili, WeChat, etc.
ð Query (Search Knowledge)
Ask AI like chatting:
What does my wiki have about project management?
Based on my notes, summarize my views on AI tools
Compare the two learning methods I wrote about in my wiki
ð¥ Lint (Health Check)
Run weekly:
lint wiki
AI will check:
- â Index file consistency with actual files
- â Internal link validity
- â Orphaned pages (pages no one links to)
- â Cross-article fact consistency
ð§ Advanced Options (Optional)
The basic version works great. Add these features on demand by simply telling your AI agent to install them:
| Feature | Install Command | Purpose |
|---|---|---|
| ð PDF Export | "Install minimax-pdf skill" | Export notes to professional PDF |
| ð Word Export | "Install minimax-docx skill" | Generate Word documents |
| ð Excel Reading | "Install minimax-xlsx skill" | Read Excel data |
| ðš PPT Generation | "Install pptx-generator skill" | Turn notes into presentations |
| ðŒïž Image Analysis | "Install vision-analysis skill" | Analyze images and screenshots |
â FAQ
Q0: How do I customize AI behavior?
Edit AI_CONFIG.md in your knowledge base root directory. You can customize:
- Knowledge domains: Add/remove/modify categories (e.g., add "Academic Notes")
- Trigger words: Change keywords that activate AI operations
- Output language: Switch to English content processing
- Social platforms: Add new platforms
- Lint checks: Enable/disable individual health checks
- Custom rules: Write additional rules in the
user-custom-rulessection
Changes take effect on the next conversation â no restart needed.
Q1: I don't have a technical background. Can I still use this?
Absolutely! This is designed specifically for non-technical users. Just follow the deployment-guide.md step by step. No programming knowledge needed.
Q2: Is my data secure?
Very secure:
- â Your note files stay on your own computer; this project does not additionally host your notes
- â When you use AI, the active conversation content is sent to the model provider you configured
- â
Raw materials in
raw/are never modified by AI - â Notes are plain Markdown files, easy to copy and backup anytime
Q3: Can I use other AI services?
Yes! The setup script supports 6 providers â choose your preferred one during installation:
| Provider | Default Model | Highlights |
|---|---|---|
| Zhipu GLM â | glm-5.2 |
Chinese service, great for Chinese users |
| Anthropic | claude-opus-4-8 |
Claude series models |
| OpenAI | gpt-5.5 |
GPT series models |
| Google Gemini | gemini-3.1-pro-preview |
Gemini series models |
| OpenRouter | anthropic/claude-opus-4.8 |
Multi-model gateway, one key for many models |
| DeepSeek | deepseek-v4-pro |
Chinese service, cost-effective |
Just paste your API Key and the config is generated automatically (the config file path differs per agent, see docs/agents.md). Want to switch later? Re-run setup.sh or manually edit your agent's config file:
- OpenCode:
~/.config/opencode/opencode.json - Claude Code:
~/.claude/settings.json - Codex:
~/.codex/config.toml
Q4: What if installation fails?
- Make sure your Mac is running macOS 12 or later
- Make sure your computer has internet access
- Run the read-only check first:
bash scripts/verify.sh - Then take a screenshot of the error message in terminal and open an Issue
Q5: How is this different from using ChatGPT directly?
| Feature | ChatGPT | This Solution |
|---|---|---|
| Data Storage | Cloud | Local |
| Long-term Memory | Session-level | Permanent |
| Structured Organization | Manual | AI-auto |
| File Associations | Not supported | Supported |
ð€ Contributing
Issues and Pull Requests are welcome!
- Found a bug? Please submit an Issue
- Want to contribute code? See CONTRIBUTING.md
- Have a feature suggestion? Start a Discussion
ð License
This project is licensed under the MIT License.
You are free to use, modify, and distribute, just keep the copyright notice.
ð Acknowledgments
Thanks to these projects and teams for their support:
- OpenCode â Enables AI assistants to run locally in the terminal
- Claude Code â Anthropic's official AI coding agent
- Codex â OpenAI's official AI coding agent
- Obsidian â Excellent local note-taking software
- claudian â A universal plugin that embeds AI agents in Obsidian
- opencode-obsidian â The OpenCode Obsidian plugin
- OpenCLI â Make any website your CLI, 100+ site adapters
- Zhipu GLM / Anthropic / OpenAI / Google Gemini / OpenRouter / DeepSeek â Multiple AI service providers supported
- helloianneo/obsidian-ai-second-brain â Inspiration for the knowledge base architecture
Made with â€ïž for knowledge seekers
â Star this project · ð Submit Issue · ð¬ Join Discussion
Explore related projects
LoadingâŠ