Getting Started with Smart Context
Purpose / Objective
Want to seamlessly copy multiple notes at once to share with AI tools? Smart Context lets you build powerful, customized ‘context packages’ from open or selected files, entire folders, and even includes linked references. Perfect for quickly feeding code, documentation, or project details into ChatGPT or other large language models.
User Goal
Install Smart Context, confirm it is running, then learn basic commands that make it easy to gather project context in your clipboard.
Logline
Copy large sets of notes, skip private sections, and incorporate linked references in seconds. Scale your note-sharing workflow without leaving Obsidian.
Real-World Use Case
A developer wants to paste relevant code files, readme content, and design docs into ChatGPT for help. They do not want to manually open and copy each file, nor reveal sensitive or excluded headings. Smart Context solves it in a few clicks.
Workflows
Copy folder contents using menu option
Step 1: Right-click on a folder in the file explorer
Step 2: Select ‘Copy folder contents to clipboard’
Step 3: Paste into a text editor or ChatGPT
Step 4: Observe formatted context
Current Context Setup
Step 1: Open Multiple Files
Split your workspace into 2 or more open notes.
Copy Visible Open Files
Step 1: Observe ‘Smart Context’ in the Command Palette
Open the Command Palette (Ctrl/Cmd+P), type ‘Smart Context’ to see new commands like ‘Copy visible open files (pick link depth).’
Step 2: Run ‘Copy visible open files’ and Pick Depth=0
From the Command Palette, select ‘Copy visible open files (pick link depth).’
If you pick 0, only the current file contents are included. If you pick 1 or higher, linked files are also included.
Step 3: Confirm visible files copied to clipboard
Paste into a text editor or ChatGPT. Observe that the visible open files’ content has been combined and formatted. Note: the output excludes “Context 3” since it is not directly visible.
Copy All Open Files
Step 1: Run ‘Copy all open files’ and Pick Depth=0
From the Command Palette, select ‘Copy visible open files (pick link depth).’
Step 2: Confirm all files copied to clipboard
Paste into a text editor or ChatGPT. Observe that the all open files’ content has been combined and formatted. Note: the output includes “Context 3” even though it is not directly visible.
Copy Current Note with Linked References
Step 1: Reduce visible windows to only the current note
Current note contains links to relevant context.
Step 2: Run ‘Copy current note’
From the Command Palette, select ‘Copy current note to clipboard’.
Step 3: Select Depth 1 to include content from links in the current note
Picking depth=1
or higher includes linked notes in the context copied to clipboard.
Step 4: Observe all content from the links is included in the copied context
Note: The formatting of linked notes is slightly different than before. In the settings, a template for current, visible, and open notes may be defined separately from the template for linked notes.
Expected Results
- Plugin appears in Command Palette with relevant commands.
- Right-click folder context menu has ‘Copy folder contents to clipboard.’
- Copy commands produce combined text, optionally excluding headings or entire files.