Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

feat: add copy button for ollama command in obsidian, filter out html from answers

Louis Beaumonta373be787ae6
diff --git a/pipes/obsidian/package.json b/pipes/obsidian/package.json
index 2530e0a34..07d5b26e0 100644
--- a/pipes/obsidian/package.json
+++ b/pipes/obsidian/package.json
@@ -1,6 +1,6 @@
{
"name": "obsidian",
- "version": "0.1.21",
+ "version": "0.1.24",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
diff --git a/pipes/obsidian/src/app/api/intelligence/route.ts b/pipes/obsidian/src/app/api/intelligence/route.ts
index 42a62e745..0df2f554e 100644
--- a/pipes/obsidian/src/app/api/intelligence/route.ts
+++ b/pipes/obsidian/src/app/api/intelligence/route.ts
@@ -98,7 +98,21 @@ Generate a structured analysis following the above format.`;
maxRetries: 5,
});
- return response.text;
+ // Transform <think> tags into Obsidian foldable callouts
+ let transformedText = response.text.replace(
+ /<think>([\s\S]*?)<\/think>/g,
+ (_, content) =>
+ `> [!note]- Thinking Process\n${content
+ .split("\n")
+ .map((line: string) => `> ${line}`)
+ .join("\n")}`
+ );
+
+ // Transform <video> tags to just 'video'
+ transformedText = transformedText.replace(/<video>/g, "video");
+ transformedText = transformedText.replace(/<\/video>/g, "");
+
+ return transformedText;
}
async function saveMarkdown(
diff --git a/pipes/obsidian/src/components/obsidian-settings.tsx b/pipes/obsidian/src/components/obsidian-settings.tsx
index 4cafc68ec..d185abc2a 100644
--- a/pipes/obsidian/src/components/obsidian-settings.tsx
+++ b/pipes/obsidian/src/components/obsidian-settings.tsx
@@ -12,6 +12,7 @@ import {
Clock,
ExternalLink,
Loader2,
+ Copy,
} from "lucide-react";
import { useToast } from "@/hooks/use-toast";
import { OllamaModelsList } from "./ollama-models-list";
@@ -567,6 +568,30 @@ export function ObsidianSettings() {
>
<Brain className="h-4 w-4" />
log generation model
+ <code className="px-2 py-0.5 bg-muted rounded-md text-xs flex items-center gap-2">
+ ollama run{" "}
+ {settings?.logModel || "llama3.2:3b-instruct-q4_K_M"}
+ <Button
+ type="button"
+ variant="ghost"
+ size="icon"
+ className="h-4 w-4 p-0"
+ onClick={() => {
+ navigator.clipboard.writeText(
+ `ollama run ${
+ settings?.logModel ||
+ "llama3.2:3b-instruct-q4_K_M"
+ }`
+ );
+ toast({
+ title: "copied to clipboard",
+ duration: 1000,
+ });
+ }}
+ >
+ <Copy className="h-3 w-3" />
+ </Button>
+ </code>
</Label>
<OllamaModelsList
disabled={!pathValidation.isValid}
@@ -626,6 +651,31 @@ export function ObsidianSettings() {
>
<Brain className="h-4 w-4" />
analysis model
+ <code className="px-2 py-0.5 bg-muted rounded-md text-xs flex items-center gap-2">
+ ollama run{" "}
+ {settings?.analysisModel ||
+ "deepseek-r1:7b-qwen-distill-q4_K_M"}
+ <Button
+ type="button"
+ variant="ghost"
+ size="icon"
+ className="h-4 w-4 p-0"
+ onClick={() => {
+ navigator.clipboard.writeText(
+ `ollama run ${
+ settings?.analysisModel ||
+ "deepseek-r1:7b-qwen-distill-q4_K_M"
+ }`
+ );
+ toast({
+ title: "copied to clipboard",
+ duration: 1000,
+ });
+ }}
+ >
+ <Copy className="h-3 w-3" />
+ </Button>
+ </code>
</Label>
<OllamaModelsList
disabled={!pathValidation.isValid}