Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计提醒

exa-context前上下文

Agent Skill

exa-context 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

196

周安装

8

GitHub Stars

2

下载量

63
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:exa-context(前上下文)
来源仓库:https://github.com/benjaminjackson/exa-skills
仓库路径:skills/exa-context
安装命令:
npx skills add https://github.com/benjaminjackson/exa-skills --skill exa-context
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/benjaminjackson/exa-skills --skill exa-context

简介

exa-context 提供 token 高效的内容检索策略,优化代码上下文的获取效率。

  • 适用于 RAG 应用中精准提取相关片段、减少冗余信息或控制成本支出的场景。
  • 支持动态 token 计数与多格式输出选择,平衡精度与资源消耗。
  • 必须遵循输出格式选择规则,优先使用 text 格式直接嵌入提示词。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Exa Context

Token-efficient strategies for retrieving code context using exa-ai.

Use --help to see available commands and verify usage before running:

exa-ai <command> --help

Critical Requirements

MUST follow these rules when using exa-ai context:

Shared Requirements

This skill inherits requirements from Common Requirements:

  • Output format selection → All output operations

MUST Rules

  1. Use dynamic tokens: Default --tokens-num dynamic adapts to content; specify exact number only when needed

SHOULD Rules

  1. Prefer text format: Use --output-format text for direct use in prompts or documentation (removes JSON wrapper overhead)

Cost Optimization

Pricing

  • 1-25 results: $0.005 per search
  • 26-100 results: $0.025 per search (5x more expensive)

Cost strategy:

  1. Default to 1-25 results: 5x cheaper, sufficient for most queries
  2. Need 50+ results? Run multiple targeted searches: Two 25-result searches with different angles beats one 50-result search (better quality, more control)
  3. Use 26-100 results sparingly: Only when you need comprehensive coverage that multiple targeted searches would miss

Token Optimization

Apply these strategies:

  • Use toon format: --output-format toon for 40% fewer tokens than JSON (use when reading output directly)
  • Use text format: --output-format text to get raw context without JSON wrapper (ideal for piping to other commands)
  • Use JSON + jq: Extract only the context field with jq when processing programmatically
  • Set token limits: Use --tokens-num N to control response size

IMPORTANT: Choose one approach, don't mix them:

  • Approach 1: text format - Raw context output for direct use (no JSON wrapper)
  • Approach 2: toon format - Compact YAML-like output for direct reading
  • Approach 3: JSON + jq - Extract context field programmatically

Examples:

# ❌ High token usage - full JSON wrapper
exa-ai context "React hooks"

# ✅ Approach 1: text format for direct use (removes JSON overhead)
exa-ai context "React hooks" --output-format text

# ✅ Approach 2: toon format for reading (40% reduction)
exa-ai context "React hooks" --output-format toon

# ✅ Approach 3: JSON + jq to extract context only
exa-ai context "React hooks" | jq -r '.context'

Quick Start

Basic Context Retrieval

exa-ai context "React hooks useState useEffect" --output-format toon

Specific Token Limit

exa-ai context "Python async/await patterns" --tokens-num 5000

Authentication Patterns

exa-ai context "JWT authentication with Ruby on Rails" \
  --tokens-num 3000 \
  --output-format text

Extract Context for Direct Use

exa-ai context "GraphQL schema design best practices" \
  --tokens-num 4000 | jq -r '.context'

Detailed Reference

For complete options, examples, and advanced usage, consult REFERENCE.md.

Shared Requirements

Schema Design

MUST: Use object wrapper for schemas

Applies to: answer, search, find-similar, get-contents

When using schema parameters (--output-schema or --summary-schema), always wrap properties in an object:

{"type":"object","properties":{"field_name":{"type":"string"}}}

DO NOT use bare properties without the object wrapper:

{"properties":{"field_name":{"type":"string"}}}  // ❌ Missing "type":"object"

Why: The Exa API requires a valid JSON Schema with an object type at the root level. Omitting this causes validation errors.

Examples:

# ✅ CORRECT - object wrapper included
exa-ai search "AI news" \
  --summary-schema '{"type":"object","properties":{"headline":{"type":"string"}}}'

