
Pubmed Search
Query PubMed with semantic full-text search from the terminal while scoping health, biotech, or science-backed product ideas.
Install
npx skills add https://github.com/yorkeccak/scientific-skills --skill pubmed-searchWhat is this skill?
- Node CLI wrapper (`search.mjs`) invoked via bash entrypoint with `--path` / `--script-dir` discoverability flags
- Full-text and semantic search against PubMed through the Valyu API (`api.valyu.ai/v1`)
- API key resolution order: `VALYU_API_KEY` env var, then `~/.valyu/config.json`
- Persists config under `~/.valyu/` when saving keys from the tool flow
- Suitable for piping results into agent workflows during literature sweeps
Adoption & trust: 571 installs on skills.sh; 47 GitHub stars; 2/3 security scanners passed (skills.sh audits).
Recommended Skills
Paper Context Resolverlllllllama/ai-paper-reproduction-skill
Repo Intake And Planlllllllama/ai-paper-reproduction-skill
Env And Assets Bootstraplllllllama/ai-paper-reproduction-skill
Minimal Run And Auditlllllllama/ai-paper-reproduction-skill
Analyze Projectlllllllama/rigorpilot-skills
Ai Research Reproductionlllllllama/rigorpilot-skills
Journey fit
Primary fit
Literature review usually happens before you commit to a build, so the canonical shelf is Idea. PubMed search is a structured research activity for evidence and prior work, not competitor scraping or audience interviews.
Common Questions / FAQ
Is Pubmed Search safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Pubmed Search
#!/bin/bash # PubMed Search CLI wrapper SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SCRIPT_PATH="${SCRIPT_DIR}/search" # Special commands for discoverability case "$1" in --path|--location|--where) echo "$SCRIPT_PATH" exit 0 ;; --script-dir) echo "$SCRIPT_DIR" exit 0 ;; esac node "${SCRIPT_DIR}/search.mjs" "$@" #!/usr/bin/env node /** * PubMed Search via Valyu API * Full-text search across PubMed with semantic search capabilities */ import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs'; import { homedir } from 'os'; import { join } from 'path'; const VALYU_API_BASE = 'https://api.valyu.ai/v1'; const CONFIG_DIR = join(homedir(), '.valyu'); const CONFIG_FILE = join(CONFIG_DIR, 'config.json'); /** * Get API key from multiple sources (in order of priority): * 1. Environment variable (VALYU_API_KEY) * 2. Config file (~/.valyu/config.json) */ function getApiKey() { if (process.env.VALYU_API_KEY) { return process.env.VALYU_API_KEY; } if (existsSync(CONFIG_FILE)) { try { const config = JSON.parse(readFileSync(CONFIG_FILE, 'utf-8')); if (config.apiKey) { return config.apiKey; } } catch (e) { // Ignore parse errors } } return null; } /** * Save API key to config file */ function saveApiKey(apiKey) { if (!existsSync(CONFIG_DIR)) { mkdirSync(CONFIG_DIR, { recursive: true }); } let config = {}; if (existsSync(CONFIG_FILE)) { try { config = JSON.parse(readFileSync(CONFIG_FILE, 'utf-8')); } catch (e) { // Start fresh if parse fails } } config.apiKey = apiKey; writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2)); return true; } /** * Return setup required response */ function setupRequiredResponse() { return { success: false, setup_required: true, message: "Valyu API key not configured. Get your free API key ($10 credits) at https://platform.valyu.ai" }; } /** * Search PubMed via Valyu API */ async function searchPubMed(query, maxResults = 10) { const apiKey = getApiKey(); if (!apiKey) { return setupRequiredResponse(); } try { const response = await fetch(`${VALYU_API_BASE}/search`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey }, body: JSON.stringify({ query: query, search_type: 'proprietary', included_sources: ['valyu/valyu-pubmed'], limit: maxResults }) }); const data = await response.json(); if (!response.ok) { return { success: false, error: data.detail || data.message || `HTTP ${response.status}`, status: response.status }; } return { success: true, type: 'pubmed_search', query: query, result_count: data.results?.length || 0, results: data.results || [], cost: data.cost || 0 }; } catch (error) { return { success: false, error: error.message }; } } /** * Setup command - save API key */ function setup(apiKey) { if (!apiKey) { return { success: false, error: "API key required. Usage: search setup <api-key>" }; } saveApiKey(apiKey); return { success: true, type: 'setup', message: "API key saved to ~/.valyu/config.json" }; } // Main CLI handler const [,, command, ...args] = process.argv; (async () => { let result; if (command === 'setup') { result = setup(args[0]); } else { // Treat first arg as query, second as maxResults const query = command || ''; const maxResults = args[0] ? parseInt(args[0], 10) : 10; if (!query) { result = { success: false, error: "Query required. Usage: search <query> [maxResults]" }; } else { result = await searchPubMed(query, maxResults); } } console.log(JSON.stringify(result, null, 2)); process.exi