Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
7
This file provides guidance to LLM agents when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to LLM agents when working with code in this repository.
This is a Node.js CLI tool that provides access to Kagi.com services using session tokens (not API keys):
The project is fully implemented and functional.
--token flag or ~/.kagi_session_token filepackage.json - Project configuration with ES modules, Commander.js and Cheerio dependenciesSPEC.md - Complete project specification and requirementsexample-search-result-page.html - Sample Kagi search page for parsing referenceindex.js - Main CLI entry point with command dispatcher and Commander.js setupsrc/web-client.js - Core functionality with HTTP requests, HTML parsing, and streaming JSON parsingsrc/commands/search.js - Search command implementationsrc/commands/summarize.js - Summarizer command implementationsrc/utils/auth.js - Authentication utilities and token resolutionsrc/utils/help-text.js - Shared help text constantsThe tool uses a command-based structure with Commander.js. Callable as
kagi-ken-cli after npm installation, or ./index.js during development. Main commands:
search <query> - Perform a search with optional --token flagsummarize - Summarize URL or text content with --url/--text, --type, --language optionshelp [command] - Display help for commandsES Modules architecture with
node: prefix for built-in modules.
--token flag first in command implementations~/.kagi_session_token file using resolveToken() from src/utils/auth.jskagi_session cookie when querying Kagi via src/web-client.jsUses Kagi's
/mother/summary_labs endpoint with streaming responses:
output_data.markdownUses Cheerio with CSS selectors to extract search results from Kagi's HTML:
.search-result) with titles (.__sri_title_link), URLs, and snippets (.__sri-desc).sr-group .__srgi) for result clusters.related-searches a span) for search suggestionsnpm install - Install dependencies (Commander.js, Cheerio)./index.js search "query" --token token - Run search during development./index.js summarize --url "https://example.com" --token token - Run summarizer during development./index.js help or ./index.js help search - Show helpnpm link - Link for global testing during developmentnpm test - Currently not implemented (shows error message)# Show help kagi-ken-cli kagi-ken-cli help kagi-ken-cli help search kagi-ken-cli summarize --help # Search with token flag kagi-ken-cli search "search query" --token a1b2c3d4e5f6g7h8i9j0 # Summarize URL with defaults (type=summary, language=EN) kagi-ken-cli summarize --url "https://example.com/article" --token a1b2c3d4e5f6g7h8i9j0 # Summarize text with custom options kagi-ken-cli summarize --text "Long text content..." --type takeaway --language DE --token token # Using token file for both commands echo "a1b2c3d4e5f6g7h8i9j0" > ~/.kagi_session_token kagi-ken-cli search "search query" kagi-ken-cli summarize --url "https://example.com"