architext 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f01f07f6d9ef1e104d4c8f5dc9575faf85864ec4a16e26e9776033e6bfb9c0df
4
+ data.tar.gz: 9b3abb2535fe6d4145173a2b6d4a8dfb9d4857f5dba6f13e3d0dd484e67ac15f
5
+ SHA512:
6
+ metadata.gz: ba45236c8562e14652ff0b1404e5ca44b6b1f485f11fd23d288bac35a61260437abd4fc72e13f95e0e91385ca95d6342912ad14a7c9730ee80ba6d11f1271458
7
+ data.tar.gz: 91a02ffeb556817e1161e3560885591a7cf917f92e7e0ff8e11c99ab8f823e0c2889cc80ec4a853b083473c0691af7056265d8b2d37824918294146b07f5fa7b
data/CHANGELOG.md ADDED
@@ -0,0 +1,84 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.2.0] - 2026-05-16
9
+
10
+ ### Changed
11
+ - Naming normalization release: align gem/library/executable naming around `architext` following RubyGems consistent naming guidance.
12
+ - Rename internal Ruby namespace from `ObsidianContext` to `Architext`.
13
+ - Rename library layout from `lib/obsctx/*` to `lib/architext/*` with `lib/architext.rb` as the canonical entrypoint.
14
+ - Standardize executable usage on `bin/architext` and remove the legacy `obsctx` executable from the gem package.
15
+ - Standardize Obsidian CLI override environment variable on `ARCHITEXT_OBSIDIAN`.
16
+
17
+ ## [0.1.6] - 2026-05-13
18
+
19
+ ### Fixed
20
+ - Replace the Windows selector frame with a fixed-height, no-wrap layout to prevent redraw fragments from accumulating in PowerShell.
21
+ - Handle arrow-key escape sequences returned as a single `getch` value as well as byte-by-byte sequences.
22
+ - Account for emoji and wide Unicode characters when truncating candidate paths.
23
+
24
+ ## [0.1.5] - 2026-05-13
25
+
26
+ ### Fixed
27
+ - Smooth selector redraws on Windows by using the alternate screen and repainting the frame in place instead of clearing the whole terminal on every navigation key.
28
+ - Improve arrow-key parsing for Windows PowerShell and other VT-style terminals.
29
+
30
+ ## [0.1.4] - 2026-05-13
31
+
32
+ ### Fixed
33
+ - Route Obsidian CLI calls through PowerShell on Windows so Ruby captures the same search output shown in an interactive terminal.
34
+
35
+ ## [0.1.3] - 2026-05-13
36
+
37
+ ### Fixed
38
+ - Prefer Obsidian CLI `format=json` search output before text output, matching the reliable Windows CLI path.
39
+ - Normalize captured Obsidian CLI output as UTF-8 before parsing so emoji-heavy Windows vault paths survive Ruby process capture.
40
+
41
+ ## [0.1.2] - 2026-05-13
42
+
43
+ ### Added
44
+ - Startup vault configuration flow: type `v` at search prompt to open vault config mode.
45
+ - Clear startup vault diagnostics showing:
46
+ - active vault and source
47
+ - saved default vault
48
+ - default vault config path
49
+ - Obsidian CLI pre-search connection diagnostics (`version`, resolved vault summary, executable path).
50
+ - `--diagnose` CLI flag to print vault/CLI connection details without running a search.
51
+ - No-results diagnostics now include vault source, config path, and Obsidian CLI executable reference.
52
+
53
+ ### Changed
54
+ - Gem package name normalized to lowercase `architext` for `gem install/uninstall architext`.
55
+ - Context selection header now shows explicit vault source labels (`--vault`, `saved default`, `session`, `obsidian default`).
56
+ - `(default)` vault label replaced with clearer "none selected (obsidian default)" messaging.
57
+
58
+ ## [0.1.1] - 2026-05-13
59
+
60
+ ### Added
61
+ - Cross-platform clipboard support for macOS, Windows, and Linux command-line environments.
62
+ - `--version` flag to print the running executable version.
63
+ - Windows and Linux platform notes in README.
64
+ - CI matrix coverage for `ubuntu-latest`, `macos-latest`, and `windows-latest`.
65
+ - Persistent default vault management via `--set-default-vault` and `--clear-default-vault`.
66
+ - TUI vault control (`v`) plus active-vault visibility in the selector header.
67
+ - Splash intro enhancements: branded subtitle, centered version line, and short glow animation.
68
+
69
+ ### Changed
70
+ - TUI input handling for better Windows key compatibility.
71
+ - Terminal capability detection to avoid unsupported rendering features in some terminals.
72
+ - `q` during selection now returns to the search prompt instead of exiting immediately.
73
+ - No-results feedback now includes vault context and remediation tips.
74
+
75
+ ## [0.1.0] - 2026-05-13
76
+
77
+ ### Added
78
+ - Initial release of `architext`.
79
+ - TUI for interactive Obsidian note selection.
80
+ - CLI support for queries and vault selection.
81
+ - GitHub Actions CI workflow.
82
+ - Professional repository documentation (`CHANGELOG.md`).
83
+ - RuboCop integration for linting.
84
+ - `bin/setup` script for easier development environment configuration.
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Can Ur (CanPixel)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,196 @@
1
+ # ARCHiTEXT
2
+
3
+ <p align="center">
4
+ <img src="assets/logo.svg" alt="ARCHiTEXT Logo" width="200">
5
+ <br>
6
+ <b>The bridge between your Obsidian vault and LLMs.</b>
7
+ <br>
8
+ <i>A high-performance Ruby TUI for context stitching.</i>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://github.com/CanPixel/ARCHiTEXT/actions/workflows/ci.yml">
13
+ <img src="https://github.com/CanPixel/ARCHiTEXT/actions/workflows/ci.yml/badge.svg" alt="CI Status">
14
+ </a>
15
+ <a href="https://rubygems.org/gems/architext">
16
+ <img src="https://img.shields.io/badge/version-v0.2.0-5BE8B8.svg" alt="Version 0.2.0">
17
+ </a>
18
+ <a href="LICENSE">
19
+ <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License">
20
+ </a>
21
+ <img src="https://img.shields.io/badge/maintained-yes-green.svg" alt="Maintained">
22
+ </p>
23
+
24
+ ---
25
+
26
+ <img src="assets/social-preview.svg" alt="ARCHiTEXT Social Preview" width="1080">
27
+
28
+ `ARCHiTEXT` is a standalone Ruby TUI for stitching Obsidian notes into an LLM-friendly Markdown context bundle. It uses the official `obsidian` CLI as the source of truth for vault search and file reads, providing a visual terminal interface for selecting notes.
29
+
30
+ ## 🚀 Quick Start
31
+
32
+ ```sh
33
+ # Start the interactive search and selection flow
34
+ architext
35
+ ```
36
+
37
+ ARCHiTEXT will detect your active Obsidian vault, ask for a search query, then open a picker where you can select notes and copy the stitched context bundle to your clipboard.
38
+
39
+ Common next steps:
40
+
41
+ ```sh
42
+ # Search with a specific query
43
+ architext --query "game"
44
+
45
+ # Search a specific vault
46
+ architext --vault "Main Vault" --query "project"
47
+
48
+ # Print the bundle instead of copying it
49
+ architext --query "tag:#project/active" --all --stdout
50
+ ```
51
+
52
+ ## ✨ Features
53
+
54
+ - **Visual Picker:** Interactively select notes using a high-performance ANSI TUI.
55
+ - **Vault-Aware UX:** Active vault is always visible in the TUI, with inline vault switching.
56
+ - **Context Stitching:** Automatically bundles selected notes into a single Markdown file.
57
+ - **LLM Ready:** Output is formatted specifically for easy consumption by AI agents.
58
+ - **No Dependencies:** Built-in ANSI-based TUI logic (no complex visual gems required).
59
+ - **Cross-Platform Clipboard:** Uses native clipboard commands on macOS, Windows, and Linux.
60
+
61
+ ## 📦 Installation
62
+
63
+ ### Using RubyGems
64
+
65
+ ```sh
66
+ gem install architext
67
+ architext --version
68
+ gem uninstall architext
69
+ ```
70
+
71
+ ### From Source
72
+
73
+ ```sh
74
+ git clone https://github.com/CanPixel/ARCHiTEXT.git
75
+ cd ARCHiTEXT
76
+ ./bin/setup
77
+ ruby bin/architext --version
78
+ gem build architext.gemspec
79
+ gem install ./architext-*.gem
80
+ ```
81
+
82
+ ## ⚙️ Configuration
83
+
84
+ Architext relies on the [Obsidian CLI](https://github.com/obsidianmd/obsidian-cli). Ensure it is installed and available on your `PATH`.
85
+
86
+ ### Supported Platforms
87
+
88
+ - **macOS:** Fully supported (tested in CI).
89
+ - **Windows:** Native terminal support (PowerShell/Windows Terminal) with `clip` clipboard integration.
90
+ - **Linux:** Native terminal support with clipboard integration via `wl-copy`, `xclip`, or `xsel`.
91
+
92
+ ### Setting the Obsidian CLI Path
93
+
94
+ If the CLI is not in your `PATH`, you can set the `ARCHITEXT_OBSIDIAN` environment variable:
95
+
96
+ ```sh
97
+ export ARCHITEXT_OBSIDIAN="/path/to/obsidian"
98
+ ```
99
+
100
+ PowerShell:
101
+
102
+ ```powershell
103
+ $env:ARCHITEXT_OBSIDIAN = "C:\path\to\obsidian.exe"
104
+ ```
105
+
106
+ ## 🛠 Usage
107
+
108
+ ```sh
109
+ # Basic interactive search
110
+ architext
111
+
112
+ # Search with a specific query
113
+ architext --query "Zombie Parkour"
114
+
115
+ # Output directly to stdout (useful for piping)
116
+ architext --query "tag:#ctx/current" --stdout | gemini "Summarize this"
117
+
118
+ # Specify a vault
119
+ architext --vault "Main Vault" --query "Ideas"
120
+
121
+ # Set a persistent default vault
122
+ architext --set-default-vault "Main Vault"
123
+
124
+ # Clear the persistent default vault
125
+ architext --clear-default-vault
126
+
127
+ # Check exactly which executable version is running
128
+ architext --version
129
+
130
+ # Print vault/CLI diagnostics before searching
131
+ architext --diagnose
132
+
133
+ # Skip the picker and include all results
134
+ architext --query "tag:#project/active" --all --stdout
135
+ ```
136
+
137
+ ### Vault Selection Behavior
138
+
139
+ - `--vault` sets the vault only for the current run.
140
+ - `--set-default-vault` stores a persistent default vault for future runs.
141
+ - If `--vault` is omitted, the persistent default vault is used when available.
142
+ - At the search prompt, type `v` to open vault configuration mode.
143
+ - Press `v` in the TUI selection screen to change vault inline for the current session.
144
+ - The active vault is shown in the TUI header (`vault: ...`) so target scope is always visible.
145
+ - Vault path resolution is performed by the Obsidian CLI (`vault=<name_or_id>`); ARCHiTEXT displays the vault reference and source.
146
+ - Startup prompt includes an Obsidian connection check (`version`, resolved vault summary, executable path).
147
+
148
+ ### Search Prompt Controls
149
+
150
+ | Input | Action |
151
+ | --- | --- |
152
+ | `enter` | Run search with default query |
153
+ | `v` | Open vault configuration screen |
154
+ | `q` | Quit |
155
+
156
+ ### TUI Controls
157
+
158
+ | Key | Action |
159
+ | --- | --- |
160
+ | `↑`/`k`, `↓`/`j` | Move selection |
161
+ | `space` | Toggle selection for current note |
162
+ | `a` | Toggle all visible notes |
163
+ | `/` | Filter current results |
164
+ | `n` | Start a new Obsidian search |
165
+ | `v` | Set/change active vault |
166
+ | `enter` | Confirm and bundle selected notes |
167
+ | `q` | Return to search prompt |
168
+
169
+ ## 🔍 Troubleshooting
170
+
171
+ ### Obsidian CLI Not Found
172
+ If you see an error about `obsidian` command not found:
173
+ 1. Ensure the Obsidian desktop app is installed.
174
+ 2. Verify that you have installed the `obsidian` CLI tool.
175
+ 3. Check if `obsidian` is in your `PATH` by running `which obsidian` (macOS/Linux) or `where obsidian` (Windows).
176
+ 4. If you previously exported `OBSCTX_OBSIDIAN`, rename it to `ARCHITEXT_OBSIDIAN`.
177
+
178
+ ### No Results But Notes Exist
179
+ - Verify the active vault shown in the TUI header.
180
+ - At the search prompt, type `v` to open vault configuration.
181
+ - In selection, use `v` to switch vault and rerun the query.
182
+ - Set a persistent vault with `--set-default-vault "Your Vault"`.
183
+ - For one-off runs, pass `--vault "Your Vault"` explicitly.
184
+ - Run `architext --diagnose` to print the exact vault reference/source and Obsidian CLI resolution before searching.
185
+
186
+ ### Clipboard Issues
187
+ Architext auto-detects clipboard tools:
188
+ - macOS: `pbcopy`
189
+ - Windows: `clip` (fallback: PowerShell `Set-Clipboard`)
190
+ - Linux: `wl-copy`, `xclip`, or `xsel`
191
+
192
+ If none are available, run with `--stdout` and pipe output to your preferred clipboard manager.
193
+
194
+ ## 📜 License
195
+
196
+ Architext is released under the [MIT License](LICENSE).
data/bin/architext ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require_relative "../lib/architext/cli"
5
+
6
+ exit Architext::CLI.new(ARGV, app_name: "architext").run
data/bin/setup ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "fileutils"
5
+
6
+ # path to your application root.
7
+ APP_ROOT = File.expand_path("..", __dir__)
8
+
9
+ def system!(*args)
10
+ system(*args) || abort("\n== Command #{args} failed ==")
11
+ end
12
+
13
+ FileUtils.chdir APP_ROOT do
14
+ # This script is a way to set up or update your development environment automatically.
15
+ # This script is idempotent, so that you can run it at any time and get an expectable outcome.
16
+ # Add necessary setup steps to this file.
17
+
18
+ puts "== Installing dependencies =="
19
+ system! "gem install bundler --conservative"
20
+ system("bundle check") || system!("bundle install")
21
+
22
+ puts "\n== Removing old logs and tempfiles =="
23
+ # system! "bin/rails log:clear tmp:clear"
24
+
25
+ puts "\n== Restarting application server =="
26
+ # system! "bin/rails restart"
27
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Architext
4
+ FileContent = Data.define(:path, :content)
5
+
6
+ class Bundle
7
+ def initialize(files)
8
+ @files = files
9
+ end
10
+
11
+ def to_markdown
12
+ sections = @files.map do |file|
13
+ normalized = file.content.to_s.chomp
14
+ "## File: #{file.path}\n\n#{normalized}"
15
+ end
16
+
17
+ "# Context Bundle\n\n#{sections.join("\n\n---\n\n")}\n"
18
+ end
19
+ end
20
+ end