# ❌ WRONG - missing object wrapper
exa-ai search "AI news" \
  --summary-schema '{"properties":{"headline":{"type":"string"}}}'

Output Format Selection

MUST NOT: Mix toon format with jq

Applies to: answer, context, search, find-similar, get-contents

toon format produces YAML-like output, not JSON. DO NOT pipe toon output to jq for parsing:

# ❌ WRONG - toon is not JSON
exa-ai search "query" --output-format toon | jq -r '.results'

# ✅ CORRECT - use JSON (default) with jq
exa-ai search "query" | jq -r '.results[].title'

# ✅ CORRECT - use toon for direct reading only
exa-ai search "query" --output-format toon

Why: jq expects valid JSON input. toon format is designed for human readability and produces YAML-like output that jq cannot parse.

SHOULD: Choose one output approach

Applies to: answer, context, search, find-similar, get-contents

Pick one strategy and stick with it throughout your workflow:

  1. Approach 1: toon only - Compact YAML-like output for direct reading

- Use when: Reading output directly, no further processing needed - Token savings: ~40% reduction vs JSON - Example: exa-ai search "query" --output-format toon

  1. Approach 2: JSON + jq - Extract specific fields programmatically

- Use when: Need to extract specific fields or pipe to other commands - Token savings: ~80-90% reduction (extracts only needed fields) - Example: exa-ai search "query" | jq -r '.results[].title'

  1. Approach 3: Schemas + jq - Structured data extraction with validation

- Use when: Need consistent structured output across multiple queries - Token savings: ~85% reduction + consistent schema - Example: exa-ai search "query" --summary-schema '{...}' | jq -r '.results[].summary | fromjson'

Why: Mixing approaches increases complexity and token usage. Choosing one approach optimizes for your use case.


Shell Command Best Practices

MUST: Run commands directly, parse separately

Applies to: monitor, search (websets), research, and all skills using complex commands

When using the Bash tool with complex shell syntax, run commands directly and parse output in separate steps:

# ❌ WRONG - nested command substitution
webset_id=$(exa-ai webset-create --search '{"query":"..."}' | jq -r '.webset_id')

# ✅ CORRECT - run directly, then parse
exa-ai webset-create --search '{"query":"..."}'
# Then in a follow-up command:
webset_id=$(cat output.json | jq -r '.webset_id')

Why: Complex nested $(...) command substitutions can fail unpredictably in shell environments. Running commands directly and parsing separately improves reliability and makes debugging easier.

MUST NOT: Use nested command substitutions

Applies to: All skills when using complex multi-step operations

Avoid nesting multiple levels of command substitution:

# ❌ WRONG - deeply nested
result=$(exa-ai search "$(cat query.txt | tr '\n' ' ')" --num-results $(cat config.json | jq -r '.count'))

# ✅ CORRECT - sequential steps
query=$(cat query.txt | tr '\n' ' ')
count=$(cat config.json | jq -r '.count')
exa-ai search "$query" --num-results $count

Why: Nested command substitutions are fragile and hard to debug when they fail. Sequential steps make each operation explicit and easier to troubleshoot.

SHOULD: Break complex commands into sequential steps

Applies to: All skills when working with multi-step workflows

For readability and reliability, break complex operations into clear sequential steps:

# ❌ Less maintainable - everything in one line
exa-ai webset-create --search '{"query":"startups","count":1}' | jq -r '.webset_id' | xargs -I {} exa-ai webset-search-create {} --query "AI" --behavior override

# ✅ More maintainable - clear steps
exa-ai webset-create --search '{"query":"startups","count":1}'
webset_id=$(jq -r '.webset_id' < output.json)
exa-ai webset-search-create $webset_id --query "AI" --behavior override

Why: Sequential steps are easier to understand, debug, and modify. Each step can be verified independently.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.3%
按下载量换算22

Claude

34.12%
按下载量换算21

Cursor

19.25%
按下载量换算12

Gemini CLI

9.24%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/benjaminjackson/exa-skills --skill exa-context 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills