ARCHiTEXT
The bridge between markdown notes and LLMs.
A high-performance Ruby TUI for context stitching.
As LLM context windows grow, the way we feed them data needs to scale.
Modern AI agents thrive on context, but gathering that context manually from sprawling markdown folders is tedious. ARCHiTEXT transforms this process into a seamless, visual experience. It allows you to search, filter, and "stitch" multiple notes into a single, structured Markdown bundle that agents can consume immediately.
Welcome to ARCHiTEXT!
ARCHiTEXT is a standalone Ruby TUI for stitching markdown notes into an LLM-friendly context bundle. By default it searches the current folder recursively for .md and .markdown files, while still offering an optional Obsidian CLI source for users who want vault-name resolution.
🚀 Quick Start
# Start the interactive search and selection flow
architext
ARCHiTEXT will search markdown files in the current folder, ask for a search query, then open a picker where you can select notes and copy the stitched context bundle to your clipboard.
Common next steps:
# Search with a specific query
architext --query "game"
# Search a specific folder
architext --root ~/Notes --query "project"
# Print the bundle instead of copying it
architext --query "tag:#project/active" --all --stdout
# Use Obsidian CLI mode explicitly
architext --source obsidian --vault "Main Vault" --query "Ideas"
✨ Features
- Visual Picker: Interactively select notes using a high-performance ANSI TUI.
- Source-Aware UX: Active folder or Obsidian vault is always visible in the TUI, with inline source switching.
- Native Markdown Search: Search any folder containing
.mdor.markdownfiles without opening Obsidian. - Context Stitching: Automatically bundles selected notes into a single Markdown file.
- LLM Ready: Output is formatted specifically for easy consumption by AI agents.
- No Dependencies: Built-in ANSI-based TUI logic (no complex visual gems required).
- Cross-Platform Clipboard: Uses native clipboard commands on macOS, Windows, and Linux.
📦 Installation
Using RubyGems
gem install architext
architext --version
Uninstall
gem uninstall architext
From Source
git clone https://github.com/CanPixel/ARCHiTEXT.git
cd ARCHiTEXT
./bin/setup
ruby bin/architext --version
gem build architext.gemspec
gem install ./architext-*.gem
⚙️ Configuration
Architext does not require Obsidian for normal use. Native mode searches markdown files directly under the current folder or a folder passed with --root.
Obsidian CLI integration remains available as an optional source. Use it when you want Obsidian vault-name or vault-id resolution.
Supported Platforms
- macOS: Fully supported (tested in CI).
- Windows: Native terminal support (PowerShell/Windows Terminal) with
clipclipboard integration. - Linux: Native terminal support with clipboard integration via
wl-copy,xclip, orxsel.
Optional Obsidian CLI Path
If you use --source obsidian and the CLI is not in your PATH, set the ARCHITEXT_OBSIDIAN environment variable:
export ARCHITEXT_OBSIDIAN="/path/to/obsidian"
PowerShell:
$env:ARCHITEXT_OBSIDIAN = "C:\path\to\obsidian.exe"
🛠 Usage
# Basic interactive search
architext
# Search with a specific query
architext --query "Zombie Parkour"
# Search a specific markdown folder
architext --root ~/Notes --query "project"
# Output directly to stdout (useful for piping)
architext --query "tag:#ctx/current" --all --stdout | gemini "Summarize this"
# Use Obsidian CLI mode with a specific vault
architext --source obsidian --vault "Main Vault" --query "Ideas"
# Legacy shorthand: --vault implies --source obsidian
architext --vault "Main Vault" --query "Ideas"
# Set a persistent default Obsidian vault
architext --set-default-vault "Main Vault"
# Clear the persistent default Obsidian vault
architext --clear-default-vault
# Check exactly which executable version is running
architext --version
# Print source diagnostics before searching
architext --diagnose
# Skip the picker and include all results
architext --query "tag:#project/active" --all --stdout
Source Selection Behavior
- Native mode is the default and uses the current working directory as the markdown root.
--root PATHsets the native markdown root for the current run.--source native|obsidianchooses the source explicitly.--vaultsets the Obsidian vault only for the current run and implies--source obsidian.--set-default-vaultstores a persistent default vault for future Obsidian-mode runs.- At the search prompt, type
vto open source configuration mode. - Press
vin the TUI selection screen to change source inline for the current session. - Startup diagnostics show native root and markdown file count, or Obsidian CLI details when Obsidian mode is active.
Native Search Syntax
- Empty query lists all markdown files under the active root.
- Plain terms match case-insensitively against relative paths or file content.
- Quoted phrases match literally.
tag:fooandtag:#foomatch markdown tags such as#fooand nested tags such as#foo/bar.path:termandfile:termmatch relative paths.- Multiple tokens are AND-matched.
Search Prompt Controls
| Input | Action |
|---|---|
enter |
Run search with default query |
v |
Open source configuration screen |
q |
Quit |
TUI Controls
| Key | Action |
|---|---|
↑/k, ↓/j |
Move selection |
space |
Toggle selection for current note |
a |
Toggle all visible notes |
/ |
Filter current results |
n |
Start a new markdown search |
v |
Set/change active source |
enter |
Confirm and bundle selected notes |
q |
Return to search prompt |
🔍 Troubleshooting
Obsidian CLI Not Found
This only applies when running with --source obsidian or --vault. If you see an error about obsidian command not found:
- Ensure the Obsidian desktop app is installed.
- Verify that you have installed the
obsidianCLI tool. - Check if
obsidianis in yourPATHby runningwhich obsidian(macOS/Linux) orwhere obsidian(Windows). - If you previously exported
OBSCTX_OBSIDIAN, rename it toARCHITEXT_OBSIDIAN.
Command Not Found After Gem Install
If gem install architext succeeds but architext is not found, your Ruby executable directory is not on your shell PATH.
- Find RubyGems executable directory:
gem env | grep "EXECUTABLE DIRECTORY"
- Add that directory to your shell
PATH(forzsh, update~/.zshrc). - Restart your shell and verify:
which architextarchitext --version
No Results But Notes Exist
- Verify the active source shown in the TUI header.
- In native mode, confirm the current folder or
--rootcontains markdown files. - At the search prompt, type
vto open source configuration. - In selection, use
vto switch root or Obsidian vault and rerun the query. - Run
architext --diagnoseto print the active source, native root, markdown count, and Obsidian details when applicable.
Clipboard Issues
Architext auto-detects clipboard tools:
- macOS:
pbcopy - Windows:
clip(fallback: PowerShellSet-Clipboard) - Linux:
wl-copy,xclip, orxsel
If none are available, run with --stdout and pipe output to your preferred clipboard manager.
📜 License
Architext is released under the MIT License.