$ show Pierrad/obsidian-github-copilot
This repository is an Obsidian plugin that integrates GitHub Copilot's AI-powered coding assistance directly into the Obsidian note-taking application. It provides two main features: inline code suggestions as you type (similar to Copilot in IDEs) and a chat interface for interacting with Copilot in a sidebar. The plugin handles authentication with GitHub Copilot, manages conversation history, renders Mermaid diagrams from AI responses, and allows linking to Obsidian notes using [[double bracket]] syntax in chat conversations. The architecture separates concerns into distinct modules for inline suggestions (using LSP protocol) and chat functionality (using direct API calls), with React powering the chat UI and Zustand managing state.
The LLM identified 3 files worth highlighting for reuse:
Implements secure credential storage using AES-256 encryption with PBKDF2 key derivation. Handles migration from plain text to secure storage, legacy key compatibility, and provides a clean interface for storing/retrieving GitHub Copilot authentication tokens. Demonstrates advanced cryptographic practices suitable for desktop applications.
Self-contained React component for rendering Mermaid diagrams with proper loading states, error handling, and theme adaptation (light/dark). Initializes Mermaid on demand, validates diagram syntax, and integrates seamlessly with markdown rendering. Reusable in any React application needing diagram visualization.
Implements sophisticated state management for inline editor suggestions using CodeMirror's StateEffect system. Handles suggestion lifecycle, cursor movement detection, and partial acceptance logic. Demonstrates expert-level use of CodeMirror's state system for building editor extensions.