Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,26 @@ jobs:
shell: bash
run: |
set -euo pipefail
mkdir -p dist
make alfred-workflow
cp integrations/alfred-workflow/workflow/arrowhead-search.alfredworkflow dist/arrowhead-search-"${GITHUB_REF_NAME#v}".alfredworkflow

- name: Package Raycast extension
shell: bash
run: |
set -euo pipefail
mkdir -p dist
make raycast-extension
cp integrations/raycast-extension/dist/arrowhead-search.raycast dist/arrowhead-search-"${GITHUB_REF_NAME#v}".raycast

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.package.outputs.archive_prefix }}
path: |
dist/*.tar.gz
dist/*.alfredworkflow
dist/*.raycast
dist/*.sha256
if-no-files-found: error

Expand Down Expand Up @@ -222,6 +232,7 @@ jobs:
files: |
dist/*.tar.gz
dist/*.alfredworkflow
dist/*.raycast
dist/*.sha256
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ BIN_DIR := $(PREFIX)/bin
CARGO_LOCKED := $(if $(filter 0,$(LOCKED)),,--locked)
CARGO_FORCE := $(if $(filter 1,$(FORCE)),--force,)

.PHONY: install clean alfred-workflow
.PHONY: install clean alfred-workflow raycast-extension
install:
@set -euo pipefail; \
BIN_DIR="$(BIN_DIR)"; \
Expand Down Expand Up @@ -65,9 +65,13 @@ clean:
alfred-workflow:
@bash scripts/package-alfred-workflow.sh

raycast-extension:
@bash scripts/package-raycast-extension.sh

.PHONY: help
help:
@printf 'Available targets:\n'
@printf ' install Build and install arrowhead-cli and arrowheadd (override PREFIX, LOCKED=0, FORCE=1 as needed)\n'
@printf ' clean Remove target artifacts via cargo clean\n'
@printf ' alfred-workflow Package integrations/alfred-workflow into workflow/arrowhead-search.alfredworkflow\n'
@printf ' raycast-extension Package integrations/raycast-extension into dist/arrowhead-search.raycast\n'
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@ Semantic-only matches surface `"N/A"` in the BM25 column of the human-readable o
- Run Script: `/usr/bin/python3 src/open_note.py` opens results in Obsidian by default; holding ⌘ routes to the macOS default editor (or a custom command configured via workflow variables).
- Ensure the Arrowhead daemon is running before triggering searches. The workflow shells out to `arrowhead search <mode> --json` and opens notes in Obsidian by default (hold ⌘ to switch to the macOS default editor).

## Raycast Extension Integration

- Preferred install: download the latest `arrowhead-search-<version>.raycast` archive from [GitHub Releases](https://github.com/totocaster/arrowhead/releases) and import it via **Raycast → Extensions → Import Extension…**.
- Source lives under `integrations/raycast-extension/`. Run `make raycast-extension` to regenerate `dist/arrowhead-search.raycast`; the script runs `npm ci`, executes `ray build --environment dist --output build`, and zips the build artifacts for distribution.
- The `search` command shells out to `arrowhead search <mode> "<query>" --json --include-paths`, debounces input (300 ms), and renders results with Obsidian/default editor actions plus copy and “Reveal in Finder” shortcuts.
- Vault detection mirrors the Alfred integration: honours `VAULT_PATH`/`ARROWHEAD_VAULT_PATH`, falls back to parsing `config.toml`, and resolves absolute note paths when the CLI payload omits them.

## CLI Reference

- `arrowhead init` — bootstrap a vault, seed configuration, and offer auto-start registration when requested.
Expand Down
5 changes: 5 additions & 0 deletions integrations/raycast-extension/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
build/
.raycast/
dist/
*.log
50 changes: 50 additions & 0 deletions integrations/raycast-extension/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Arrowhead Raycast Extension

Search your Arrowhead vault from Raycast, preview results, and open notes in Obsidian or the system default editor.

## Layout

- `src/search.tsx` — Raycast command that shells out to `arrowhead search --json --include-paths` and renders a live-updating list.
- `package.json` — Extension manifest plus build tooling metadata.
- `assets/` — Icons bundled with the extension (`icon.png` mirrors the Alfred workflow icon).
- `build/` — Generated output when running `npm run build` (ignored by git).

## Preferences

Expose the following Raycast preferences (configured via the extensions panel):

| Preference | Default | Description |
| --- | --- | --- |
| `searchMode` | `hybrid` | Search strategy (`fts`, `semantic`, or `hybrid`). |
| `resultLimit` | `15` | Maximum number of results Arrowhead should return. |
| `primaryEditor` | `obsidian` | Editor used for the primary open action (`obsidian` or `default`). |
| `vaultPath` | _(empty)_ | Optional vault override. Leave blank to read Arrowhead’s config. |
| `arrowheadCliPath` | _(empty)_ | Absolute path to the Arrowhead CLI when it is not on `PATH`. |

The command auto-detects the configured vault when no override is supplied and maps the ⌘ modifier to the alternate editor (Obsidian ⇄ default).

## CLI Contract

- Invokes `arrowhead search <mode> "<query>" --json --limit <n> --include-paths`.
- Expects the daemon to be running and the vault indexed.
- Parses the JSON payload produced by `render_results` and mirrors the Alfred integration’s field mapping (title, preview, absolute path, reason, etc.).

## Packaging

- Install dependencies and build: `npm install && npm run build` (runs `ray build --environment dist --output build`).
- Bundle for distribution: `make raycast-extension` (see `scripts/package-raycast-extension.sh`). The script zips `package.json`, `build/`, and `assets/` into `dist/arrowhead-search.raycast`.
- Import into Raycast via **Extensions → Import Extension…** and selecting the generated `.raycast` archive.

## Testing Checklist

- Empty query shows placeholder copy instead of shelling out.
- Search runs for `fts`, `semantic`, and `hybrid` with the configured limit.
- Failure to locate the CLI or vault surfaces descriptive toasts and an empty-state error.
- Notes open in Obsidian by default and fall back to the system editor with ⌘.
- Secondary actions expose copy-to-clipboard and “Reveal in Finder” options when paths are available.

## Implementation Notes

- Ensures PATH includes common install locations (`~/.cargo/bin`, `/opt/homebrew/bin`, etc.) before invoking the CLI.
- Mirrors the vault resolution logic from the Alfred scripts (config parsing fallback, supports `VAULT_PATH` override).
- Uses a debounce when running the CLI to avoid hammering the daemon while the user types (300 ms delay).
Binary file added integrations/raycast-extension/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading