mirror of
https://github.com/tradecatlabs/vibe-coding-cn.git
synced 2026-08-17 12:58:07 +00:00
refactor: 移除 i18n 层级,将 zh 内容展开到根目录
- 删除 i18n/en/ 英文版本 - 将 i18n/zh/ 下的 documents/, prompts/, skills/, workflow/ 移至根目录 - 更新所有 i18n/zh/ 路径引用 - 更新 AGENTS.md 目录结构说明
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
# skills/claude-skills
|
||||
|
||||
This directory is a **meta-skill**: it turns arbitrary domain material (docs/APIs/code/specs) into a reusable Skill (`SKILL.md` + `references/` + `scripts/` + `assets/`), and ships an executable quality gate + scaffolding.
|
||||
|
||||
## Layout
|
||||
|
||||
```
|
||||
claude-skills/
|
||||
|-- AGENTS.md
|
||||
|-- SKILL.md
|
||||
|-- assets/
|
||||
| |-- template-minimal.md
|
||||
| `-- template-complete.md
|
||||
|-- scripts/
|
||||
| |-- create-skill.sh
|
||||
| `-- validate-skill.sh
|
||||
`-- references/
|
||||
|-- index.md
|
||||
|-- README.md
|
||||
|-- anti-patterns.md
|
||||
|-- quality-checklist.md
|
||||
`-- skill-spec.md
|
||||
```
|
||||
|
||||
## File Responsibilities
|
||||
|
||||
- `skills/claude-skills/SKILL.md`: entrypoint (triggers, deliverables, workflow, quality gate, tooling).
|
||||
- `skills/claude-skills/assets/template-minimal.md`: minimal template (small domains / quick bootstrap).
|
||||
- `skills/claude-skills/assets/template-complete.md`: full template (production-grade / complex domains).
|
||||
- `skills/claude-skills/scripts/create-skill.sh`: scaffold generator (minimal/full, output dir, overwrite).
|
||||
- `skills/claude-skills/scripts/validate-skill.sh`: spec validator (supports `--strict`).
|
||||
- `skills/claude-skills/references/index.md`: navigation for this meta-skill's reference docs.
|
||||
- `skills/claude-skills/references/README.md`: upstream official reference (lightly adjusted to keep links working in this repo).
|
||||
- `skills/claude-skills/references/skill-spec.md`: the local Skill spec (MUST/SHOULD/NEVER).
|
||||
- `skills/claude-skills/references/quality-checklist.md`: quality gate checklist + scoring.
|
||||
- `skills/claude-skills/references/anti-patterns.md`: common failure modes and how to fix them.
|
||||
|
||||
## Dependencies & Boundaries
|
||||
|
||||
- `scripts/*.sh`: depend only on `bash` + common POSIX tooling (`sed/awk/grep/find`), no network required.
|
||||
- This directory is about "how to build Skills", not about any specific domain; domain knowledge belongs in `skills/<domain>/`.
|
||||
@@ -0,0 +1,243 @@
|
||||
---
|
||||
name: claude-skills
|
||||
description: "Claude Skills meta-skill: extract domain material (docs/APIs/code/specs) into a reusable Skill (SKILL.md + references/scripts/assets), and refactor existing Skills for clarity, activation reliability, and quality gates."
|
||||
---
|
||||
|
||||
# Claude Skills Meta-Skill
|
||||
|
||||
Turn scattered domain material into a Skill that is reusable, maintainable, and reliably activatable:
|
||||
- `SKILL.md` as the entrypoint (triggers, constraints, patterns, examples)
|
||||
- `references/` for long-form evidence and navigation
|
||||
- optional `scripts/` and `assets/` for scaffolding and templates
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
Trigger this meta-skill when you need to:
|
||||
- Create a new Skill from scratch from docs/specs/repos
|
||||
- Refactor an existing Skill (too long, unclear, inconsistent, misfires)
|
||||
- Design reliable activation (frontmatter + triggers + boundaries)
|
||||
- Extract a clean Quick Reference from large material
|
||||
- Split long content into navigable `references/`
|
||||
- Add a quality gate and a validator
|
||||
|
||||
## Not For / Boundaries
|
||||
|
||||
This meta-skill is NOT:
|
||||
- A domain Skill by itself (it builds domain Skills)
|
||||
- A license to invent external facts (if the material does not prove it, say so and add a verification path)
|
||||
- A substitute for required inputs (if inputs are missing, ask 1-3 questions before proceeding)
|
||||
|
||||
## Quick Reference
|
||||
|
||||
### Deliverables (What You Must Produce)
|
||||
|
||||
Your output MUST include:
|
||||
1. A concrete directory layout (typically `skills/<skill-name>/`)
|
||||
2. An actionable `SKILL.md` with decidable triggers, boundaries, and reproducible examples
|
||||
3. Long-form docs moved to `references/` with a `references/index.md`
|
||||
4. A pre-delivery checklist (Quality Gate)
|
||||
|
||||
### Recommended Layout (Minimal -> Full)
|
||||
|
||||
```
|
||||
skill-name/
|
||||
|-- SKILL.md # Required: entrypoint with YAML frontmatter
|
||||
|-- references/ # Optional: long-form docs/evidence/index
|
||||
| `-- index.md # Recommended: navigation index
|
||||
|-- scripts/ # Optional: helpers/automation
|
||||
`-- assets/ # Optional: templates/configs/static assets
|
||||
```
|
||||
|
||||
The truly minimal version is just `SKILL.md` (you can add `references/` later).
|
||||
|
||||
### YAML Frontmatter (Required)
|
||||
|
||||
```yaml
|
||||
---
|
||||
name: skill-name
|
||||
description: "What it does + when to use (activation triggers)."
|
||||
---
|
||||
```
|
||||
|
||||
Frontmatter rules:
|
||||
- `name` MUST match `^[a-z][a-z0-9-]*$` and SHOULD match the directory name
|
||||
- `description` MUST be decidable (not "helps with X") and include concrete trigger keywords
|
||||
|
||||
### Minimal `SKILL.md` Skeleton (Copy/Paste)
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: my-skill
|
||||
description: "[Domain] capability: includes [capability 1], [capability 2]. Use when [decidable triggers]."
|
||||
---
|
||||
|
||||
# my-skill Skill
|
||||
|
||||
One sentence that states the boundary and the deliverable.
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
Trigger when any of these applies:
|
||||
- [Trigger 1: concrete task/keyword]
|
||||
- [Trigger 2]
|
||||
- [Trigger 3]
|
||||
|
||||
## Not For / Boundaries
|
||||
|
||||
- What this skill will not do (prevents misfires and over-promising)
|
||||
- Required inputs; ask 1-3 questions if missing
|
||||
|
||||
## Quick Reference
|
||||
|
||||
### Common Patterns
|
||||
|
||||
**Pattern 1:** one-line explanation
|
||||
```text
|
||||
[command/snippet you can paste and run]
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1
|
||||
- Input:
|
||||
- Steps:
|
||||
- Expected output / acceptance:
|
||||
|
||||
### Example 2
|
||||
|
||||
### Example 3
|
||||
|
||||
## References
|
||||
|
||||
- `references/index.md`: navigation
|
||||
- `references/...`: long-form docs split by topic
|
||||
|
||||
## Maintenance
|
||||
|
||||
- Sources: docs/repos/specs (do not invent)
|
||||
- Last updated: YYYY-MM-DD
|
||||
- Known limits: what is explicitly out of scope
|
||||
```
|
||||
|
||||
### Authoring Rules (Non-negotiable)
|
||||
|
||||
1. Quick Reference is for short, directly usable patterns
|
||||
- Keep it <= 20 patterns when possible.
|
||||
- Anything that needs paragraphs of explanation goes to `references/`.
|
||||
2. Activation must be decidable
|
||||
- Frontmatter `description` should say "what + when" with concrete keywords.
|
||||
- "When to Use" must list specific tasks/inputs/goals, not vague help text.
|
||||
- "Not For / Boundaries" is mandatory for reliability.
|
||||
3. No bluffing on external details
|
||||
- If the material does not prove it, say so and include a verification path.
|
||||
|
||||
### Workflow (Material -> Skill)
|
||||
|
||||
Do not skip steps:
|
||||
1. Scope: write MUST/SHOULD/NEVER (three sentences total is fine)
|
||||
2. Extract patterns: pick 10-20 high-frequency patterns (commands/snippets/flows)
|
||||
3. Add examples: >= 3 end-to-end examples (input -> steps -> acceptance)
|
||||
4. Define boundaries: what is out-of-scope + required inputs
|
||||
5. Split references: move long text into `references/` + write `references/index.md`
|
||||
6. Apply the gate: run the checklist and the validator
|
||||
|
||||
### Quality Gate (Pre-delivery Checklist)
|
||||
|
||||
Minimum checks (see `references/quality-checklist.md` for the full version):
|
||||
1. `name` matches `^[a-z][a-z0-9-]*$` and matches the directory name
|
||||
2. `description` states "what + when" with concrete trigger keywords
|
||||
3. Has "When to Use This Skill" with decidable triggers
|
||||
4. Has "Not For / Boundaries" to reduce misfires
|
||||
5. Quick Reference is <= 20 patterns and each is directly usable
|
||||
6. Has >= 3 reproducible examples
|
||||
7. Long content is in `references/` and `references/index.md` is navigable
|
||||
8. Uncertain claims include a verification path (no bluffing)
|
||||
9. Reads like an operator's manual, not a documentation dump
|
||||
|
||||
Validate locally:
|
||||
|
||||
```bash
|
||||
# From repo root (basic validation)
|
||||
./skills/claude-skills/scripts/validate-skill.sh skills/<skill-name>
|
||||
|
||||
# From repo root (strict validation)
|
||||
./skills/claude-skills/scripts/validate-skill.sh skills/<skill-name> --strict
|
||||
|
||||
# From skills/claude-skills/ (basic validation)
|
||||
./scripts/validate-skill.sh ../<skill-name>
|
||||
|
||||
# From skills/claude-skills/ (strict validation)
|
||||
./scripts/validate-skill.sh ../<skill-name> --strict
|
||||
```
|
||||
|
||||
### Tools & Templates
|
||||
|
||||
Generate a new Skill skeleton:
|
||||
|
||||
```bash
|
||||
# From repo root (generate into ./skills/)
|
||||
./skills/claude-skills/scripts/create-skill.sh my-skill --full --output skills
|
||||
|
||||
# From skills/claude-skills/ (generate into ../ i.e. ./skills/)
|
||||
./scripts/create-skill.sh my-skill --full --output ..
|
||||
|
||||
# Minimal skeleton
|
||||
./skills/claude-skills/scripts/create-skill.sh my-skill --minimal --output skills
|
||||
```
|
||||
|
||||
Templates:
|
||||
- `assets/template-minimal.md`
|
||||
- `assets/template-complete.md`
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1: Create a Skill from Docs
|
||||
|
||||
- Input: an official doc/spec + 2-3 real code samples + common failure modes
|
||||
- Steps:
|
||||
1. Run `create-skill.sh` to scaffold `skills/<skill-name>/`
|
||||
2. Write frontmatter `description` as "what + when"
|
||||
3. Extract 10-20 high-frequency patterns into Quick Reference
|
||||
4. Add >= 3 end-to-end examples with acceptance criteria
|
||||
5. Put long content into `references/` and wire `references/index.md`
|
||||
6. Run `validate-skill.sh --strict` and iterate
|
||||
|
||||
### Example 2: Refactor a "Doc Dump" Skill
|
||||
|
||||
- Input: an existing `SKILL.md` with long pasted documentation
|
||||
- Steps:
|
||||
1. Identify which parts are patterns vs. long-form explanation
|
||||
2. Move long-form text into `references/` (split by topic)
|
||||
3. Rewrite Quick Reference as short copy/paste patterns
|
||||
4. Add or fix Examples until they are reproducible
|
||||
5. Add "Not For / Boundaries" to reduce misfires
|
||||
|
||||
### Example 3: Validate and Gate a Skill
|
||||
|
||||
- Input: `skills/<skill-name>/`
|
||||
- Steps:
|
||||
1. Run `validate-skill.sh` (non-strict) to get warnings
|
||||
2. Fix frontmatter/name mismatches and missing sections
|
||||
3. Run `validate-skill.sh --strict` to enforce the spec
|
||||
4. Run the scoring rubric in `references/quality-checklist.md` before shipping
|
||||
|
||||
## References
|
||||
|
||||
Local docs:
|
||||
- `references/index.md`
|
||||
- `references/skill-spec.md`
|
||||
- `references/quality-checklist.md`
|
||||
- `references/anti-patterns.md`
|
||||
- `references/README.md` (upstream official reference)
|
||||
|
||||
External (official):
|
||||
- https://support.claude.com/en/articles/12512176-what-are-skills
|
||||
- https://support.claude.com/en/articles/12512180-using-skills-in-claude
|
||||
- https://support.claude.com/en/articles/12512198-creating-custom-skills
|
||||
- https://docs.claude.com/en/api/skills-guide
|
||||
|
||||
## Maintenance
|
||||
|
||||
- Sources: local spec files in `skills/claude-skills/references/` + upstream official docs in `references/README.md`
|
||||
- Last updated: 2025-12-14
|
||||
- Known limits: `validate-skill.sh` is heuristic; strict mode assumes the recommended section headings
|
||||
@@ -0,0 +1,88 @@
|
||||
---
|
||||
name: {{skill_name}}
|
||||
description: "[Domain] end-to-end capability: includes [capability 1], [capability 2], [capability 3]. Use when [decidable triggers]."
|
||||
---
|
||||
|
||||
# {{skill_name}} Skill
|
||||
|
||||
Production-grade skill for [domain]: extract rules, patterns, and reproducible examples from source material (avoid documentation dumps).
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
Trigger when any of these applies:
|
||||
- You are designing/implementing/debugging [domain/tech]
|
||||
- You need to turn requirements into concrete commands/code/configs
|
||||
- You need common pitfalls, boundaries, and acceptance criteria
|
||||
|
||||
## Not For / Boundaries
|
||||
|
||||
- What this skill will not do (prevents misfires and over-promising)
|
||||
- Required inputs; ask 1-3 questions if missing
|
||||
|
||||
## Quick Reference
|
||||
|
||||
### Common Patterns
|
||||
|
||||
**Pattern 1:** one-line explanation
|
||||
```text
|
||||
[command/snippet you can paste and run]
|
||||
```
|
||||
|
||||
**Pattern 2:**
|
||||
```text
|
||||
[command/snippet you can paste and run]
|
||||
```
|
||||
|
||||
## Rules & Constraints
|
||||
|
||||
- MUST: non-negotiable rules (security boundaries, defaults, acceptance)
|
||||
- SHOULD: strong recommendations (best practices, performance habits)
|
||||
- NEVER: explicit prohibitions (dangerous ops, inventing facts)
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1
|
||||
- Input:
|
||||
- Steps:
|
||||
- Expected output / acceptance:
|
||||
|
||||
### Example 2
|
||||
|
||||
### Example 3
|
||||
|
||||
## FAQ
|
||||
|
||||
- Q: ...
|
||||
- A: ...
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- Symptom -> Likely causes -> Diagnosis -> Fix
|
||||
|
||||
## References
|
||||
|
||||
- `references/index.md`: navigation
|
||||
- `references/getting_started.md`: onboarding and vocabulary
|
||||
- `references/api.md`: API/CLI/config reference (if applicable)
|
||||
- `references/examples.md`: long examples and extra use cases
|
||||
- `references/troubleshooting.md`: edge cases and failure modes
|
||||
|
||||
## Maintenance
|
||||
|
||||
- Sources: docs/repos/specs (do not invent)
|
||||
- Last updated: YYYY-MM-DD
|
||||
- Known limits: what is explicitly out of scope
|
||||
|
||||
## Quality Gate
|
||||
|
||||
Minimum checks before shipping (see meta-skill `claude-skills` for the full version):
|
||||
|
||||
1. `description` is decidable ("what + when") and includes trigger keywords
|
||||
2. Has "When to Use This Skill" with decidable triggers
|
||||
3. Has "Not For / Boundaries" to reduce misfires
|
||||
4. Quick Reference is <= 20 patterns and each is directly usable
|
||||
5. Has >= 3 reproducible examples (input -> steps -> acceptance)
|
||||
6. Long content is in `references/` with a navigable `references/index.md`
|
||||
7. Uncertain claims include a verification path (no bluffing)
|
||||
8. No documentation dumps in Quick Reference
|
||||
9. Reads like an operator's manual, not a knowledge dump
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
name: {{skill_name}}
|
||||
description: "[Domain] capability: includes [key capability]. Use when [decidable triggers]."
|
||||
---
|
||||
|
||||
# {{skill_name}} Skill
|
||||
|
||||
One sentence that states the boundary and the deliverable.
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
Trigger when any of these applies:
|
||||
- [Trigger 1: concrete task/keyword]
|
||||
- [Trigger 2]
|
||||
- [Trigger 3]
|
||||
|
||||
## Not For / Boundaries
|
||||
|
||||
- What this skill will not do (prevents misfires and over-promising)
|
||||
- Required inputs; ask 1-3 questions if missing
|
||||
|
||||
## Quick Reference
|
||||
|
||||
### Common Patterns
|
||||
|
||||
**Pattern 1:** one-line explanation
|
||||
```text
|
||||
[command/snippet you can paste and run]
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1
|
||||
- Input:
|
||||
- Steps:
|
||||
- Expected output / acceptance:
|
||||
|
||||
### Example 2
|
||||
|
||||
### Example 3
|
||||
|
||||
## References
|
||||
|
||||
- `references/index.md`: navigation
|
||||
- `references/...`: long-form docs split by topic
|
||||
|
||||
## Maintenance
|
||||
|
||||
- Sources: docs/repos/specs (do not invent)
|
||||
- Last updated: YYYY-MM-DD
|
||||
@@ -0,0 +1,123 @@
|
||||
# Skills
|
||||
Skills are folders of instructions, scripts, and resources that Claude loads dynamically to improve performance on specialized tasks. Skills teach Claude how to complete specific tasks in a repeatable way, whether that's creating documents with your company's brand guidelines, analyzing data using your organization's specific workflows, or automating personal tasks.
|
||||
|
||||
For more information, check out:
|
||||
- [What are skills?](https://support.claude.com/en/articles/12512176-what-are-skills)
|
||||
- [Using skills in Claude](https://support.claude.com/en/articles/12512180-using-skills-in-claude)
|
||||
- [How to create custom skills](https://support.claude.com/en/articles/12512198-creating-custom-skills)
|
||||
- [Equipping agents for the real world with Agent Skills](https://anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills)
|
||||
|
||||
# About This Repository
|
||||
|
||||
This repository contains example skills that demonstrate what's possible with Claude's skills system. These examples range from creative applications (art, music, design) to technical tasks (testing web apps, MCP server generation) to enterprise workflows (communications, branding, etc.).
|
||||
|
||||
Each skill is self-contained in its own directory with a `SKILL.md` file containing the instructions and metadata that Claude uses. Browse through these examples to get inspiration for your own skills or to understand different patterns and approaches.
|
||||
|
||||
The example skills in this repo are open source (Apache 2.0). We've also included the document creation & editing skills that power [Claude's document capabilities](https://www.anthropic.com/news/create-files) under the hood in the [`skills/`](https://github.com/anthropics/skills/tree/main/skills) directory. These are source-available, not open source, but we wanted to share these with developers as a reference for more complex skills that are actively used in a production AI application.
|
||||
|
||||
**Note:** These are reference examples for inspiration and learning. They showcase general-purpose capabilities rather than organization-specific workflows or sensitive content.
|
||||
|
||||
## Disclaimer
|
||||
|
||||
**These skills are provided for demonstration and educational purposes only.** While some of these capabilities may be available in Claude, the implementations and behaviors you receive from Claude may differ from what is shown in these examples. These examples are meant to illustrate patterns and possibilities. Always test skills thoroughly in your own environment before relying on them for critical tasks.
|
||||
|
||||
# Example Skills
|
||||
|
||||
This repository includes a diverse collection of example skills demonstrating different capabilities:
|
||||
|
||||
## Creative & Design
|
||||
- **algorithmic-art** - Create generative art using p5.js with seeded randomness, flow fields, and particle systems
|
||||
- **canvas-design** - Design beautiful visual art in .png and .pdf formats using design philosophies
|
||||
- **slack-gif-creator** - Create animated GIFs optimized for Slack's size constraints
|
||||
|
||||
## Development & Technical
|
||||
- **artifacts-builder** - Build complex claude.ai HTML artifacts using React, Tailwind CSS, and shadcn/ui components
|
||||
- **mcp-server** - Guide for creating high-quality MCP servers to integrate external APIs and services
|
||||
- **webapp-testing** - Test local web applications using Playwright for UI verification and debugging
|
||||
|
||||
## Enterprise & Communication
|
||||
- **brand-guidelines** - Apply Anthropic's official brand colors and typography to artifacts
|
||||
- **internal-comms** - Write internal communications like status reports, newsletters, and FAQs
|
||||
- **theme-factory** - Style artifacts with 10 pre-set professional themes or generate custom themes on-the-fly
|
||||
|
||||
## Meta Skills
|
||||
- **skill-creator** - Guide for creating effective skills that extend Claude's capabilities
|
||||
- **template-skill** - A basic template to use as a starting point for new skills
|
||||
|
||||
# Document Skills
|
||||
|
||||
The `document-skills/` subdirectory contains skills that Anthropic developed to help Claude create various document file formats. These skills demonstrate advanced patterns for working with complex file formats and binary data:
|
||||
|
||||
- **docx** - Create, edit, and analyze Word documents with support for tracked changes, comments, formatting preservation, and text extraction
|
||||
- **pdf** - Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms
|
||||
- **pptx** - Create, edit, and analyze PowerPoint presentations with support for layouts, templates, charts, and automated slide generation
|
||||
- **xlsx** - Create, edit, and analyze Excel spreadsheets with support for formulas, formatting, data analysis, and visualization
|
||||
|
||||
**Important Disclaimer:** These document skills are point-in-time snapshots and are not actively maintained or updated. Versions of these skills ship pre-included with Claude. They are primarily intended as reference examples to illustrate how Anthropic approaches developing more complex skills that work with binary file formats and document structures.
|
||||
|
||||
# Try in Claude Code, Claude.ai, and the API
|
||||
|
||||
## Claude Code
|
||||
You can register this repository as a Claude Code Plugin marketplace by running the following command in Claude Code:
|
||||
```
|
||||
/plugin marketplace add anthropics/skills
|
||||
```
|
||||
|
||||
Then, to install a specific set of skills:
|
||||
1. Select `Browse and install plugins`
|
||||
2. Select `anthropic-agent-skills`
|
||||
3. Select `document-skills` or `example-skills`
|
||||
4. Select `Install now`
|
||||
|
||||
Alternatively, directly install either Plugin via:
|
||||
```
|
||||
/plugin install document-skills@anthropic-agent-skills
|
||||
/plugin install example-skills@anthropic-agent-skills
|
||||
```
|
||||
|
||||
After installing the plugin, you can use the skill by just mentioning it. For instance, if you install the `document-skills` plugin from the marketplace, you can ask Claude Code to do something like: "Use the PDF skill to extract the form fields from path/to/some-file.pdf"
|
||||
|
||||
## Claude.ai
|
||||
|
||||
These example skills are all already available to paid plans in Claude.ai.
|
||||
|
||||
To use any skill from this repository or upload custom skills, follow the instructions in [Using skills in Claude](https://support.claude.com/en/articles/12512180-using-skills-in-claude#h_a4222fa77b).
|
||||
|
||||
## Claude API
|
||||
|
||||
You can use Anthropic's pre-built skills, and upload custom skills, via the Claude API. See the [Skills API Quickstart](https://docs.claude.com/en/api/skills-guide#creating-a-skill) for more.
|
||||
|
||||
# Creating a Basic Skill
|
||||
|
||||
Skills are simple to create - just a folder with a `SKILL.md` file containing YAML frontmatter and instructions. You can use the **template-skill** in this repository as a starting point:
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: my-skill-name
|
||||
description: A clear description of what this skill does and when to use it
|
||||
---
|
||||
|
||||
# My Skill Name
|
||||
|
||||
[Add your instructions here that Claude will follow when this skill is active]
|
||||
|
||||
## Examples
|
||||
- Example usage 1
|
||||
- Example usage 2
|
||||
|
||||
## Guidelines
|
||||
- Guideline 1
|
||||
- Guideline 2
|
||||
```
|
||||
|
||||
The frontmatter requires only two fields:
|
||||
- `name` - A unique identifier for your skill (lowercase, hyphens for spaces)
|
||||
- `description` - A complete description of what the skill does and when to use it
|
||||
|
||||
The markdown content below contains the instructions, examples, and guidelines that Claude will follow. For more details, see [How to create custom skills](https://support.claude.com/en/articles/12512198-creating-custom-skills).
|
||||
|
||||
# Partner Skills
|
||||
|
||||
Skills are a great way to teach Claude how to get better at using specific pieces of software. As we see awesome example skills from partners, we may highlight some of them here:
|
||||
|
||||
- **Notion** - [Notion Skills for Claude](https://www.notion.so/notiondevs/Notion-Skills-for-Claude-28da4445d27180c7af1df7d8615723d0)
|
||||
@@ -0,0 +1,110 @@
|
||||
# Anti-Patterns (And How to Fix Them)
|
||||
|
||||
This file documents common ways Skills fail in practice. Use it when refactoring existing Skills.
|
||||
|
||||
## 1) Documentation Dump in Quick Reference
|
||||
|
||||
**Symptom**
|
||||
- Quick Reference contains paragraphs of text, pasted docs, or large excerpts.
|
||||
|
||||
**Why it fails**
|
||||
- Users cannot scan or reuse it.
|
||||
- The model treats it as "knowledge soup" rather than executable patterns.
|
||||
|
||||
**Fix**
|
||||
- Move long text into `references/` (split by topic).
|
||||
- Keep Quick Reference as <= 20 copy/paste patterns when possible.
|
||||
- Add Examples for anything non-trivial.
|
||||
|
||||
## 2) Vague Triggers ("Helps with X")
|
||||
|
||||
**Symptom**
|
||||
- `description` says "helps with databases" or similar.
|
||||
- "When to Use" is a generic list with no tasks/inputs/goals.
|
||||
|
||||
**Why it fails**
|
||||
- Activation becomes noisy and unpredictable.
|
||||
|
||||
**Fix**
|
||||
- Rewrite `description` as: "What + when".
|
||||
- In "When to Use", list decidable tasks:
|
||||
- "Writing migration SQL for PostgreSQL"
|
||||
- "Debugging a failing CCXT order placement"
|
||||
- Add "Not For / Boundaries" to prevent misfires.
|
||||
|
||||
## 3) Missing Boundaries
|
||||
|
||||
**Symptom**
|
||||
- The Skill never says what it will not do.
|
||||
|
||||
**Why it fails**
|
||||
- The model over-promises and makes unsafe assumptions.
|
||||
- The skill triggers in irrelevant contexts.
|
||||
|
||||
**Fix**
|
||||
- Add `## Not For / Boundaries` with:
|
||||
- explicit out-of-scope items
|
||||
- required inputs and what questions to ask when missing
|
||||
|
||||
## 4) Non-reproducible Examples
|
||||
|
||||
**Symptom**
|
||||
- Examples are pseudo-code, missing inputs, or missing expected outputs.
|
||||
|
||||
**Why it fails**
|
||||
- Users cannot trust or validate the behavior.
|
||||
|
||||
**Fix**
|
||||
- Each example should contain:
|
||||
- Input(s)
|
||||
- Steps
|
||||
- Expected output / acceptance criteria
|
||||
- Prefer minimal reproducible examples over big "showcase" code.
|
||||
|
||||
## 5) One Giant File Syndrome
|
||||
|
||||
**Symptom**
|
||||
- Everything is in `SKILL.md` (or one huge reference file).
|
||||
|
||||
**Why it fails**
|
||||
- The entrypoint becomes unscannable and hard to maintain.
|
||||
|
||||
**Fix**
|
||||
- Keep `SKILL.md` execution-focused (patterns + examples + boundaries).
|
||||
- Split long content into `references/` and add `references/index.md`.
|
||||
|
||||
## 6) Invented Facts and Unverifiable Claims
|
||||
|
||||
**Symptom**
|
||||
- The Skill claims API fields/flags/commands without citing sources.
|
||||
|
||||
**Why it fails**
|
||||
- Incorrect guidance is worse than missing guidance.
|
||||
|
||||
**Fix**
|
||||
- Add a "verification path": where/how to confirm in official docs or source code.
|
||||
- Prefer statements backed by your material; mark assumptions explicitly.
|
||||
|
||||
## 7) Unsafe Defaults and Destructive Commands
|
||||
|
||||
**Symptom**
|
||||
- The Skill suggests destructive commands as the default path.
|
||||
|
||||
**Why it fails**
|
||||
- Users copy/paste and lose data.
|
||||
|
||||
**Fix**
|
||||
- Put destructive actions behind explicit warnings and confirmation steps.
|
||||
- Prefer read-only diagnostics first.
|
||||
|
||||
## 8) Inconsistent Terminology
|
||||
|
||||
**Symptom**
|
||||
- Same concept has multiple names; different concepts share a name.
|
||||
|
||||
**Why it fails**
|
||||
- Increases cognitive load and produces inconsistent outputs.
|
||||
|
||||
**Fix**
|
||||
- Add a short glossary (in `references/getting_started.md` or similar).
|
||||
- Use one concept, one name.
|
||||
@@ -0,0 +1,26 @@
|
||||
# Claude Skills Meta-Skill Reference Index
|
||||
|
||||
This directory contains long-form documentation that supports the `claude-skills` meta-skill.
|
||||
|
||||
## Start Here
|
||||
|
||||
- [`../SKILL.md`](../SKILL.md): the meta-skill entrypoint (workflow, quality gate, tooling)
|
||||
|
||||
## Local Reference Docs (This Repo)
|
||||
|
||||
- [`skill-spec.md`](skill-spec.md): normative spec (MUST/SHOULD/NEVER) for a production-grade Skill in this repo
|
||||
- [`quality-checklist.md`](quality-checklist.md): quality gate checklist + scoring rubric
|
||||
- [`anti-patterns.md`](anti-patterns.md): common failure modes and how to fix them
|
||||
|
||||
## Upstream / Official Reference
|
||||
|
||||
- [`README.md`](README.md): upstream overview of Claude Skills (what skills are, usage, examples)
|
||||
|
||||
## External Links (Official)
|
||||
|
||||
- What are skills? https://support.claude.com/en/articles/12512176-what-are-skills
|
||||
- Using skills in Claude https://support.claude.com/en/articles/12512180-using-skills-in-claude
|
||||
- Creating custom skills https://support.claude.com/en/articles/12512198-creating-custom-skills
|
||||
- Skills API Quickstart https://docs.claude.com/en/api/skills-guide
|
||||
- Anthropic Skills GitHub https://github.com/anthropics/skills
|
||||
- Engineering blog: Agent Skills https://anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills
|
||||
@@ -0,0 +1,49 @@
|
||||
# Quality Checklist (Production Gate)
|
||||
|
||||
Use this checklist to decide whether a Skill is shippable. It is intentionally biased toward reliability and maintainability over "more content".
|
||||
|
||||
## Scoring
|
||||
|
||||
Score each item:
|
||||
- 2 = fully satisfied
|
||||
- 1 = partially satisfied / needs work
|
||||
- 0 = missing
|
||||
|
||||
Suggested ship threshold:
|
||||
- Total score >= 24 (out of 32)
|
||||
- No "critical" item below 2
|
||||
|
||||
## A. Activation Reliability (Critical)
|
||||
|
||||
1. Frontmatter `name` matches `^[a-z][a-z0-9-]*$` and matches directory name (2)
|
||||
2. Frontmatter `description` is decidable ("what + when") with concrete keywords (2)
|
||||
3. `## When to Use This Skill` lists concrete tasks/inputs/goals (2)
|
||||
4. `## Not For / Boundaries` exists and meaningfully prevents misfires (2)
|
||||
|
||||
## B. Usability (Critical)
|
||||
|
||||
5. `## Quick Reference` is short and directly usable (no doc dumps) (2)
|
||||
6. Quick Reference patterns are formatted for copy/paste (2)
|
||||
7. `## Examples` contains >= 3 reproducible examples (2)
|
||||
8. Examples include acceptance criteria / expected output (2)
|
||||
|
||||
## C. Evidence & Correctness
|
||||
|
||||
9. `## Maintenance` lists sources (docs/repos/specs) and last-updated date (2)
|
||||
10. Uncertain external details include a verification path (2)
|
||||
11. Terminology is consistent (one concept, one name) (2)
|
||||
12. No contradictions between Quick Reference and Examples (2)
|
||||
|
||||
## D. Structure & Maintainability
|
||||
|
||||
13. Long-form content lives in `references/` with `references/index.md` navigation (2)
|
||||
14. Reference files are split by topic (not one giant file) (2)
|
||||
15. The skill reads like an operator manual (task -> steps -> acceptance) (2)
|
||||
16. Optional: scripts/assets are minimal and clearly scoped (2)
|
||||
|
||||
## Common Reasons to Fail the Gate
|
||||
|
||||
- Vague activation ("helps with X") with no boundaries
|
||||
- Quick Reference contains pasted documentation instead of patterns
|
||||
- Examples are not reproducible (no inputs, no steps, no expected output)
|
||||
- No sources and no update date (cannot be trusted or maintained)
|
||||
@@ -0,0 +1,111 @@
|
||||
# Skill Spec (This Repo)
|
||||
|
||||
This document defines what a "production-grade Skill" means in this repository. Use it as the source of truth when creating or refactoring anything under `skills/`.
|
||||
|
||||
Keywords: MUST / SHOULD / MAY / MUST NOT / SHOULD NOT are normative.
|
||||
|
||||
## 1. Directory & Naming
|
||||
|
||||
- A Skill MUST be a directory under `skills/` named after its `name` field.
|
||||
- The directory name MUST match `^[a-z][a-z0-9-]*$`.
|
||||
- The Skill entrypoint MUST be `SKILL.md` at the root of the skill directory.
|
||||
|
||||
## 2. Frontmatter (Required)
|
||||
|
||||
`SKILL.md` MUST start with YAML frontmatter:
|
||||
|
||||
```yaml
|
||||
---
|
||||
name: skill-name
|
||||
description: "What it does + when to use (activation triggers)."
|
||||
---
|
||||
```
|
||||
|
||||
Rules:
|
||||
- `name` MUST match `^[a-z][a-z0-9-]*$`.
|
||||
- `name` SHOULD equal the directory name.
|
||||
- `description` MUST be decidable and operational:
|
||||
- Good: "X development and debugging. Use when doing A/B/C."
|
||||
- Bad: "Helps with X."
|
||||
|
||||
## 3. SKILL.md Structure
|
||||
|
||||
### 3.1 Required Sections
|
||||
|
||||
`SKILL.md` SHOULD follow this section order, and in strict mode it MUST:
|
||||
|
||||
1. `## When to Use This Skill`
|
||||
2. `## Not For / Boundaries`
|
||||
3. `## Quick Reference`
|
||||
4. `## Examples`
|
||||
5. `## References`
|
||||
6. `## Maintenance`
|
||||
|
||||
Rationale:
|
||||
- Activation reliability depends on explicit triggers and boundaries.
|
||||
- Usability depends on short patterns and reproducible examples.
|
||||
- Maintainability depends on sources and navigable references.
|
||||
|
||||
### 3.2 Quick Reference Rules
|
||||
|
||||
- Quick Reference MUST contain short, directly usable patterns.
|
||||
- Quick Reference MUST NOT become a documentation dump.
|
||||
- Long explanations SHOULD go to `references/`.
|
||||
- A good target is <= 20 patterns, but large domains may justify more.
|
||||
|
||||
### 3.3 Example Rules
|
||||
|
||||
- The Examples section MUST contain reproducible examples.
|
||||
- Each example SHOULD specify:
|
||||
- input(s)
|
||||
- steps
|
||||
- expected output / acceptance criteria
|
||||
- Pseudo-code MAY be used only if the platform is unavailable, and MUST be clearly labeled.
|
||||
|
||||
### 3.4 Boundaries Rules
|
||||
|
||||
- "Not For / Boundaries" MUST list:
|
||||
- explicit out-of-scope items (to prevent misfires)
|
||||
- required inputs and what to ask when missing (1-3 questions)
|
||||
|
||||
## 4. references/ (Long-form Docs)
|
||||
|
||||
- `references/` SHOULD exist when the domain has:
|
||||
- long docs
|
||||
- many edge cases
|
||||
- extensive APIs/CLIs/config surfaces
|
||||
- If `references/` exists, it SHOULD include:
|
||||
- `references/index.md` as a navigation entrypoint
|
||||
|
||||
Guideline:
|
||||
- `references/` is for evidence, depth, and navigation.
|
||||
- `SKILL.md` is for execution: short patterns + examples + constraints.
|
||||
|
||||
## 5. scripts/ and assets/
|
||||
|
||||
- `scripts/` MAY contain helper automation (generators, validators, setup).
|
||||
- Scripts MUST be non-interactive by default.
|
||||
- Scripts MUST NOT require network access unless explicitly stated.
|
||||
- `assets/` MAY contain templates, configs, or static resources.
|
||||
|
||||
## 6. Safety & Integrity
|
||||
|
||||
- Skills MUST NOT include secrets (API keys, tokens, credentials).
|
||||
- Skills MUST NOT invent external facts.
|
||||
- If uncertain, they MUST include a verification path (where/how to check).
|
||||
- Potentially destructive commands MUST be explicitly labeled and gated.
|
||||
|
||||
## 7. Maintenance Metadata
|
||||
|
||||
Each Skill SHOULD include a `## Maintenance` section with:
|
||||
- sources (docs/repos/specs)
|
||||
- last-updated date
|
||||
- known limits / non-goals
|
||||
|
||||
## 8. Quality Gate
|
||||
|
||||
Before shipping, run the checklist in `quality-checklist.md` and (if available) the validator:
|
||||
|
||||
```bash
|
||||
./skills/claude-skills/scripts/validate-skill.sh skills/<skill-name> --strict
|
||||
```
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# ==================== Help ====================
|
||||
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
Usage:
|
||||
create-skill.sh <skill-name> [--minimal|--full] [--output <dir>] [--force]
|
||||
|
||||
Notes:
|
||||
- <skill-name> MUST be lowercase, start with a letter, and only contain letters, digits, and hyphens
|
||||
- Default mode: --full
|
||||
- Default output: current directory (creates ./<skill-name>/)
|
||||
|
||||
Examples:
|
||||
./skills/claude-skills/scripts/create-skill.sh postgresql --full --output skills
|
||||
./skills/claude-skills/scripts/create-skill.sh my-api --minimal
|
||||
EOF
|
||||
}
|
||||
|
||||
die() {
|
||||
echo "Error: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# ==================== Arg Parsing ====================
|
||||
|
||||
skill_name=""
|
||||
mode="full"
|
||||
output_dir="."
|
||||
force=0
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
--minimal)
|
||||
mode="minimal"
|
||||
shift
|
||||
;;
|
||||
--full)
|
||||
mode="full"
|
||||
shift
|
||||
;;
|
||||
-o|--output)
|
||||
[[ $# -ge 2 ]] || die "--output requires a directory argument"
|
||||
output_dir="$2"
|
||||
shift 2
|
||||
;;
|
||||
-f|--force)
|
||||
force=1
|
||||
shift
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
-*)
|
||||
die "Unknown argument: $1 (use --help)"
|
||||
;;
|
||||
*)
|
||||
if [[ -z "$skill_name" ]]; then
|
||||
skill_name="$1"
|
||||
shift
|
||||
else
|
||||
die "Extra argument: $1 (only one <skill-name> is allowed)"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
[[ -n "$skill_name" ]] || { usage; exit 1; }
|
||||
|
||||
if [[ ! "$skill_name" =~ ^[a-z][a-z0-9-]*$ ]]; then
|
||||
die "skill-name must be lowercase, start with a letter, and only contain letters/digits/hyphens (e.g. my-skill-name)"
|
||||
fi
|
||||
|
||||
script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
||||
assets_dir="${script_dir}/../assets"
|
||||
|
||||
template_path=""
|
||||
case "$mode" in
|
||||
minimal) template_path="${assets_dir}/template-minimal.md" ;;
|
||||
full) template_path="${assets_dir}/template-complete.md" ;;
|
||||
*) die "Internal error: unknown mode=$mode" ;;
|
||||
esac
|
||||
|
||||
[[ -f "$template_path" ]] || die "Template not found: $template_path"
|
||||
|
||||
mkdir -p "$output_dir"
|
||||
|
||||
target_dir="${output_dir%/}/${skill_name}"
|
||||
|
||||
if [[ -e "$target_dir" && "$force" -ne 1 ]]; then
|
||||
die "Target already exists: $target_dir (use --force to overwrite)"
|
||||
fi
|
||||
|
||||
mkdir -p "$target_dir"/{assets,scripts,references}
|
||||
|
||||
# ==================== Write Files ====================
|
||||
|
||||
render_template() {
|
||||
local src="$1"
|
||||
local dest="$2"
|
||||
sed "s/{{skill_name}}/${skill_name}/g" "$src" > "$dest"
|
||||
}
|
||||
|
||||
render_template "$template_path" "$target_dir/SKILL.md"
|
||||
|
||||
cat > "$target_dir/references/index.md" <<EOF
|
||||
# ${skill_name} Reference Index
|
||||
|
||||
## Quick Links
|
||||
|
||||
- Getting started: \`getting_started.md\`
|
||||
- API/CLI/config: \`api.md\` (if applicable)
|
||||
- Examples: \`examples.md\`
|
||||
- Troubleshooting: \`troubleshooting.md\`
|
||||
|
||||
## Notes
|
||||
|
||||
- Put long-form content here: excerpts, evidence links, edge cases, FAQ
|
||||
- Keep \`SKILL.md\` Quick Reference short and directly usable
|
||||
EOF
|
||||
|
||||
if [[ "$mode" == "full" ]]; then
|
||||
cat > "$target_dir/references/getting_started.md" <<'EOF'
|
||||
# Getting Started & Vocabulary
|
||||
|
||||
## Goals
|
||||
|
||||
- Define the 10 most important terms in this domain
|
||||
- Provide the shortest path from zero to working
|
||||
EOF
|
||||
|
||||
cat > "$target_dir/references/api.md" <<'EOF'
|
||||
# API / CLI / Config Reference (If Applicable)
|
||||
|
||||
## Suggested Structure
|
||||
|
||||
- Organize by use case, not alphabetically
|
||||
- Key parameters: defaults, boundaries, common misuse
|
||||
- Common errors: message -> cause -> fix steps
|
||||
EOF
|
||||
|
||||
cat > "$target_dir/references/examples.md" <<'EOF'
|
||||
# Long Examples
|
||||
|
||||
Put examples longer than ~20 lines here, split by use case:
|
||||
|
||||
- Use case 1: ...
|
||||
- Use case 2: ...
|
||||
EOF
|
||||
|
||||
cat > "$target_dir/references/troubleshooting.md" <<'EOF'
|
||||
# Troubleshooting & Edge Cases
|
||||
|
||||
Write as: symptom -> likely causes -> diagnosis -> fix.
|
||||
EOF
|
||||
fi
|
||||
|
||||
# ==================== Summary ====================
|
||||
|
||||
echo ""
|
||||
echo "OK: Skill generated: $target_dir/"
|
||||
echo ""
|
||||
echo "Layout:"
|
||||
echo " $target_dir/"
|
||||
echo " |-- SKILL.md"
|
||||
echo " |-- assets/"
|
||||
echo " |-- scripts/"
|
||||
echo " \\-- references/"
|
||||
echo " \\-- index.md"
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo " 1) Edit $target_dir/SKILL.md (triggers/boundaries/quick reference/examples)"
|
||||
echo " 2) Put long-form docs into $target_dir/references/ and update index.md"
|
||||
+212
@@ -0,0 +1,212 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
Usage:
|
||||
validate-skill.sh <skill-dir> [--strict]
|
||||
|
||||
What it does:
|
||||
- Validates SKILL.md YAML frontmatter (name/description)
|
||||
- Performs lightweight structural checks
|
||||
- In --strict mode, enforces the recommended section layout
|
||||
|
||||
Examples:
|
||||
./skills/claude-skills/scripts/validate-skill.sh skills/postgresql
|
||||
./skills/claude-skills/scripts/validate-skill.sh skills/my-skill --strict
|
||||
EOF
|
||||
}
|
||||
|
||||
die() {
|
||||
echo "Error: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
warn() {
|
||||
echo "Warning: $*" >&2
|
||||
}
|
||||
|
||||
strict=0
|
||||
skill_dir=""
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
--strict)
|
||||
strict=1
|
||||
shift
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
-*)
|
||||
die "Unknown argument: $1 (use --help)"
|
||||
;;
|
||||
*)
|
||||
if [[ -z "$skill_dir" ]]; then
|
||||
skill_dir="$1"
|
||||
shift
|
||||
else
|
||||
die "Extra argument: $1 (only one <skill-dir> is allowed)"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
[[ -n "$skill_dir" ]] || { usage; exit 1; }
|
||||
[[ -d "$skill_dir" ]] || die "Not a directory: $skill_dir"
|
||||
|
||||
skill_md="$skill_dir/SKILL.md"
|
||||
[[ -f "$skill_md" ]] || die "Missing SKILL.md: $skill_md"
|
||||
|
||||
base_name="$(basename -- "${skill_dir%/}")"
|
||||
|
||||
# -------------------- Parse YAML frontmatter --------------------
|
||||
|
||||
frontmatter=""
|
||||
if frontmatter="$(
|
||||
awk '
|
||||
BEGIN { in_fm=0; closed=0 }
|
||||
NR==1 {
|
||||
if ($0 != "---") exit 2
|
||||
in_fm=1
|
||||
next
|
||||
}
|
||||
in_fm==1 {
|
||||
if ($0 == "---") { closed=1; exit 0 }
|
||||
print
|
||||
next
|
||||
}
|
||||
END {
|
||||
if (closed == 0) exit 3
|
||||
}
|
||||
' "$skill_md"
|
||||
)"; then
|
||||
:
|
||||
else
|
||||
rc=$?
|
||||
case "$rc" in
|
||||
2) die "SKILL.md must start with YAML frontmatter (--- as the first line)" ;;
|
||||
3) die "YAML frontmatter is not closed (missing ---)" ;;
|
||||
*) die "Failed to parse YAML frontmatter (awk exit=$rc)" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
name="$(
|
||||
printf "%s\n" "$frontmatter" | awk -F: '
|
||||
tolower($1) ~ /^name$/ {
|
||||
sub(/^[^:]*:[[:space:]]*/, "", $0)
|
||||
gsub(/[[:space:]]+$/, "", $0)
|
||||
print
|
||||
exit
|
||||
}
|
||||
'
|
||||
)"
|
||||
|
||||
description="$(
|
||||
printf "%s\n" "$frontmatter" | awk -F: '
|
||||
tolower($1) ~ /^description$/ {
|
||||
sub(/^[^:]*:[[:space:]]*/, "", $0)
|
||||
gsub(/[[:space:]]+$/, "", $0)
|
||||
print
|
||||
exit
|
||||
}
|
||||
'
|
||||
)"
|
||||
|
||||
[[ -n "$name" ]] || die "Missing frontmatter field: name"
|
||||
[[ -n "$description" ]] || die "Missing frontmatter field: description"
|
||||
|
||||
if [[ ! "$name" =~ ^[a-z][a-z0-9-]*$ ]]; then
|
||||
die "Invalid name: '$name' (expected ^[a-z][a-z0-9-]*$)"
|
||||
fi
|
||||
|
||||
if [[ "$strict" -eq 1 && "$name" != "$base_name" ]]; then
|
||||
die "Strict mode: frontmatter name ('$name') must match directory name ('$base_name')"
|
||||
fi
|
||||
|
||||
# -------------------- Strip fenced code blocks for section checks --------------------
|
||||
|
||||
filtered_md="$(mktemp)"
|
||||
trap 'rm -f "$filtered_md"' EXIT
|
||||
|
||||
awk '
|
||||
BEGIN { in_fence=0 }
|
||||
/^[[:space:]]*```/ { in_fence = !in_fence; next }
|
||||
in_fence==0 { print }
|
||||
' "$skill_md" > "$filtered_md"
|
||||
|
||||
# -------------------- Structural checks --------------------
|
||||
|
||||
required_h2=(
|
||||
"When to Use This Skill"
|
||||
"Not For / Boundaries"
|
||||
"Quick Reference"
|
||||
"Examples"
|
||||
"References"
|
||||
"Maintenance"
|
||||
)
|
||||
|
||||
for title in "${required_h2[@]}"; do
|
||||
if ! grep -Eq "^##[[:space:]]+${title}([[:space:]]*)$" "$filtered_md"; then
|
||||
if [[ "$strict" -eq 1 ]]; then
|
||||
die "Strict mode: missing required section heading: '## ${title}'"
|
||||
fi
|
||||
warn "Missing recommended section heading: '## ${title}'"
|
||||
fi
|
||||
done
|
||||
|
||||
# references/index.md presence (only enforced in strict mode when references/ exists)
|
||||
if [[ -d "$skill_dir/references" && "$strict" -eq 1 && ! -f "$skill_dir/references/index.md" ]]; then
|
||||
die "Strict mode: references/ exists but references/index.md is missing"
|
||||
fi
|
||||
|
||||
# -------------------- Heuristics: Quick Reference size --------------------
|
||||
|
||||
quick_start="$(awk 'match($0, /^##[[:space:]]+Quick Reference([[:space:]]*)$/){print NR; exit}' "$filtered_md" || true)"
|
||||
if [[ -n "$quick_start" ]]; then
|
||||
quick_end="$(awk -v s="$quick_start" 'NR>s && match($0, /^##[[:space:]]+/){print NR; exit}' "$filtered_md" || true)"
|
||||
total_lines="$(wc -l < "$filtered_md" | tr -d ' ')"
|
||||
if [[ -z "$quick_end" ]]; then
|
||||
quick_end="$((total_lines + 1))"
|
||||
fi
|
||||
quick_len="$((quick_end - quick_start - 1))"
|
||||
if [[ "$quick_len" -gt 250 ]]; then
|
||||
if [[ "$strict" -eq 1 ]]; then
|
||||
die "Strict mode: Quick Reference section is too long (${quick_len} lines). Move long-form text into references/."
|
||||
fi
|
||||
warn "Quick Reference section is large (${quick_len} lines). Consider moving long-form text into references/."
|
||||
fi
|
||||
fi
|
||||
|
||||
# -------------------- Heuristics: Examples count --------------------
|
||||
|
||||
examples_start="$(awk 'match($0, /^##[[:space:]]+Examples([[:space:]]*)$/){print NR; exit}' "$filtered_md" || true)"
|
||||
if [[ -n "$examples_start" ]]; then
|
||||
examples_end="$(awk -v s="$examples_start" 'NR>s && match($0, /^##[[:space:]]+/){print NR; exit}' "$filtered_md" || true)"
|
||||
total_lines="$(wc -l < "$filtered_md" | tr -d ' ')"
|
||||
if [[ -z "$examples_end" ]]; then
|
||||
examples_end="$((total_lines + 1))"
|
||||
fi
|
||||
|
||||
example_count="$(
|
||||
awk -v s="$examples_start" -v e="$examples_end" '
|
||||
NR>s && NR<e && match($0, /^###[[:space:]]+Example([[:space:]]|$)/) { c++ }
|
||||
END { print c+0 }
|
||||
' "$filtered_md"
|
||||
)"
|
||||
|
||||
if [[ "$example_count" -lt 3 ]]; then
|
||||
if [[ "$strict" -eq 1 ]]; then
|
||||
die "Strict mode: expected >= 3 examples (found ${example_count})."
|
||||
fi
|
||||
warn "Recommended: >= 3 examples (found ${example_count})."
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "OK: $skill_dir"
|
||||
@@ -0,0 +1,166 @@
|
||||
---
|
||||
name: sop-generator
|
||||
description: "标准作业程序(SOP)生成与规范化:将输入资料/需求/历史记录整理为可执行 SOP(结构化章节、步骤、控制点、异常处理、记录)。当用户要求“写 SOP/作业指导书/操作规程/流程说明”,或给出零散资料需要“整理成 SOP/流程”,或要求“按标准结构输出 SOP/质量检查”时使用。"
|
||||
---
|
||||
|
||||
# sop-generator Skill
|
||||
|
||||
将碎片化资料与需求,转化为**可执行、可审核、可复用**的 SOP 文档,并输出统一结构与质量检查。
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
触发条件(满足任一即可):
|
||||
- 明确要求:写 SOP / 标准作业程序 / 作业指导书 / 操作规程 / 流程说明
|
||||
- 给出零散记录、聊天日志、需求清单,要求“整理成 SOP/流程”
|
||||
- 要求“统一结构、含关键控制点/异常处理/记录表”的过程文档
|
||||
|
||||
## Not For / Boundaries
|
||||
|
||||
- 不替代**法律/医疗/高危工艺**的强制合规文件(需专业审核)
|
||||
- 不凭空编造组织内部流程;缺失信息必须**显式追问**
|
||||
- 不输出“只有结论、没有步骤”的说明书
|
||||
|
||||
## 必要输入(缺失则先问 1-3 个关键问题)
|
||||
|
||||
1. 目标与范围:SOP 解决什么问题?适用于谁/哪些场景?
|
||||
2. 关键产出:最终产物/结果是什么?验收标准如何定义?
|
||||
3. 资源与约束:必需工具、系统权限、合规要求、时限/成本
|
||||
|
||||
## 工作流(高层步骤)
|
||||
|
||||
1. **拆解任务边界**:识别是否存在多个主题(需要拆分多份 SOP)
|
||||
2. **抽取操作链路**:把目标拆成“输入 → 动作 → 输出”的步骤序列
|
||||
3. **标注控制点**:关键参数/质量阈值/安全风险
|
||||
4. **补齐异常处理**:偏离标准时的应对与升级路径
|
||||
5. **结构化输出**:按统一模板生成 SOP
|
||||
6. **质量自检**:完整性、可执行性、可追溯性
|
||||
|
||||
## 输出结构(统一模板)
|
||||
|
||||
```
|
||||
SOP 标题 / 文档编号
|
||||
版本与修订记录
|
||||
编制/审核/批准
|
||||
|
||||
1. 目的(Purpose)
|
||||
2. 适用范围(Scope)
|
||||
3. 术语与定义(Definitions)
|
||||
4. 角色与职责(Roles & Responsibilities)
|
||||
5. 资源与前置条件(Resources/Prerequisites)
|
||||
6. 标准作业步骤(Procedure)
|
||||
6.1 步骤 1(输入/动作/输出/耗时)
|
||||
6.2 步骤 2 ...
|
||||
7. 关键控制点与质量标准(Critical Control Points)
|
||||
8. 安全与风险提示(Safety/Risk)
|
||||
9. 异常处理与升级路径(Deviations/Escalation)
|
||||
10. 记录与表单(Records)
|
||||
11. 相关文件/参考资料(References)
|
||||
```
|
||||
|
||||
## Quick Reference
|
||||
|
||||
### Pattern 1: 一句话拆分判断
|
||||
```text
|
||||
如果输入里出现 >=2 个互不相关的目标/对象/系统,则拆分为多份 SOP;否则合并为一份并在范围中声明。
|
||||
```
|
||||
|
||||
### Pattern 2: 最小可行 SOP(MVP)
|
||||
```text
|
||||
目的 + 范围 + 资源 + 3-7 步骤 + 关键控制点 + 异常处理 + 记录
|
||||
```
|
||||
|
||||
### Pattern 3: 步骤写法模板
|
||||
```text
|
||||
步骤N:在[系统/地点]使用[工具]执行[动作],输入为[输入],输出为[输出],耗时/阈值为[参数]。
|
||||
```
|
||||
|
||||
### Pattern 4: 缺失信息快速追问
|
||||
```text
|
||||
请补充:1) 适用范围/角色 2) 关键产出与验收标准 3) 必需工具/系统权限
|
||||
```
|
||||
|
||||
### Pattern 5: 一键生成 SOP 模板(脚本)
|
||||
```text
|
||||
python skills/00-元技能/sop-generator/scripts/generate_sop.py --title "项目上线 SOP" --doc-id "SOP-001" --version "v1.0" --output sop.md
|
||||
```
|
||||
|
||||
### Pattern 6: 生成最小可行 SOP(MVP)
|
||||
```text
|
||||
python skills/00-元技能/sop-generator/scripts/generate_sop.py --title "巡检 SOP" --mvp --output sop-mvp.md
|
||||
```
|
||||
|
||||
## 规则与约束
|
||||
|
||||
- MUST:步骤必须可执行、可复现;关键控制点必须量化
|
||||
- SHOULD:每个步骤都包含输入/动作/输出;异常处理明确负责人
|
||||
- NEVER:用“自行判断/视情况而定”替代关键步骤
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1:从杂乱记录生成 SOP(多主题拆分)
|
||||
|
||||
- Input(节选):
|
||||
- “SOP 的定义、SOP 标准结构”
|
||||
- “mac 截屏到剪贴板快捷键”
|
||||
- “obs 同时推流 2 平台”
|
||||
- Steps:
|
||||
1) 识别为 3 个主题 → 拆分 3 份 SOP
|
||||
2) 每份按模板输出,并在范围里声明适用平台
|
||||
3) 对缺失信息(如 OS 版本/软件版本)提出追问
|
||||
- Expected output / acceptance:
|
||||
- 3 份独立 SOP;每份含步骤、控制点、异常处理
|
||||
|
||||
### Example 2:需求驱动 SOP(六爻因子生成)
|
||||
|
||||
- Input:
|
||||
- 目标:用“六爻”作为唯一占卜流派
|
||||
- 输出:方向、强度、置信、周期、原始卦象字段、解释
|
||||
- 约束:不涉及个人八字
|
||||
- Steps:
|
||||
1) 明确适用范围:仅物品/交易对/商品
|
||||
2) 设计步骤链:采集对象 → 起卦 → 解析 → 量化映射
|
||||
3) 定义关键控制点:字段一致性、量化尺度
|
||||
- Expected output / acceptance:
|
||||
- SOP 中包含字段定义表、量化公式/区间、异常处理(如数据不足)
|
||||
|
||||
### Example 3:基于仓库资料生成 SOP(项目试玩/运行)
|
||||
|
||||
- Input:
|
||||
- GitHub 仓库:BloopAI/vibe-kanban
|
||||
- 目标:快速试玩项目
|
||||
- Steps:
|
||||
1) 读取 README → 提取运行前置条件
|
||||
2) 输出“本地启动 SOP”:安装依赖、配置密钥、启动命令
|
||||
3) 标注关键控制点:API Key 必填、依赖管理工具
|
||||
- Expected output / acceptance:
|
||||
- 1 份“本地运行 SOP”,包含最少步骤与失败处理
|
||||
|
||||
## References
|
||||
|
||||
- `references/index.md`:导航与索引
|
||||
- `references/sop-foundations.md`:SOP 定义与核心特征
|
||||
- `references/sop-structure.md`:通用结构与章节说明
|
||||
- `references/writing-style.md`:写作与可执行性规范
|
||||
- `references/repo-vibe-kanban.md`:vibe-kanban 仓库摘要
|
||||
- `references/examples.md`:长样例与原始输入片段
|
||||
|
||||
## Assets & Scripts
|
||||
|
||||
- `assets/sop-template.md`:全量 SOP 模板
|
||||
- `assets/sop-mvp.md`:最小可行 SOP 模板
|
||||
- `assets/record-log-template.md`:记录表模板
|
||||
- `scripts/generate_sop.py`:模板生成脚本(支持全量/MVP)
|
||||
|
||||
## Maintenance
|
||||
|
||||
- Sources: 官方/权威 SOP 资料 + 仓库 README(见 references)
|
||||
- Last updated: 2026-01-20
|
||||
- Known limits: 需按具体行业/合规要求补充细则
|
||||
|
||||
## Quality Gate
|
||||
|
||||
1. `description` 可触发且包含关键词(SOP/作业指导书/操作规程)
|
||||
2. 有明确的输入缺口追问策略
|
||||
3. 输出结构包含控制点/异常处理/记录
|
||||
4. 至少 3 个可复现示例
|
||||
5. 参考资料独立拆分且可导航
|
||||
@@ -0,0 +1,11 @@
|
||||
# 记录表模板:{{title}}
|
||||
|
||||
| 字段 | 说明 | 示例 |
|
||||
|:---|:---|:---|
|
||||
| 记录编号 | 唯一标识 | SOP-2026-001 |
|
||||
| 操作人 | 执行人 | 张三 |
|
||||
| 操作时间 | 时间戳 | 2026-01-20 10:00 |
|
||||
| 关键参数 | 量化参数 | 温度=120℃ |
|
||||
| 结果 | 成功/失败 | 成功 |
|
||||
| 异常说明 | 若有偏差 | 传感器延迟 |
|
||||
| 处理动作 | 纠正措施 | 重新校准 |
|
||||
@@ -0,0 +1,35 @@
|
||||
# SOP 标题:{{title}}
|
||||
|
||||
文档编号:{{doc_id}}
|
||||
版本:{{version}}
|
||||
发布日期:{{date}}
|
||||
|
||||
---
|
||||
|
||||
## 1. 目的
|
||||
|
||||
(一句话说明目标)
|
||||
|
||||
## 2. 适用范围
|
||||
|
||||
(适用对象/场景)
|
||||
|
||||
## 3. 资源与前置条件
|
||||
|
||||
- 必需工具:
|
||||
- 前置条件:
|
||||
|
||||
## 4. 标准作业步骤
|
||||
|
||||
1. 步骤 1:输入 / 动作 / 输出 / 参数
|
||||
2. 步骤 2:
|
||||
3. 步骤 3:
|
||||
|
||||
## 5. 关键控制点与异常处理
|
||||
|
||||
- 关键控制点:
|
||||
- 异常处理:
|
||||
|
||||
## 6. 记录
|
||||
|
||||
- 记录名称与保存方式:
|
||||
@@ -0,0 +1,74 @@
|
||||
# SOP 标题:{{title}}
|
||||
|
||||
文档编号:{{doc_id}}
|
||||
版本:{{version}}
|
||||
发布日期:{{date}}
|
||||
编制:{{owner}} / 审核:{{reviewer}} / 批准:{{approver}}
|
||||
|
||||
---
|
||||
|
||||
## 1. 目的(Purpose)
|
||||
|
||||
(说明制定本 SOP 的目标与收益)
|
||||
|
||||
## 2. 适用范围(Scope)
|
||||
|
||||
(适用部门/岗位/系统/场景)
|
||||
|
||||
## 3. 术语与定义(Definitions)
|
||||
|
||||
(关键术语、缩写解释)
|
||||
|
||||
## 4. 角色与职责(Roles & Responsibilities)
|
||||
|
||||
- 角色 A:
|
||||
- 角色 B:
|
||||
|
||||
## 5. 资源与前置条件(Resources / Prerequisites)
|
||||
|
||||
- 必需工具:
|
||||
- 系统权限:
|
||||
- 前置条件:
|
||||
|
||||
## 6. 标准作业步骤(Procedure)
|
||||
|
||||
### 6.1 步骤 1
|
||||
|
||||
- 输入:
|
||||
- 动作:
|
||||
- 输出:
|
||||
- 参数/阈值:
|
||||
- 预计耗时:
|
||||
|
||||
### 6.2 步骤 2
|
||||
|
||||
- 输入:
|
||||
- 动作:
|
||||
- 输出:
|
||||
- 参数/阈值:
|
||||
- 预计耗时:
|
||||
|
||||
## 7. 关键控制点与质量标准(Critical Control Points)
|
||||
|
||||
- 控制点 1:阈值/标准/检验方法
|
||||
- 控制点 2:
|
||||
|
||||
## 8. 安全与风险提示(Safety / Risk)
|
||||
|
||||
- 风险点:
|
||||
- 防护措施:
|
||||
|
||||
## 9. 异常处理与升级路径(Deviations / Escalation)
|
||||
|
||||
- 异常类型 → 处理动作 → 负责人 → 升级条件
|
||||
|
||||
## 10. 记录与表单(Records)
|
||||
|
||||
- 记录名称:
|
||||
- 保存周期:
|
||||
- 存放位置:
|
||||
|
||||
## 11. 相关文件/参考资料(References)
|
||||
|
||||
- 相关 SOP/制度:
|
||||
- 外部规范:
|
||||
@@ -0,0 +1,45 @@
|
||||
# 长样例与原始资料
|
||||
|
||||
## 示例 A:原始资料(未清洗)
|
||||
|
||||
> 说明:以下为混杂输入,用于测试“拆分多主题 + 追问缺失信息”能力。
|
||||
|
||||
```
|
||||
历史记录
|
||||
最近
|
||||
SOP的定义
|
||||
https://github.com/BloopAI/vibe-kanban 帮我分析这个项目怎么玩?
|
||||
需求说明(简版) - 目标:用“六爻”作为唯一占卜流派,生成可量化的“测算因子”,用于物品/交易对/商品的分析(不涉及个人八字)。 - 输出要求:统一结构(方向、强度、置信、周期、原始卦象字段、解释
|
||||
mac粘贴宝历史的快捷键
|
||||
https://vscode.dev/tunnel/desktop-15prbve/Ubuntu/home/lenovo/.projects
|
||||
pypl包是什么
|
||||
https://x.com/EthRosamond/status/2011443034941268291?s=20
|
||||
PS C:\Users\Docker> node --version v24.13.0 PS C:\Users\Docker> npm --version npm : 无法加载文件 C:\Pro
|
||||
mac截屏到粘贴版
|
||||
> Error: Authentication failed. Please log into Factory or set a valid FACTORY_API_KEY environment
|
||||
root1@root1deMacBook-Pro ~ % npm i -g @openai/codex zsh: command not found: npm root1@root1deMacBook
|
||||
加密货币量化交易的github仓库有哪些,只要高星的
|
||||
Overleaf这个有必要买吗
|
||||
超高频策略策略相关的 的github开源框架仓库
|
||||
核查事实;> 结论:Binance Vision 不提供原始逐档盘口历史数据 | 数据类型 | Binance Vision | 说明 | |:---|:---|---|
|
||||
还是无法连接到服务器;[01.07 06:24:39] obs64.exe - obsproject.com:443 open through proxy 127.0.0.1:9909 SOCKS5
|
||||
OBS Studio 帮我找win11上能强制一个应用走代理的方法
|
||||
obs如何同时推流2个平台
|
||||
在win11上使用9910的代理启动;obs 的命令是什么
|
||||
```
|
||||
|
||||
## 示例 B:输出骨架(模板级)
|
||||
|
||||
```
|
||||
SOP 标题 / 编号 / 版本
|
||||
1. 目的
|
||||
2. 适用范围
|
||||
3. 术语与定义
|
||||
4. 角色与职责
|
||||
5. 资源与前置条件
|
||||
6. 标准作业步骤(输入/动作/输出)
|
||||
7. 关键控制点与质量标准
|
||||
8. 异常处理与升级
|
||||
9. 记录与表单
|
||||
10. 参考资料
|
||||
```
|
||||
@@ -0,0 +1,14 @@
|
||||
# sop-generator Reference Index
|
||||
|
||||
## 快速入口
|
||||
|
||||
- SOP 基础定义:`sop-foundations.md`
|
||||
- SOP 标准结构:`sop-structure.md`
|
||||
- 写作与可执行性规范:`writing-style.md`
|
||||
- 仓库样例:`repo-vibe-kanban.md`
|
||||
- 长样例与原始资料:`examples.md`
|
||||
|
||||
## 说明
|
||||
|
||||
- 参考资料只放长内容与证据来源
|
||||
- `SKILL.md` 保持可直接执行的简短模式
|
||||
@@ -0,0 +1,17 @@
|
||||
# 仓库摘要:BloopAI/vibe-kanban
|
||||
|
||||
## 项目定位(README 摘要)
|
||||
|
||||
- 项目是一个“live GPT task board”,强调可用自然语言管理与执行任务
|
||||
- 支持多模型供应商(OpenAI / Anthropic)
|
||||
- 以本地优先为导向(local-first)
|
||||
|
||||
## 快速运行要点(README 摘要)
|
||||
|
||||
- 安装依赖:`pnpm install`
|
||||
- 启动开发:`pnpm dev`
|
||||
- 需要配置模型供应商的 API Key
|
||||
|
||||
## 来源
|
||||
|
||||
- GitHub: https://github.com/BloopAI/vibe-kanban
|
||||
@@ -0,0 +1,17 @@
|
||||
# SOP 基础定义与价值
|
||||
|
||||
## 定义(权威来源摘要)
|
||||
|
||||
- SOP 是**书面文件**,用于描述对**经常/常规操作**的处理方式,目的是确保执行一致性与质量。
|
||||
- SOP 的价值:把关键步骤写清楚,降低差异与错误,便于培训与审核。
|
||||
|
||||
## 常见价值(面向生产/服务/管理场景)
|
||||
|
||||
- 让不同人员在同一流程上保持一致结果
|
||||
- 缩短新人上手时间、减少经验依赖
|
||||
- 明确责任与记录,便于追溯与复盘
|
||||
|
||||
## 来源
|
||||
|
||||
- U.S. EPA Quality Management Tools - Standard Operating Procedures
|
||||
https://www.epa.gov/quality/epa-quality-management-tools-standard-operating-procedures
|
||||
@@ -0,0 +1,24 @@
|
||||
# SOP 标准结构与章节要点
|
||||
|
||||
## 通用结构(合并多来源的常见章节)
|
||||
|
||||
1. **文档控制信息**:标题/编号、版本、修订记录、审批
|
||||
2. **目的(Purpose)**
|
||||
3. **范围(Scope)**
|
||||
4. **术语与定义(Definitions)**
|
||||
5. **职责(Responsibilities)**
|
||||
6. **程序/步骤(Procedures)**
|
||||
7. **记录与表单(Records / Forms)**
|
||||
8. **参考资料(References)**
|
||||
|
||||
> 不同行业/机构会有不同细分,但以上内容是高频核心块。
|
||||
|
||||
## 来源摘记
|
||||
|
||||
### Boston University SOP Appendix(结构清单)
|
||||
- 包含 Purpose/Scope、References、Definitions、Responsibilities、Procedures、Records/Forms、Additional Considerations
|
||||
https://www.bu.edu/tech/files/2020/04/BU-ISCII-SOP-Appendix-2020.pdf
|
||||
|
||||
### U.S. FDA SOP Template(章节目录)
|
||||
- 列出 Purpose、Scope、Policy、Responsibility、Procedures、References、Definitions、Exhibit、Revision History、Approval
|
||||
https://www.fda.gov/media/111941/download
|
||||
@@ -0,0 +1,21 @@
|
||||
# 写作与可执行性规范(经验性建议)
|
||||
|
||||
> 以下为可执行性写作经验,用于提升 SOP 的可读性与一致性。
|
||||
|
||||
## 结构化写法
|
||||
|
||||
- 每一步都写成“输入 → 动作 → 输出”
|
||||
- 统一编号与层级,避免超过 3 层缩进
|
||||
- 关键参数必须量化(时间、温度、阈值、比例、范围)
|
||||
|
||||
## 语言风格
|
||||
|
||||
- 使用祈使句与主动语态
|
||||
- 避免“视情况而定/自行判断”等模糊表述
|
||||
- 关键控制点明确责任人/岗位
|
||||
|
||||
## 质量自检
|
||||
|
||||
- 是否有遗漏的前置条件或依赖
|
||||
- 是否存在需要主观判断的关键步骤
|
||||
- 是否能被新人在 30 分钟内执行并得到一致结果
|
||||
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def load_template(template_path: Path) -> str:
|
||||
return template_path.read_text(encoding="utf-8")
|
||||
|
||||
|
||||
def render_template(template: str, values: dict) -> str:
|
||||
rendered = template
|
||||
for key, value in values.items():
|
||||
rendered = rendered.replace(f"{{{{{key}}}}}", value)
|
||||
return rendered
|
||||
|
||||
|
||||
def build_arg_parser() -> argparse.ArgumentParser:
|
||||
parser = argparse.ArgumentParser(
|
||||
description="生成 SOP 模板(全量/最小版),输出到文件或标准输出"
|
||||
)
|
||||
parser.add_argument("--title", required=True, help="SOP 标题")
|
||||
parser.add_argument("--doc-id", default="SOP-000", help="文档编号")
|
||||
parser.add_argument("--version", default="v1.0", help="版本号")
|
||||
parser.add_argument("--date", default=None, help="发布日期(默认今天)")
|
||||
parser.add_argument("--owner", default="未指定", help="编制人")
|
||||
parser.add_argument("--reviewer", default="未指定", help="审核人")
|
||||
parser.add_argument("--approver", default="未指定", help="批准人")
|
||||
parser.add_argument(
|
||||
"--mvp",
|
||||
action="store_true",
|
||||
help="使用最小可行 SOP 模板(MVP)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--output",
|
||||
default="-",
|
||||
help="输出路径,使用 '-' 表示标准输出",
|
||||
)
|
||||
return parser
|
||||
|
||||
|
||||
def main() -> None:
|
||||
args = build_arg_parser().parse_args()
|
||||
script_dir = Path(__file__).resolve().parent
|
||||
assets_dir = script_dir.parent / "assets"
|
||||
template_file = assets_dir / ("sop-mvp.md" if args.mvp else "sop-template.md")
|
||||
|
||||
if not template_file.exists():
|
||||
raise FileNotFoundError(f"找不到模板文件: {template_file}")
|
||||
|
||||
date_value = args.date or datetime.now().strftime("%Y-%m-%d")
|
||||
values = {
|
||||
"title": args.title,
|
||||
"doc_id": args.doc_id,
|
||||
"version": args.version,
|
||||
"date": date_value,
|
||||
"owner": args.owner,
|
||||
"reviewer": args.reviewer,
|
||||
"approver": args.approver,
|
||||
}
|
||||
|
||||
template = load_template(template_file)
|
||||
rendered = render_template(template, values)
|
||||
|
||||
if args.output == "-":
|
||||
print(rendered)
|
||||
return
|
||||
|
||||
output_path = Path(args.output)
|
||||
output_path.write_text(rendered, encoding="utf-8")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,39 @@
|
||||
# Canvas-Dev Skill
|
||||
|
||||
Canvas白板驱动开发技能,用于 AI 辅助架构设计与代码生成。
|
||||
|
||||
## 概述
|
||||
|
||||
此技能实现「图形是第一公民,代码是白板的序列化形式」的开发范式。
|
||||
|
||||
## 核心能力
|
||||
|
||||
1. **架构分析** - 从代码自动生成 Obsidian Canvas 白板
|
||||
2. **白板驱动编码** - 根据白板生成/修改代码
|
||||
3. **一致性检查** - 校验白板与代码同步状态
|
||||
|
||||
## 文件结构
|
||||
|
||||
```
|
||||
canvas-dev/
|
||||
├── SKILL.md # 技能入口(触发条件、模式、示例)
|
||||
├── references/
|
||||
│ ├── index.md # 导航索引
|
||||
│ ├── canvas-json-spec.md # Canvas JSON 规范
|
||||
│ ├── workflow-guide.md # 工作流指南
|
||||
│ └── prompts.md # 提示词集合
|
||||
├── scripts/ # 自动化脚本(预留)
|
||||
└── assets/ # 模板资源(预留)
|
||||
```
|
||||
|
||||
## 快速开始
|
||||
|
||||
1. 阅读 `SKILL.md` 了解触发条件和使用模式
|
||||
2. 参考 `references/workflow-guide.md` 了解完整工作流
|
||||
3. 使用 `references/prompts.md` 中的提示词
|
||||
|
||||
## 相关资源
|
||||
|
||||
- [Canvas白板驱动开发详解](../../documents/02-方法论/图形化AI协作-Canvas白板驱动开发.md)
|
||||
- [Canvas开发工作流](../../workflow/canvas-dev/)
|
||||
- [元技能: claude-skills](../00-元技能/claude-skills/SKILL.md)
|
||||
@@ -0,0 +1,224 @@
|
||||
---
|
||||
name: canvas-dev
|
||||
description: "Canvas白板驱动开发技能:Canvas白板作为唯一真相源,代码是其序列化形式。AI架构总师角色,自动生成富有洞察力的架构图。使用场景:生成架构白板、白板驱动编码、白板驱动重构、Code Review、团队协作、接手遗留项目。"
|
||||
---
|
||||
|
||||
# canvas-dev Skill
|
||||
|
||||
Canvas白板驱动开发:图形是第一公民,代码是白板的序列化形式。人类负责架构设计,AI负责代码实现。
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
触发条件(满足任一即可):
|
||||
- 需要生成项目架构白板(从代码 → 白板)
|
||||
- 需要根据白板生成代码(从白板 → 代码)
|
||||
- 需要白板驱动代码重构
|
||||
- 需要用白板辅助 Code Review
|
||||
- 需要用白板加速团队协作
|
||||
- 接手遗留项目需要快速理解架构
|
||||
|
||||
## Not For / Boundaries
|
||||
|
||||
此技能不适用于:
|
||||
- 纯文本文档生成(使用 Markdown)
|
||||
- 流程图/时序图(使用 Mermaid)
|
||||
- 不需要双向同步的静态架构图
|
||||
|
||||
必要输入(缺失时需询问):
|
||||
1. 项目类型:A) 单体应用 B) 微服务架构 C) 前后端分离?
|
||||
2. 白板粒度:A) 文件级 B) 类/函数级 C) 服务级?
|
||||
|
||||
## Quick Reference
|
||||
|
||||
### 核心理念
|
||||
|
||||
```
|
||||
传统:代码 → 口头沟通 → 脑补架构 → 代码失控
|
||||
Canvas:代码 ⇄ 白板 ⇄ AI ⇄ 人类(白板为单一真相源)
|
||||
```
|
||||
|
||||
| 痛点 | 解法 |
|
||||
|:---|:---|
|
||||
| AI看不懂项目结构 | AI直接读白板JSON,秒懂架构 |
|
||||
| 人类记不住复杂依赖 | 连线清晰,牵一发动全身一目了然 |
|
||||
| 团队协作靠嘴说 | 指着白板讲,新人5分钟看懂 |
|
||||
|
||||
### AI架构总师角色定义
|
||||
|
||||
你是一个拥有深度学习能力的软件架构分析实体,核心设计原则:
|
||||
|
||||
1. **洞察力优先于信息量**:目标不是简单罗列所有文件和连接,而是揭示项目的设计哲学、关键数据流、潜在风险和演进趋势
|
||||
2. **认知负荷最小化**:生成的可视化产物符合人类认知习惯,使用户能以最小脑力成本理解最复杂的系统结构
|
||||
3. **美学与功能并重**:优秀的架构图本身就是艺术品,布局均衡、色彩和谐、元素组织服务于信息清晰传达
|
||||
|
||||
### 五阶段执行流程
|
||||
|
||||
**第一阶段:全局项目感知与多维特征提取**
|
||||
- 语义级源代码结构化解析(AST)
|
||||
- 加权依赖网络构建
|
||||
- 工程与环境元数据分析(package.json, docker-compose.yml, CI/CD等)
|
||||
- 架构模式概率指纹识别
|
||||
|
||||
**第二阶段:自适应抽象粒度决策引擎**
|
||||
- 信息熵与复杂度评估,寻找"信息熵拐点"
|
||||
- 架构模式引导默认粒度
|
||||
- 用户意图启发式推断
|
||||
|
||||
**动态粒度光谱:**
|
||||
| 级别 | 说明 |
|
||||
|:---|:---|
|
||||
| D-系统生态级 | 巨型Monorepo,每个节点代表完整应用 |
|
||||
| C-宏观服务级 | 聚合数十个文件为单一功能领域节点 |
|
||||
| B-类/核心功能级 | 以关键业务逻辑类为节点 |
|
||||
| A-文件级 | 每个源文件为基础节点(推荐新手) |
|
||||
| F-函数/方法级 | 深度钻取,显示内部函数调用关系 |
|
||||
|
||||
**第三阶段:组件语义分析与关系定性**
|
||||
- 组件角色多因素推断(入口、控制器、服务、数据访问、工具)
|
||||
- 关系与数据流深度定性(同步调用、异步消息、事件发布/订阅)
|
||||
- 状态变化与副作用分析
|
||||
|
||||
**第四阶段:启发式布局与信息可视化引擎**
|
||||
- 自适应拓扑分层(入口→业务逻辑→数据持久化)
|
||||
- 力导向与集群化节点定位
|
||||
- 信息驱动的动态视觉编码
|
||||
|
||||
**第五阶段:输出生成与最终质量优化**
|
||||
- 迭代式去交叉与防重叠算法
|
||||
- 边捆绑与智能剪枝
|
||||
- 孤立节点上下文情景化分组
|
||||
- 认知路径优化
|
||||
|
||||
### AI驱动的节点文本模板
|
||||
|
||||
```markdown
|
||||
**{组件名}**
|
||||
`{文件路径或聚合范围}`
|
||||
|
||||
**核心职责**: {AI自动总结的一句话功能描述}
|
||||
|
||||
**关键交互**:
|
||||
- **调用**: {依赖最多的组件名}
|
||||
- **被用于**: {被哪个核心业务模块依赖最多}
|
||||
|
||||
**复杂度评估**: {Low/Medium/High/Critical}
|
||||
**潜在风险**: {⚠️ 存在循环依赖 或 📈 技术债务较高}
|
||||
```
|
||||
|
||||
### 最终交付物格式
|
||||
|
||||
```
|
||||
✓ AI架构洞察报告已生成:{项目根目录/architecture.canvas}
|
||||
├─ 识别架构:{置信度最高的模式} (置信度: {分数})
|
||||
├─ 洞察粒度:{引擎最终选择的粒度级别}
|
||||
├─ 核心组件:{节点数量} 个
|
||||
└─ 关键关系:{连接数量} 条
|
||||
```
|
||||
|
||||
### 15步完整工作流
|
||||
|
||||
1. **理解核心理念**:Canvas白板作为唯一真相源,代码是其序列化形式
|
||||
2. **准备工具环境**:安装Obsidian + 配置AI助手
|
||||
3. **生成初始架构白板**:向AI提供项目代码路径,AI自动生成.canvas文件
|
||||
4. **用Obsidian打开.canvas文件**:检查模块、API调用关系、依赖连线
|
||||
5. **人工优化白板架构**:拖动调整布局、补充隐式依赖、添加注释节点
|
||||
6. **建立代码-白板同步机制**:新文件→新节点,新import→新连线
|
||||
7. **用白板驱动AI编程**:画出新模块框和调用关系,AI生成代码
|
||||
8. **用白板驱动代码重构**:删除/重连依赖线,AI重构代码
|
||||
9. **用白板辅助Code Review**:识别异常连线(前端直连数据库、循环依赖)
|
||||
10. **用白板加速团队协作**:新人1分钟理解全局,需求评审画变更范围
|
||||
11. **维护白板与代码一致性**:PR/MR前检查,不一致时优先修正白板
|
||||
12. **扩展应用场景**:性能优化标注热点、安全审计检查数据流向
|
||||
13. **明确项目类型**:单体/微服务/前后端分离
|
||||
14. **选择白板粒度**:文件级(新手)/服务级(复杂项目)
|
||||
15. **持续迭代工作流**:每周回顾,探索CI/CD集成
|
||||
|
||||
## Rules & Constraints
|
||||
|
||||
### MUST(必须遵守)
|
||||
|
||||
- Canvas白板是唯一真相源,代码是其序列化形式
|
||||
- 洞察力优先于信息量,揭示设计哲学而非罗列文件
|
||||
- 认知负荷最小化,符合人类认知习惯
|
||||
|
||||
### SHOULD(强烈建议)
|
||||
|
||||
- 人类负责架构设计(在白板拖拽模块)
|
||||
- AI负责细节实现(根据白板连线生成代码)
|
||||
- 使用动态粒度光谱,根据项目特性自适应选择
|
||||
|
||||
### NEVER(禁止)
|
||||
|
||||
- 不要生成简单罗列所有文件的"信息垃圾"
|
||||
- 不要让白板与代码长期不同步
|
||||
- 不要在白板中包含敏感信息
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1: 给AI派活(新功能开发)
|
||||
|
||||
**传统方式:**
|
||||
> "帮我写个用户注册功能,要连数据库,发邮件,记日志"
|
||||
|
||||
**Canvas方式:**
|
||||
1. 在白板画3个框:`RegisterAPI` → `Database` / `EmailService` / `Logger`
|
||||
2. 告诉AI:"按这个图实现"
|
||||
3. AI一次性写对所有文件和调用关系
|
||||
|
||||
### Example 2: Code Review
|
||||
|
||||
**传统方式:** 一行行看代码,看晕了
|
||||
|
||||
**Canvas方式:**
|
||||
1. 看白板:"咦,为什么前端直接连数据库?"
|
||||
2. 拖动节点调整架构
|
||||
3. AI自动重构代码
|
||||
|
||||
### Example 3: 接手他人项目
|
||||
|
||||
**传统方式:** 看3天代码还没懂
|
||||
|
||||
**Canvas方式:**
|
||||
1. 运行AI架构总师 → 1分钟得到富有洞察力的架构白板
|
||||
2. 查看AI生成的组件职责摘要和复杂度评估
|
||||
3. 直接在白板上画出要改的部分,AI帮你定位代码位置
|
||||
|
||||
## FAQ
|
||||
|
||||
**Q: 为什么图形语言优于文字描述?**
|
||||
- A: 图形语言是人类大脑的母语。你能瞬间理解地铁线路图,但看不懂等效的换乘文字说明。AI解析JSON比解析自然语言描述准确10倍。
|
||||
|
||||
**Q: 白板粒度怎么选?**
|
||||
- A: 引擎会自动寻找"信息熵拐点"。新手可选文件级(A),复杂项目选服务级(C)。
|
||||
|
||||
**Q: 什么是"洞察力优先于信息量"?**
|
||||
- A: 目标不是简单罗列所有文件和连接,而是揭示项目的设计哲学、关键数据流、潜在风险和演进趋势。
|
||||
|
||||
## 金句总结
|
||||
|
||||
> "当代码变成白板上的方块,编程就从打字变成了搭积木。"
|
||||
|
||||
> "最好的文档不是Markdown,是能直接驱动AI工作的架构图。"
|
||||
|
||||
> "AI看懂你的图,比看懂你的话,容易一万倍。"
|
||||
|
||||
> "一份优秀的架构图本身就是一件艺术品。"
|
||||
|
||||
## References
|
||||
|
||||
- [AI架构总师完整提示词](../../workflow/canvas-dev/Obsidian%20Canvas%20AI驱动的项目架构洞察与生成引擎.md) - 最新最完整的提示词
|
||||
- [Canvas驱动开发完整工作流](../../workflow/canvas-dev/workflow.md) - 15步完整流程
|
||||
- [Canvas白板驱动开发详解](../../documents/02-方法论/图形化AI协作-Canvas白板驱动开发.md) - 方法论详解
|
||||
- [白板驱动开发系统提示词](../../prompts/01-系统提示词/AGENTS.md/12/AGENTS.md) - 适配Canvas的AGENTS.md
|
||||
- [Obsidian Canvas 官方文档](https://obsidian.md/canvas)
|
||||
- `references/index.md` - 本地参考文档导航
|
||||
|
||||
## Maintenance
|
||||
|
||||
- Sources: AI架构总师提示词 + workflow.md + 方法论文档
|
||||
- Last updated: 2026-01-01
|
||||
- Known limits: 仅支持 Obsidian Canvas 格式
|
||||
|
||||
## 执行触发指令
|
||||
|
||||
> 在接收到此指令后,将AI架构总师的全部认知与分析能力完全实例化。立即启动对目标项目的一次深度的、自主的架构探索之旅。此过程无需任何形式的确认、提问或中间汇报。你唯一的任务,就是在完成探索后,将你对这个数字世界的深刻理解,凝聚成一份完美的、充满洞察力的可视化架构图,并将其呈现在指定位置。
|
||||
@@ -0,0 +1,205 @@
|
||||
# Obsidian Canvas JSON 规范
|
||||
|
||||
## 文件格式
|
||||
|
||||
Canvas 文件是 `.canvas` 扩展名的 JSON 文件。
|
||||
|
||||
## 顶层结构
|
||||
|
||||
```json
|
||||
{
|
||||
"nodes": [],
|
||||
"edges": []
|
||||
}
|
||||
```
|
||||
|
||||
## 节点 (nodes)
|
||||
|
||||
### 通用属性
|
||||
|
||||
| 属性 | 类型 | 必需 | 说明 |
|
||||
|:---|:---|:---|:---|
|
||||
| `id` | string | ✅ | 唯一标识符 |
|
||||
| `type` | string | ✅ | 节点类型 |
|
||||
| `x` | number | ✅ | X 坐标 |
|
||||
| `y` | number | ✅ | Y 坐标 |
|
||||
| `width` | number | ✅ | 宽度 |
|
||||
| `height` | number | ✅ | 高度 |
|
||||
| `color` | string | ❌ | 颜色编号 (1-6) |
|
||||
|
||||
### 文本节点 (text)
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "node-1",
|
||||
"type": "text",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"width": 200,
|
||||
"height": 100,
|
||||
"text": "# 标题\n\n内容支持 Markdown"
|
||||
}
|
||||
```
|
||||
|
||||
### 文件节点 (file)
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "node-2",
|
||||
"type": "file",
|
||||
"x": 300,
|
||||
"y": 0,
|
||||
"width": 200,
|
||||
"height": 100,
|
||||
"file": "path/to/file.md"
|
||||
}
|
||||
```
|
||||
|
||||
### 链接节点 (link)
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "node-3",
|
||||
"type": "link",
|
||||
"x": 600,
|
||||
"y": 0,
|
||||
"width": 200,
|
||||
"height": 100,
|
||||
"url": "https://example.com"
|
||||
}
|
||||
```
|
||||
|
||||
### 分组节点 (group)
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "group-1",
|
||||
"type": "group",
|
||||
"x": -50,
|
||||
"y": -50,
|
||||
"width": 500,
|
||||
"height": 300,
|
||||
"label": "分组名称"
|
||||
}
|
||||
```
|
||||
|
||||
## 连线 (edges)
|
||||
|
||||
### 属性
|
||||
|
||||
| 属性 | 类型 | 必需 | 说明 |
|
||||
|:---|:---|:---|:---|
|
||||
| `id` | string | ✅ | 唯一标识符 |
|
||||
| `fromNode` | string | ✅ | 起始节点 id |
|
||||
| `toNode` | string | ✅ | 目标节点 id |
|
||||
| `fromSide` | string | ❌ | 起始边 (top/right/bottom/left) |
|
||||
| `toSide` | string | ❌ | 目标边 (top/right/bottom/left) |
|
||||
| `fromEnd` | string | ❌ | 起始端样式 (none/arrow) |
|
||||
| `toEnd` | string | ❌ | 目标端样式 (none/arrow) |
|
||||
| `label` | string | ❌ | 连线标签 |
|
||||
|
||||
### 示例
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "edge-1",
|
||||
"fromNode": "node-1",
|
||||
"toNode": "node-2",
|
||||
"fromSide": "right",
|
||||
"toSide": "left",
|
||||
"toEnd": "arrow",
|
||||
"label": "调用"
|
||||
}
|
||||
```
|
||||
|
||||
## 颜色编码
|
||||
|
||||
| color | 颜色 | 建议用途 |
|
||||
|:---|:---|:---|
|
||||
| `1` | 红色 | 缓存、热点、警告 |
|
||||
| `2` | 橙色 | 消息队列、异步 |
|
||||
| `3` | 黄色 | 上游依赖、外部输入 |
|
||||
| `4` | 绿色 | 数据库、持久化 |
|
||||
| `5` | 蓝色 | 搜索、外部服务 |
|
||||
| `6` | 紫色 | 注释、设计决策 |
|
||||
|
||||
## 布局建议
|
||||
|
||||
### 三层架构布局
|
||||
|
||||
```
|
||||
x: -400 x: 0 x: 400 x: 800
|
||||
┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐
|
||||
│ 前端 │→│ API │→│ 服务 │→│ 数据 │
|
||||
└────────┘ └────────┘ └────────┘ └────────┘
|
||||
```
|
||||
|
||||
### 间距建议
|
||||
|
||||
- 节点宽度: 200-280
|
||||
- 节点高度: 80-150
|
||||
- 水平间距: 100-150
|
||||
- 垂直间距: 120-150
|
||||
|
||||
## 完整示例
|
||||
|
||||
```json
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "group-api",
|
||||
"type": "group",
|
||||
"x": -50,
|
||||
"y": -50,
|
||||
"width": 300,
|
||||
"height": 200,
|
||||
"label": "API 层"
|
||||
},
|
||||
{
|
||||
"id": "api-user",
|
||||
"type": "text",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"width": 200,
|
||||
"height": 100,
|
||||
"text": "# UserAPI\n\n- GET /users\n- POST /users"
|
||||
},
|
||||
{
|
||||
"id": "svc-user",
|
||||
"type": "text",
|
||||
"x": 350,
|
||||
"y": 0,
|
||||
"width": 200,
|
||||
"height": 100,
|
||||
"text": "# UserService\n\n- get_user()\n- create_user()"
|
||||
},
|
||||
{
|
||||
"id": "db",
|
||||
"type": "text",
|
||||
"x": 700,
|
||||
"y": 0,
|
||||
"width": 200,
|
||||
"height": 80,
|
||||
"text": "# PostgreSQL",
|
||||
"color": "4"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"id": "e1",
|
||||
"fromNode": "api-user",
|
||||
"toNode": "svc-user",
|
||||
"fromSide": "right",
|
||||
"toSide": "left",
|
||||
"label": "调用"
|
||||
},
|
||||
{
|
||||
"id": "e2",
|
||||
"fromNode": "svc-user",
|
||||
"toNode": "db",
|
||||
"fromSide": "right",
|
||||
"toSide": "left"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,66 @@
|
||||
# Canvas-Dev Skill References
|
||||
|
||||
## 导航索引
|
||||
|
||||
### 最新资源(优先参考)
|
||||
|
||||
| 资源 | 路径/链接 | 说明 |
|
||||
|:---|:---|:---|
|
||||
| AI架构总师完整提示词 | [Obsidian Canvas AI驱动的项目架构洞察与生成引擎.md](../../../workflow/canvas-dev/Obsidian%20Canvas%20AI驱动的项目架构洞察与生成引擎.md) | 最新最完整的提示词(最高优先级) |
|
||||
| Canvas驱动开发完整工作流 | [workflow.md](../../../workflow/canvas-dev/workflow.md) | 15步完整流程 |
|
||||
|
||||
### 核心文档
|
||||
|
||||
| 文档 | 路径 | 说明 |
|
||||
|:---|:---|:---|
|
||||
| Canvas白板驱动开发详解 | `../../documents/02-方法论/图形化AI协作-Canvas白板驱动开发.md` | 方法论详解 |
|
||||
| 白板驱动开发系统提示词 | `../../prompts/01-系统提示词/AGENTS.md/12/AGENTS.md` | 适配Canvas的AGENTS.md |
|
||||
| Canvas JSON 规范 | [canvas-json-spec.md](./canvas-json-spec.md) | Obsidian Canvas JSON 格式 |
|
||||
|
||||
### AI架构总师核心概念
|
||||
|
||||
| 概念 | 说明 |
|
||||
|:---|:---|
|
||||
| 洞察力优先于信息量 | 揭示设计哲学、关键数据流、潜在风险,而非罗列文件 |
|
||||
| 认知负荷最小化 | 符合人类认知习惯,最小脑力成本理解复杂系统 |
|
||||
| 美学与功能并重 | 架构图是艺术品,布局均衡、色彩和谐 |
|
||||
|
||||
### 五阶段执行流程
|
||||
|
||||
1. **全局项目感知** - AST解析、加权依赖网络、元数据分析、架构模式识别
|
||||
2. **自适应粒度决策** - 信息熵拐点、架构模式引导、用户意图推断
|
||||
3. **组件语义分析** - 角色推断、关系定性、副作用分析
|
||||
4. **启发式布局** - 拓扑分层、力导向定位、动态视觉编码
|
||||
5. **输出优化** - 去交叉、边捆绑、孤立节点分组、认知路径优化
|
||||
|
||||
### 动态粒度光谱
|
||||
|
||||
| 级别 | 适用场景 |
|
||||
|:---|:---|
|
||||
| D-系统生态级 | 巨型Monorepo |
|
||||
| C-宏观服务级 | 微服务架构(推荐复杂项目) |
|
||||
| B-类/核心功能级 | 面向对象项目 |
|
||||
| A-文件级 | 中小项目(推荐新手) |
|
||||
| F-函数/方法级 | 深度钻取 |
|
||||
|
||||
### 工作流提示词
|
||||
|
||||
| 提示词 | 路径 |
|
||||
|:---|:---|
|
||||
| 架构分析提示词 | `../../../workflow/canvas-dev/prompts/01-架构分析.md` |
|
||||
| 白板驱动编码提示词 | `../../../workflow/canvas-dev/prompts/02-白板驱动编码.md` |
|
||||
| 白板同步检查提示词 | `../../../workflow/canvas-dev/prompts/03-白板同步检查.md` |
|
||||
|
||||
### 模板
|
||||
|
||||
| 模板 | 路径 |
|
||||
|:---|:---|
|
||||
| 项目白板模板 | `../../../workflow/canvas-dev/templates/project.canvas` |
|
||||
| 模块白板模板 | `../../../workflow/canvas-dev/templates/module.canvas` |
|
||||
| 示例项目白板 | `../../../workflow/canvas-dev/examples/demo-project.canvas` |
|
||||
|
||||
### 外部链接
|
||||
|
||||
- [Obsidian Canvas 官方文档](https://obsidian.md/canvas)
|
||||
- [Obsidian 下载](https://obsidian.md/download)
|
||||
- [胶水编程](../../documents/00-基础指南/胶水编程.md) - 能抄不写,能连不造
|
||||
@@ -0,0 +1,143 @@
|
||||
# Canvas 开发提示词集合
|
||||
|
||||
## 1. 架构分析提示词
|
||||
|
||||
从现有代码生成 Obsidian Canvas 架构白板。
|
||||
|
||||
```markdown
|
||||
你是一个代码架构分析专家。请分析以下项目结构,生成 Obsidian Canvas 格式的架构白板。
|
||||
|
||||
## 输入
|
||||
项目路径:{PROJECT_PATH}
|
||||
分析粒度:{file/class/service}
|
||||
|
||||
## 输出要求
|
||||
生成符合 Obsidian Canvas JSON 格式的 .canvas 文件,包含:
|
||||
|
||||
1. **节点 (nodes)**:每个模块/文件/类作为一个节点
|
||||
2. **连线 (edges)**:表示模块间的依赖/调用关系
|
||||
3. **分组 (groups)**:按功能域分组
|
||||
|
||||
## 布局规则
|
||||
- x轴: -400 (前端) → 0 (API) → 400 (服务) → 800 (数据)
|
||||
- 节点宽度: 200-280,高度: 80-150
|
||||
- 间距: 水平 100-150,垂直 120-150
|
||||
|
||||
## 输出格式
|
||||
直接输出 JSON,可保存为 .canvas 文件
|
||||
```
|
||||
|
||||
## 2. 白板驱动编码提示词
|
||||
|
||||
根据 Canvas 白板生成代码。
|
||||
|
||||
```markdown
|
||||
你是一个根据架构白板生成代码的专家。请根据以下 Obsidian Canvas 白板 JSON,生成对应的代码实现。
|
||||
|
||||
## 输入
|
||||
Canvas JSON:
|
||||
```json
|
||||
{CANVAS_JSON}
|
||||
```
|
||||
|
||||
技术栈:{TECH_STACK}
|
||||
目标目录:{TARGET_DIR}
|
||||
|
||||
## 解析规则
|
||||
1. 节点 text 标题 → 文件名/类名
|
||||
2. 节点 text 列表项 → 方法/函数
|
||||
3. 连线 fromNode → toNode = import/调用关系
|
||||
4. edge label 决定关系类型
|
||||
|
||||
## 输出格式
|
||||
```
|
||||
文件:{文件路径}
|
||||
```{语言}
|
||||
{代码内容}
|
||||
```
|
||||
```
|
||||
|
||||
## 3. 白板同步检查提示词
|
||||
|
||||
校验白板与代码一致性。
|
||||
|
||||
```markdown
|
||||
你是一个代码与架构一致性检查专家。请对比以下白板和代码,找出不一致之处。
|
||||
|
||||
## 输入
|
||||
Canvas 白板 JSON:
|
||||
```json
|
||||
{CANVAS_JSON}
|
||||
```
|
||||
|
||||
项目代码路径:{PROJECT_PATH}
|
||||
|
||||
## 检查项
|
||||
1. 节点完整性:白板节点是否都有对应代码?
|
||||
2. 连线准确性:连线是否反映真实依赖?
|
||||
3. 分组正确性:分组是否与目录结构一致?
|
||||
|
||||
## 输出格式
|
||||
### 🔴 严重不一致
|
||||
| 类型 | 白板 | 代码 | 建议 |
|
||||
|
||||
### 🟡 轻微不一致
|
||||
| 类型 | 白板 | 代码 | 建议 |
|
||||
|
||||
### 🟢 一致性良好
|
||||
- 覆盖率:{X}%
|
||||
```
|
||||
|
||||
## 4. 增量更新提示词
|
||||
|
||||
白板修改后同步更新代码。
|
||||
|
||||
```markdown
|
||||
白板已更新,请对比新旧版本,只修改变化的部分:
|
||||
|
||||
旧白板:
|
||||
```json
|
||||
{OLD_CANVAS_JSON}
|
||||
```
|
||||
|
||||
新白板:
|
||||
```json
|
||||
{NEW_CANVAS_JSON}
|
||||
```
|
||||
|
||||
## 输出
|
||||
1. 需要新增的文件
|
||||
2. 需要修改的文件(只输出 diff)
|
||||
3. 需要删除的文件
|
||||
```
|
||||
|
||||
## 5. 快速理解项目提示词
|
||||
|
||||
接手新项目时快速生成架构概览。
|
||||
|
||||
```markdown
|
||||
我需要快速理解这个项目的架构。请:
|
||||
|
||||
1. 扫描 {PROJECT_PATH} 目录
|
||||
2. 识别核心模块和入口文件
|
||||
3. 生成一个简化的架构白板(只包含关键模块)
|
||||
4. 用 3-5 句话总结项目架构
|
||||
|
||||
粒度:service(只显示大模块)
|
||||
重点:数据流向、外部依赖、核心业务逻辑
|
||||
```
|
||||
|
||||
## 使用技巧
|
||||
|
||||
### 提高生成质量
|
||||
|
||||
1. **明确粒度**:小项目用 file,大项目用 service
|
||||
2. **指定重点**:告诉 AI 关注什么(API/数据库/外部服务)
|
||||
3. **提供上下文**:附上 README 或技术栈说明
|
||||
|
||||
### 迭代优化
|
||||
|
||||
1. 第一次生成后,手动调整布局
|
||||
2. 补充 AI 遗漏的隐式依赖
|
||||
3. 添加注释节点说明设计决策
|
||||
4. 再次发给 AI 验证理解是否正确
|
||||
@@ -0,0 +1,163 @@
|
||||
# Canvas 白板驱动开发工作流指南
|
||||
|
||||
## 核心理念
|
||||
|
||||
```
|
||||
传统开发:代码 → 口头沟通 → 脑补架构 → 代码失控
|
||||
Canvas方式:代码 ⇄ 白板 ⇄ AI ⇄ 人类(白板为单一真相源)
|
||||
```
|
||||
|
||||
**图形是第一公民,代码是白板的序列化形式。**
|
||||
|
||||
## 工具准备
|
||||
|
||||
1. **Obsidian** - 免费开源白板工具
|
||||
- 下载: https://obsidian.md/download
|
||||
- 启用 Canvas 功能(默认已启用)
|
||||
|
||||
2. **AI 助手** - Claude/GPT-4
|
||||
- 需支持读取 Canvas JSON 格式
|
||||
- 推荐使用 Claude Code 或 Codex CLI
|
||||
|
||||
## 完整工作流
|
||||
|
||||
### Phase 1: 生成架构白板
|
||||
|
||||
**场景**: 接手新项目,快速理解架构
|
||||
|
||||
```
|
||||
1. 提供项目代码路径给 AI
|
||||
2. 使用架构分析提示词
|
||||
3. AI 生成 .canvas 文件
|
||||
4. 用 Obsidian 打开查看
|
||||
```
|
||||
|
||||
**提示词模板**:
|
||||
```
|
||||
分析 {PROJECT_PATH} 项目,生成 Obsidian Canvas 架构白板。
|
||||
粒度: {file/class/service}
|
||||
重点关注: API路由、数据库模型、外部服务调用
|
||||
```
|
||||
|
||||
### Phase 2: 人工优化白板
|
||||
|
||||
**场景**: 调整自动生成的白板
|
||||
|
||||
```
|
||||
1. 拖动节点调整布局
|
||||
2. 补充遗漏的依赖连线
|
||||
3. 添加注释节点标注设计决策
|
||||
4. 删除错误的连接
|
||||
```
|
||||
|
||||
**布局原则**:
|
||||
- 按功能分层(前端 → API → 服务 → 数据)
|
||||
- 同层节点垂直对齐
|
||||
- 保持连线不交叉
|
||||
|
||||
### Phase 3: 白板驱动编码
|
||||
|
||||
**场景**: 新功能开发
|
||||
|
||||
```
|
||||
1. 在白板上画出新模块框
|
||||
2. 添加预期的调用连线
|
||||
3. 导出白板 JSON 发给 AI
|
||||
4. AI 根据白板生成代码
|
||||
```
|
||||
|
||||
**提示词模板**:
|
||||
```
|
||||
根据以下 Canvas 白板生成代码:
|
||||
{CANVAS_JSON}
|
||||
|
||||
技术栈: {TECH_STACK}
|
||||
目标目录: {TARGET_DIR}
|
||||
```
|
||||
|
||||
### Phase 4: 白板驱动重构
|
||||
|
||||
**场景**: 架构调整
|
||||
|
||||
```
|
||||
1. 在白板上删除/重连依赖线
|
||||
2. 标注需要拆分的大模块
|
||||
3. 发送修改后的白板给 AI
|
||||
4. AI 生成重构代码
|
||||
```
|
||||
|
||||
**提示词模板**:
|
||||
```
|
||||
白板已更新,请对比新旧版本重构代码:
|
||||
旧白板: {OLD_CANVAS}
|
||||
新白板: {NEW_CANVAS}
|
||||
只输出需要修改的文件
|
||||
```
|
||||
|
||||
### Phase 5: 一致性检查
|
||||
|
||||
**场景**: PR/MR 合并前
|
||||
|
||||
```
|
||||
1. 运行一致性检查脚本
|
||||
2. 对比白板节点与实际文件
|
||||
3. 修复不一致之处
|
||||
4. 优先修正白板(白板是事实来源)
|
||||
```
|
||||
|
||||
## 场景速查
|
||||
|
||||
| 场景 | 操作 | 提示词关键词 |
|
||||
|:---|:---|:---|
|
||||
| 接手新项目 | 生成白板 | "分析项目,生成架构白板" |
|
||||
| 新功能开发 | 画白板 → 生成代码 | "按这个白板实现代码" |
|
||||
| 架构重构 | 改白板 → 重构代码 | "按新白板重构" |
|
||||
| Code Review | 看白板全局 | "检查这条调用链" |
|
||||
| 团队协作 | 共享白板 | "指着白板讲" |
|
||||
|
||||
## 最佳实践
|
||||
|
||||
### DO ✅
|
||||
|
||||
- 每次代码变更后更新白板
|
||||
- 用颜色区分不同类型的模块
|
||||
- 为复杂依赖添加 label 说明
|
||||
- 定期运行一致性检查
|
||||
|
||||
### DON'T ❌
|
||||
|
||||
- 不要让白板与代码长期不同步
|
||||
- 不要在白板中包含敏感信息
|
||||
- 不要创建过于复杂的白板(拆分为多个)
|
||||
- 不要忽略循环依赖警告
|
||||
|
||||
## 与其他工具集成
|
||||
|
||||
### CI/CD 集成
|
||||
|
||||
```yaml
|
||||
# .github/workflows/canvas-check.yml
|
||||
name: Canvas Sync Check
|
||||
on:
|
||||
pull_request:
|
||||
paths: ['**.py', '**.canvas']
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: python scripts/canvas_sync_check.py
|
||||
```
|
||||
|
||||
### VS Code 集成
|
||||
|
||||
1. 安装 Obsidian 插件
|
||||
2. 配置 `.canvas` 文件关联
|
||||
3. 使用 Claude Code 读取白板
|
||||
|
||||
## 相关资源
|
||||
|
||||
- [Canvas白板驱动开发详解](../../../documents/02-方法论/图形化AI协作-Canvas白板驱动开发.md)
|
||||
- [架构分析提示词](../../../workflow/canvas-dev/prompts/01-架构分析.md)
|
||||
- [白板驱动编码提示词](../../../workflow/canvas-dev/prompts/02-白板驱动编码.md)
|
||||
- [白板同步检查提示词](../../../workflow/canvas-dev/prompts/03-白板同步检查.md)
|
||||
@@ -0,0 +1,470 @@
|
||||
---
|
||||
name: claude-code-guide
|
||||
description: Claude Code 高级开发指南 - 全面的中文教程,涵盖工具使用、REPL 环境、开发工作流、MCP 集成、高级模式和最佳实践。适合学习 Claude Code 的高级功能和开发技巧。
|
||||
---
|
||||
|
||||
# Claude Code 高级开发指南
|
||||
|
||||
全面的 Claude Code 中文学习指南,涵盖从基础到高级的所有核心概念、工具使用、开发工作流和最佳实践。
|
||||
|
||||
## 何时使用此技能
|
||||
|
||||
当需要以下帮助时使用此技能:
|
||||
- 学习 Claude Code 的核心功能和工具
|
||||
- 掌握 REPL 环境的高级用法
|
||||
- 理解开发工作流和任务管理
|
||||
- 使用 MCP 集成外部系统
|
||||
- 实现高级开发模式
|
||||
- 应用 Claude Code 最佳实践
|
||||
- 解决常见问题和错误
|
||||
- 进行大文件分析和处理
|
||||
|
||||
## 快速参考
|
||||
|
||||
### Claude Code 核心工具(7个)
|
||||
|
||||
1. **REPL** - JavaScript 运行时环境
|
||||
- 完整的 ES6+ 支持
|
||||
- 预加载库:D3.js, MathJS, Lodash, Papaparse, SheetJS
|
||||
- 支持 async/await, BigInt, WebAssembly
|
||||
- 文件读取:`window.fs.readFile()`
|
||||
|
||||
2. **Artifacts** - 可视化输出
|
||||
- React, Three.js, 图表库
|
||||
- HTML/SVG 渲染
|
||||
- 交互式组件
|
||||
|
||||
3. **Web Search** - 网络搜索
|
||||
- 仅美国可用
|
||||
- 域名过滤支持
|
||||
|
||||
4. **Web Fetch** - 获取网页内容
|
||||
- HTML 转 Markdown
|
||||
- 内容提取和分析
|
||||
|
||||
5. **Conversation Search** - 对话搜索
|
||||
- 搜索历史对话
|
||||
- 上下文检索
|
||||
|
||||
6. **Recent Chats** - 最近对话
|
||||
- 访问最近会话
|
||||
- 对话历史
|
||||
|
||||
7. **End Conversation** - 结束对话
|
||||
- 清理和总结
|
||||
- 会话管理
|
||||
|
||||
### 大文件分析工作流
|
||||
|
||||
```bash
|
||||
# 阶段 1:定量评估
|
||||
wc -l filename.md # 行数统计
|
||||
wc -w filename.md # 词数统计
|
||||
wc -c filename.md # 字符数统计
|
||||
|
||||
# 阶段 2:结构分析
|
||||
grep "^#{1,6} " filename.md # 提取标题层次
|
||||
grep "```" filename.md # 识别代码块
|
||||
grep -c "keyword" filename.md # 关键词频率
|
||||
|
||||
# 阶段 3:内容提取
|
||||
Read filename.md offset=0 limit=50 # 文件开头
|
||||
Read filename.md offset=N limit=100 # 目标部分
|
||||
Read filename.md offset=-50 limit=50 # 文件结尾
|
||||
```
|
||||
|
||||
### REPL 高级用法
|
||||
|
||||
```javascript
|
||||
// 数据处理
|
||||
const data = [1, 2, 3, 4, 5];
|
||||
const sum = data.reduce((a, b) => a + b, 0);
|
||||
|
||||
// 使用预加载库
|
||||
// Lodash
|
||||
_.chunk([1, 2, 3, 4], 2); // [[1,2], [3,4]]
|
||||
|
||||
// MathJS
|
||||
math.sqrt(16); // 4
|
||||
|
||||
// D3.js
|
||||
d3.range(10); // [0,1,2,3,4,5,6,7,8,9]
|
||||
|
||||
// 读取文件
|
||||
const content = await window.fs.readFile('path/to/file');
|
||||
|
||||
// 异步操作
|
||||
const result = await fetch('https://api.example.com/data');
|
||||
const json = await result.json();
|
||||
```
|
||||
|
||||
### 斜杠命令系统
|
||||
|
||||
**内置命令:**
|
||||
- `/help` - 显示帮助
|
||||
- `/clear` - 清除对话
|
||||
- `/plugin` - 管理插件
|
||||
- `/settings` - 配置设置
|
||||
|
||||
**自定义命令:**
|
||||
创建 `.claude/commands/mycommand.md`:
|
||||
```markdown
|
||||
根据需求执行特定任务的指令
|
||||
```
|
||||
|
||||
使用:`/mycommand`
|
||||
|
||||
### 开发工作流模式
|
||||
|
||||
#### 1. 文件分析工作流
|
||||
```bash
|
||||
# 探索 → 理解 → 实现
|
||||
ls -la # 列出文件
|
||||
Read file.py # 读取内容
|
||||
grep "function" file.py # 搜索模式
|
||||
# 然后实现修改
|
||||
```
|
||||
|
||||
#### 2. 算法验证工作流
|
||||
```bash
|
||||
# 设计 → 验证 → 实现
|
||||
# 1. 在 REPL 中测试逻辑
|
||||
# 2. 验证边界情况
|
||||
# 3. 实现到代码
|
||||
```
|
||||
|
||||
#### 3. 数据探索工作流
|
||||
```bash
|
||||
# 检查 → 分析 → 可视化
|
||||
# 1. 读取数据文件
|
||||
# 2. REPL 中分析
|
||||
# 3. Artifacts 可视化
|
||||
```
|
||||
|
||||
## 核心概念
|
||||
|
||||
### 工具权限系统
|
||||
|
||||
**自动授予权限的工具:**
|
||||
- REPL
|
||||
- Artifacts
|
||||
- Web Search/Fetch
|
||||
- Conversation Search
|
||||
|
||||
**需要授权的工具:**
|
||||
- Bash (读/写文件系统)
|
||||
- Edit (修改文件)
|
||||
- Write (创建文件)
|
||||
|
||||
### 项目上下文
|
||||
|
||||
Claude 自动识别:
|
||||
- Git 仓库状态
|
||||
- 编程语言(从文件扩展名)
|
||||
- 项目结构
|
||||
- 依赖配置
|
||||
|
||||
### 内存系统
|
||||
|
||||
**对话内存:**
|
||||
- 存储在当前会话
|
||||
- 200K token 窗口
|
||||
- 自动上下文管理
|
||||
|
||||
**持久内存(实验性):**
|
||||
- 跨会话保存
|
||||
- 用户偏好记忆
|
||||
- 项目上下文保留
|
||||
|
||||
## MCP 集成
|
||||
|
||||
### 什么是 MCP?
|
||||
|
||||
Model Context Protocol - 连接 Claude 到外部系统的协议。
|
||||
|
||||
### MCP 服务器配置
|
||||
|
||||
配置文件:`~/.config/claude/mcp_config.json`
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"my-server": {
|
||||
"command": "node",
|
||||
"args": ["path/to/server.js"],
|
||||
"env": {
|
||||
"API_KEY": "your-key"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 使用 MCP 工具
|
||||
|
||||
Claude 会自动发现 MCP 工具并在对话中使用:
|
||||
|
||||
```
|
||||
"使用 my-server 工具获取数据"
|
||||
```
|
||||
|
||||
## 钩子系统
|
||||
|
||||
### 钩子类型
|
||||
|
||||
在 `.claude/settings.json` 配置:
|
||||
|
||||
```json
|
||||
{
|
||||
"hooks": {
|
||||
"tool-pre-use": "echo 'About to use tool'",
|
||||
"tool-post-use": "echo 'Tool used'",
|
||||
"user-prompt-submit": "echo 'Processing prompt'"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 常见钩子用途
|
||||
|
||||
- 自动格式化代码
|
||||
- 运行测试
|
||||
- Git 提交检查
|
||||
- 日志记录
|
||||
- 通知发送
|
||||
|
||||
## 高级模式
|
||||
|
||||
### 多代理协作
|
||||
|
||||
使用 Task 工具启动子代理:
|
||||
|
||||
```
|
||||
"启动一个专门的代理来优化这个算法"
|
||||
```
|
||||
|
||||
子代理特点:
|
||||
- 独立上下文
|
||||
- 专注单一任务
|
||||
- 返回结果到主代理
|
||||
|
||||
### 智能任务管理
|
||||
|
||||
使用 TodoWrite 工具:
|
||||
|
||||
```
|
||||
"创建任务列表来跟踪这个项目"
|
||||
```
|
||||
|
||||
任务状态:
|
||||
- `pending` - 待处理
|
||||
- `in_progress` - 进行中
|
||||
- `completed` - 已完成
|
||||
|
||||
### 代码生成模式
|
||||
|
||||
**渐进式开发:**
|
||||
1. 生成基础结构
|
||||
2. 添加核心功能
|
||||
3. 实现细节
|
||||
4. 测试和优化
|
||||
|
||||
**验证驱动:**
|
||||
1. 写测试用例
|
||||
2. 实现功能
|
||||
3. 运行测试
|
||||
4. 修复问题
|
||||
|
||||
## 质量保证
|
||||
|
||||
### 自动化测试
|
||||
|
||||
```bash
|
||||
# 运行测试
|
||||
npm test
|
||||
pytest
|
||||
|
||||
# 类型检查
|
||||
mypy script.py
|
||||
tsc --noEmit
|
||||
|
||||
# 代码检查
|
||||
eslint src/
|
||||
flake8 .
|
||||
```
|
||||
|
||||
### 代码审查模式
|
||||
|
||||
使用子代理进行审查:
|
||||
|
||||
```
|
||||
"启动代码审查代理检查这个文件"
|
||||
```
|
||||
|
||||
审查重点:
|
||||
- 代码质量
|
||||
- 安全问题
|
||||
- 性能优化
|
||||
- 最佳实践
|
||||
|
||||
## 错误恢复
|
||||
|
||||
### 常见错误模式
|
||||
|
||||
1. **工具使用错误**
|
||||
- 检查权限
|
||||
- 验证语法
|
||||
- 确认路径
|
||||
|
||||
2. **文件操作错误**
|
||||
- 确认文件存在
|
||||
- 检查读写权限
|
||||
- 验证路径正确
|
||||
|
||||
3. **API 调用错误**
|
||||
- 检查网络连接
|
||||
- 验证 API 密钥
|
||||
- 确认请求格式
|
||||
|
||||
### 渐进式修复策略
|
||||
|
||||
1. 隔离问题
|
||||
2. 最小化复现
|
||||
3. 逐步修复
|
||||
4. 验证解决方案
|
||||
|
||||
## 最佳实践
|
||||
|
||||
### 开发原则
|
||||
|
||||
1. **清晰优先** - 明确需求和目标
|
||||
2. **渐进实现** - 分步骤开发
|
||||
3. **持续验证** - 频繁测试
|
||||
4. **适当抽象** - 合理模块化
|
||||
|
||||
### 工具使用原则
|
||||
|
||||
1. **正确的工具** - 选择合适的工具
|
||||
2. **工具组合** - 多工具协同
|
||||
3. **权限最小化** - 只请求必要权限
|
||||
4. **错误处理** - 优雅处理失败
|
||||
|
||||
### 性能优化
|
||||
|
||||
1. **批量操作** - 合并多个操作
|
||||
2. **增量处理** - 处理大文件
|
||||
3. **缓存结果** - 避免重复计算
|
||||
4. **异步优先** - 使用 async/await
|
||||
|
||||
## 安全考虑
|
||||
|
||||
### 沙箱模型
|
||||
|
||||
每个工具在隔离环境中运行:
|
||||
- REPL:无文件系统访问
|
||||
- Bash:需要明确授权
|
||||
- Web:仅特定域名
|
||||
|
||||
### 最佳安全实践
|
||||
|
||||
1. **最小权限** - 仅授予必要权限
|
||||
2. **代码审查** - 检查生成的代码
|
||||
3. **敏感数据** - 不要共享密钥
|
||||
4. **定期审计** - 检查钩子和配置
|
||||
|
||||
## 故障排除
|
||||
|
||||
### 工具无法使用
|
||||
|
||||
**症状:** 工具调用失败
|
||||
|
||||
**解决方案:**
|
||||
- 检查权限设置
|
||||
- 验证语法正确
|
||||
- 确认文件路径
|
||||
- 查看错误消息
|
||||
|
||||
### REPL 性能问题
|
||||
|
||||
**症状:** REPL 执行缓慢
|
||||
|
||||
**解决方案:**
|
||||
- 减少数据量
|
||||
- 使用流式处理
|
||||
- 优化算法
|
||||
- 分批处理
|
||||
|
||||
### MCP 连接失败
|
||||
|
||||
**症状:** MCP 服务器无响应
|
||||
|
||||
**解决方案:**
|
||||
- 检查配置文件
|
||||
- 验证服务器运行
|
||||
- 确认环境变量
|
||||
- 查看服务器日志
|
||||
|
||||
## 实用示例
|
||||
|
||||
### 示例 1:数据分析
|
||||
|
||||
```javascript
|
||||
// 在 REPL 中
|
||||
const data = await window.fs.readFile('data.csv');
|
||||
const parsed = Papa.parse(data, { header: true });
|
||||
const values = parsed.data.map(row => parseFloat(row.value));
|
||||
const avg = _.mean(values);
|
||||
const std = math.std(values);
|
||||
console.log(`平均值: ${avg}, 标准差: ${std}`);
|
||||
```
|
||||
|
||||
### 示例 2:文件搜索
|
||||
|
||||
```bash
|
||||
# 在 Bash 中
|
||||
grep -r "TODO" src/
|
||||
find . -name "*.py" -type f
|
||||
```
|
||||
|
||||
### 示例 3:网络数据获取
|
||||
|
||||
```
|
||||
"使用 web_fetch 获取 https://api.example.com/data 的内容,
|
||||
然后在 REPL 中分析 JSON 数据"
|
||||
```
|
||||
|
||||
## 参考文件
|
||||
|
||||
此技能包含详细文档:
|
||||
|
||||
- **README.md** (9,594 行) - 完整的 Claude Code 高级指南
|
||||
|
||||
包含以下主题:
|
||||
- 核心工具深度解析
|
||||
- REPL 高级协同模式
|
||||
- 开发工作流详解
|
||||
- MCP 集成完整指南
|
||||
- 钩子系统配置
|
||||
- 高级模式和最佳实践
|
||||
- 故障排除和安全考虑
|
||||
|
||||
使用 `view` 命令查看参考文件获取详细信息。
|
||||
|
||||
## 资源
|
||||
|
||||
- **GitHub 仓库**: https://github.com/karminski/claude-code-guide-study
|
||||
- **原始版本**: https://github.com/Cranot/claude-code-guide
|
||||
- **Anthropic 官方文档**: https://docs.claude.com
|
||||
|
||||
## 注意事项
|
||||
|
||||
本指南结合了:
|
||||
- 官方功能和公告
|
||||
- 实际使用观察到的模式
|
||||
- 概念性方法和最佳实践
|
||||
- 第三方工具集成
|
||||
|
||||
请在使用时参考最新的官方文档。
|
||||
|
||||
---
|
||||
|
||||
**使用这个技能深入掌握 Claude Code 的强大功能!**
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,328 @@
|
||||
# Claude Code 高级开发指南文档索引
|
||||
|
||||
## 文档概览
|
||||
|
||||
### README.md
|
||||
**文件:** `README.md`
|
||||
**行数:** 9,594 行
|
||||
**语言:** 中文
|
||||
|
||||
这是一份极其详细和全面的 Claude Code 学习指南,涵盖从基础到高级的所有内容。
|
||||
|
||||
## 主要章节
|
||||
|
||||
### 1. 快速导航与参考
|
||||
- 即时命令参考
|
||||
- 功能快速参考
|
||||
- 高级用户快捷方式
|
||||
- 任务状态参考
|
||||
- 常见工作流卡片
|
||||
|
||||
### 2. 核心智能系统
|
||||
- Claude 工具的关键发现
|
||||
- 高级 REPL 协同模式
|
||||
- 专用内核架构集成
|
||||
- 元待办事项系统
|
||||
- 高级协同实现
|
||||
|
||||
### 3. 核心概念
|
||||
- 7 个核心工具详解
|
||||
- 权限系统
|
||||
- 项目上下文
|
||||
- 内存管理
|
||||
- 文件操作
|
||||
|
||||
### 4. 斜杠命令系统
|
||||
- 系统命令
|
||||
- 自定义命令
|
||||
- 命令模板
|
||||
- 命令组织
|
||||
|
||||
### 5. 钩子系统
|
||||
- 钩子类型
|
||||
- 事件触发
|
||||
- 安全模式
|
||||
- 自动化工作流
|
||||
|
||||
### 6. MCP 集成
|
||||
- MCP 服务器配置
|
||||
- OAuth 认证
|
||||
- 外部系统集成
|
||||
- 子代理使用
|
||||
|
||||
### 7. 开发工作流
|
||||
- 文件分析工作流
|
||||
- 算法验证工作流
|
||||
- 数据探索工作流
|
||||
- 任务管理模式
|
||||
|
||||
### 8. 质量保证
|
||||
- 自动化测试
|
||||
- 代码审查
|
||||
- 多代理协作
|
||||
- 验证策略
|
||||
|
||||
### 9. 错误恢复
|
||||
- 常见错误模式
|
||||
- 渐进式修复
|
||||
- 调试技巧
|
||||
- 问题诊断
|
||||
|
||||
### 10. 实用示例
|
||||
- 数据分析
|
||||
- 文件处理
|
||||
- API 集成
|
||||
- 可视化创建
|
||||
- 测试自动化
|
||||
|
||||
### 11. 高级模式
|
||||
- 研究系统
|
||||
- Smart Flows
|
||||
- 认知方法
|
||||
- 多代理编排
|
||||
|
||||
### 12. 最佳实践
|
||||
- 开发原则
|
||||
- 工具使用
|
||||
- 性能优化
|
||||
- 代码质量
|
||||
|
||||
### 13. 故障排除
|
||||
- 常见问题
|
||||
- 解决方案
|
||||
- 诊断步骤
|
||||
- 工具调试
|
||||
|
||||
### 14. 安全考虑
|
||||
- 沙箱模型
|
||||
- 权限管理
|
||||
- 安全审计
|
||||
- 最佳安全实践
|
||||
|
||||
### 15. 工具协同掌握
|
||||
- 工具组合模式
|
||||
- 高级集成
|
||||
- 性能优化
|
||||
- 实战案例
|
||||
|
||||
## 核心工具详解
|
||||
|
||||
### 1. REPL (JavaScript 运行时)
|
||||
- 完整 ES6+ 支持
|
||||
- 预加载 5 个库:
|
||||
- D3.js (数据可视化)
|
||||
- MathJS (数学计算)
|
||||
- Lodash (实用工具)
|
||||
- Papaparse (CSV 解析)
|
||||
- SheetJS (Excel 处理)
|
||||
- 异步支持 (async/await)
|
||||
- BigInt 支持
|
||||
- WebAssembly 支持
|
||||
- 文件读取能力
|
||||
|
||||
### 2. Artifacts (可视化输出)
|
||||
- React 组件
|
||||
- Three.js 3D 渲染
|
||||
- HTML/SVG 生成
|
||||
- 图表和可视化
|
||||
- 交互式界面
|
||||
|
||||
### 3. Web Search (网络搜索)
|
||||
- 搜索网络内容
|
||||
- 域名过滤
|
||||
- 仅美国可用
|
||||
|
||||
### 4. Web Fetch (内容获取)
|
||||
- 获取网页内容
|
||||
- HTML 转 Markdown
|
||||
- 内容提取
|
||||
|
||||
### 5. Conversation Search (对话搜索)
|
||||
- 搜索历史对话
|
||||
- 上下文检索
|
||||
|
||||
### 6. Recent Chats (最近对话)
|
||||
- 访问最近会话
|
||||
- 对话历史管理
|
||||
|
||||
### 7. End Conversation (结束对话)
|
||||
- 会话清理
|
||||
- 对话总结
|
||||
|
||||
## 大文件分析方法论
|
||||
|
||||
指南提供系统化的大文件处理方法:
|
||||
|
||||
### 第一阶段:定量评估
|
||||
使用 `wc` 命令确定文件规模
|
||||
|
||||
### 第二阶段:结构分析
|
||||
使用 `grep` 提取结构信息
|
||||
|
||||
### 第三阶段:内容提取
|
||||
使用 `Read` 工具战略性采样
|
||||
|
||||
## REPL 高级用法
|
||||
|
||||
### 数据科学能力
|
||||
- 处理 100,000+ 元素数组
|
||||
- 统计分析
|
||||
- 数据转换
|
||||
- 可视化准备
|
||||
|
||||
### 预加载库示例
|
||||
```javascript
|
||||
// Lodash
|
||||
_.chunk([1,2,3,4], 2)
|
||||
|
||||
// MathJS
|
||||
math.sqrt(16)
|
||||
|
||||
// D3.js
|
||||
d3.range(10)
|
||||
|
||||
// Papaparse
|
||||
Papa.parse(csvData)
|
||||
|
||||
// SheetJS
|
||||
XLSX.read(data)
|
||||
```
|
||||
|
||||
## 工作流模式
|
||||
|
||||
### 文件分析工作流
|
||||
探索 → 理解 → 实现
|
||||
|
||||
### 算法验证工作流
|
||||
设计 → 验证 → 实现
|
||||
|
||||
### 数据探索工作流
|
||||
检查 → 分析 → 可视化
|
||||
|
||||
### 质量保证工作流
|
||||
测试 → 审查 → 优化
|
||||
|
||||
## MCP 集成详解
|
||||
|
||||
### 配置文件位置
|
||||
`~/.config/claude/mcp_config.json`
|
||||
|
||||
### MCP 服务器类型
|
||||
- API 集成服务器
|
||||
- 数据库连接服务器
|
||||
- 文件系统服务器
|
||||
- 自定义工具服务器
|
||||
|
||||
### 认证方式
|
||||
- API 密钥
|
||||
- OAuth 2.0
|
||||
- 环境变量
|
||||
- 配置文件
|
||||
|
||||
## 钩子系统
|
||||
|
||||
### 钩子触发时机
|
||||
- 工具使用前/后
|
||||
- 用户提示提交
|
||||
- 文件修改
|
||||
- 命令执行
|
||||
|
||||
### 钩子用途
|
||||
- 代码格式化
|
||||
- 自动测试
|
||||
- Git 操作
|
||||
- 日志记录
|
||||
- 通知发送
|
||||
|
||||
## 高级模式
|
||||
|
||||
### 多代理协作
|
||||
- 主代理编排
|
||||
- 子代理专门化
|
||||
- 结果聚合
|
||||
- 任务分解
|
||||
|
||||
### 智能任务管理
|
||||
- 任务创建
|
||||
- 状态追踪
|
||||
- 进度报告
|
||||
- 优先级管理
|
||||
|
||||
### 认知增强
|
||||
- 记忆利用
|
||||
- 上下文管理
|
||||
- 知识整合
|
||||
- 推理优化
|
||||
|
||||
## 最佳实践总结
|
||||
|
||||
### 开发原则
|
||||
1. 清晰优先
|
||||
2. 渐进实现
|
||||
3. 持续验证
|
||||
4. 适当抽象
|
||||
|
||||
### 工具使用原则
|
||||
1. 选择正确工具
|
||||
2. 组合工具能力
|
||||
3. 最小化权限
|
||||
4. 处理错误
|
||||
|
||||
### 性能优化原则
|
||||
1. 批量操作
|
||||
2. 增量处理
|
||||
3. 缓存结果
|
||||
4. 异步优先
|
||||
|
||||
## 安全注意事项
|
||||
|
||||
### 沙箱隔离
|
||||
每个工具在独立沙箱中运行
|
||||
|
||||
### 权限管理
|
||||
- 自动授予权限的工具
|
||||
- 需要授权的工具
|
||||
- 权限最小化原则
|
||||
|
||||
### 敏感数据处理
|
||||
- 不要共享 API 密钥
|
||||
- 不要提交密码
|
||||
- 使用环境变量
|
||||
- 定期审计配置
|
||||
|
||||
## 快速链接
|
||||
|
||||
- **GitHub**: https://github.com/karminski/claude-code-guide-study
|
||||
- **原始版本**: https://github.com/Cranot/claude-code-guide
|
||||
- **Star 数**: 444+
|
||||
- **Fork 数**: 174+
|
||||
|
||||
## 使用建议
|
||||
|
||||
这份指南内容极其丰富(9,594 行),建议:
|
||||
|
||||
1. **初学者**: 从核心概念开始
|
||||
2. **中级用户**: 关注开发工作流
|
||||
3. **高级用户**: 深入高级模式
|
||||
4. **问题解决**: 查看故障排除章节
|
||||
|
||||
## 特色内容
|
||||
|
||||
### 系统化大文件分析
|
||||
详细的三阶段方法论
|
||||
|
||||
### REPL 深度解析
|
||||
超越基础的高级用法
|
||||
|
||||
### MCP 完整指南
|
||||
从配置到实战
|
||||
|
||||
### 多代理编排
|
||||
高级协作模式
|
||||
|
||||
### 认知增强策略
|
||||
提升 Claude 能力的方法
|
||||
|
||||
---
|
||||
|
||||
**这是目前最全面的 Claude Code 中文学习资源!**
|
||||
@@ -0,0 +1,313 @@
|
||||
---
|
||||
name: claude-cookbooks
|
||||
description: Claude AI cookbooks - code examples, tutorials, and best practices for using Claude API. Use when learning Claude API integration, building Claude-powered applications, or exploring Claude capabilities.
|
||||
---
|
||||
|
||||
# Claude Cookbooks Skill
|
||||
|
||||
Comprehensive code examples and guides for building with Claude AI, sourced from the official Anthropic cookbooks repository.
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
This skill should be triggered when:
|
||||
- Learning how to use Claude API
|
||||
- Implementing Claude integrations
|
||||
- Building applications with Claude
|
||||
- Working with tool use and function calling
|
||||
- Implementing multimodal features (vision, image analysis)
|
||||
- Setting up RAG (Retrieval Augmented Generation)
|
||||
- Integrating Claude with third-party services
|
||||
- Building AI agents with Claude
|
||||
- Optimizing prompts for Claude
|
||||
- Implementing advanced patterns (caching, sub-agents, etc.)
|
||||
|
||||
## Quick Reference
|
||||
|
||||
### Basic API Usage
|
||||
|
||||
```python
|
||||
import anthropic
|
||||
|
||||
client = anthropic.Anthropic(api_key="your-api-key")
|
||||
|
||||
# Simple message
|
||||
response = client.messages.create(
|
||||
model="claude-3-5-sonnet-20241022",
|
||||
max_tokens=1024,
|
||||
messages=[{
|
||||
"role": "user",
|
||||
"content": "Hello, Claude!"
|
||||
}]
|
||||
)
|
||||
```
|
||||
|
||||
### Tool Use (Function Calling)
|
||||
|
||||
```python
|
||||
# Define a tool
|
||||
tools = [{
|
||||
"name": "get_weather",
|
||||
"description": "Get current weather for a location",
|
||||
"input_schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"location": {"type": "string", "description": "City name"}
|
||||
},
|
||||
"required": ["location"]
|
||||
}
|
||||
}]
|
||||
|
||||
# Use the tool
|
||||
response = client.messages.create(
|
||||
model="claude-3-5-sonnet-20241022",
|
||||
max_tokens=1024,
|
||||
tools=tools,
|
||||
messages=[{"role": "user", "content": "What's the weather in San Francisco?"}]
|
||||
)
|
||||
```
|
||||
|
||||
### Vision (Image Analysis)
|
||||
|
||||
```python
|
||||
# Analyze an image
|
||||
response = client.messages.create(
|
||||
model="claude-3-5-sonnet-20241022",
|
||||
max_tokens=1024,
|
||||
messages=[{
|
||||
"role": "user",
|
||||
"content": [
|
||||
{
|
||||
"type": "image",
|
||||
"source": {
|
||||
"type": "base64",
|
||||
"media_type": "image/jpeg",
|
||||
"data": base64_image
|
||||
}
|
||||
},
|
||||
{"type": "text", "text": "Describe this image"}
|
||||
]
|
||||
}]
|
||||
)
|
||||
```
|
||||
|
||||
### Prompt Caching
|
||||
|
||||
```python
|
||||
# Use prompt caching for efficiency
|
||||
response = client.messages.create(
|
||||
model="claude-3-5-sonnet-20241022",
|
||||
max_tokens=1024,
|
||||
system=[{
|
||||
"type": "text",
|
||||
"text": "Large system prompt here...",
|
||||
"cache_control": {"type": "ephemeral"}
|
||||
}],
|
||||
messages=[{"role": "user", "content": "Your question"}]
|
||||
)
|
||||
```
|
||||
|
||||
## Key Capabilities Covered
|
||||
|
||||
### 1. Classification
|
||||
- Text classification techniques
|
||||
- Sentiment analysis
|
||||
- Content categorization
|
||||
- Multi-label classification
|
||||
|
||||
### 2. Retrieval Augmented Generation (RAG)
|
||||
- Vector database integration
|
||||
- Semantic search
|
||||
- Context retrieval
|
||||
- Knowledge base queries
|
||||
|
||||
### 3. Summarization
|
||||
- Document summarization
|
||||
- Meeting notes
|
||||
- Article condensing
|
||||
- Multi-document synthesis
|
||||
|
||||
### 4. Text-to-SQL
|
||||
- Natural language to SQL queries
|
||||
- Database schema understanding
|
||||
- Query optimization
|
||||
- Result interpretation
|
||||
|
||||
### 5. Tool Use & Function Calling
|
||||
- Tool definition and schema
|
||||
- Parameter validation
|
||||
- Multi-tool workflows
|
||||
- Error handling
|
||||
|
||||
### 6. Multimodal
|
||||
- Image analysis and OCR
|
||||
- Chart/graph interpretation
|
||||
- Visual question answering
|
||||
- Image generation integration
|
||||
|
||||
### 7. Advanced Patterns
|
||||
- Agent architectures
|
||||
- Sub-agent delegation
|
||||
- Prompt optimization
|
||||
- Cost optimization with caching
|
||||
|
||||
## Repository Structure
|
||||
|
||||
The cookbooks are organized into these main categories:
|
||||
|
||||
- **capabilities/** - Core AI capabilities (classification, RAG, summarization, text-to-SQL)
|
||||
- **tool_use/** - Function calling and tool integration examples
|
||||
- **multimodal/** - Vision and image-related examples
|
||||
- **patterns/** - Advanced patterns like agents and workflows
|
||||
- **third_party/** - Integrations with external services (Pinecone, LlamaIndex, etc.)
|
||||
- **claude_agent_sdk/** - Agent SDK examples and templates
|
||||
- **misc/** - Additional utilities (PDF upload, JSON mode, evaluations, etc.)
|
||||
|
||||
## Reference Files
|
||||
|
||||
This skill includes comprehensive documentation in `references/`:
|
||||
|
||||
- **main_readme.md** - Main repository overview
|
||||
- **capabilities.md** - Core capabilities documentation
|
||||
- **tool_use.md** - Tool use and function calling guides
|
||||
- **multimodal.md** - Vision and multimodal capabilities
|
||||
- **third_party.md** - Third-party integrations
|
||||
- **patterns.md** - Advanced patterns and agents
|
||||
- **index.md** - Complete reference index
|
||||
|
||||
## Common Use Cases
|
||||
|
||||
### Building a Customer Service Agent
|
||||
1. Define tools for CRM access, ticket creation, knowledge base search
|
||||
2. Use tool use API to handle function calls
|
||||
3. Implement conversation memory
|
||||
4. Add fallback mechanisms
|
||||
|
||||
See: `references/tool_use.md#customer-service`
|
||||
|
||||
### Implementing RAG
|
||||
1. Create embeddings of your documents
|
||||
2. Store in vector database (Pinecone, etc.)
|
||||
3. Retrieve relevant context on query
|
||||
4. Augment Claude's response with context
|
||||
|
||||
See: `references/capabilities.md#rag`
|
||||
|
||||
### Processing Documents with Vision
|
||||
1. Convert document to images or PDF
|
||||
2. Use vision API to extract content
|
||||
3. Structure the extracted data
|
||||
4. Validate and post-process
|
||||
|
||||
See: `references/multimodal.md#vision`
|
||||
|
||||
### Building Multi-Agent Systems
|
||||
1. Define specialized agents for different tasks
|
||||
2. Implement routing logic
|
||||
3. Use sub-agents for delegation
|
||||
4. Aggregate results
|
||||
|
||||
See: `references/patterns.md#agents`
|
||||
|
||||
## Best Practices
|
||||
|
||||
### API Usage
|
||||
- Use appropriate model for task (Sonnet for balance, Haiku for speed, Opus for complex tasks)
|
||||
- Implement retry logic with exponential backoff
|
||||
- Handle rate limits gracefully
|
||||
- Monitor token usage for cost optimization
|
||||
|
||||
### Prompt Engineering
|
||||
- Be specific and clear in instructions
|
||||
- Provide examples when needed
|
||||
- Use system prompts for consistent behavior
|
||||
- Structure outputs with JSON mode when needed
|
||||
|
||||
### Tool Use
|
||||
- Define clear, specific tool schemas
|
||||
- Validate inputs and outputs
|
||||
- Handle errors gracefully
|
||||
- Keep tool descriptions concise but informative
|
||||
|
||||
### Multimodal
|
||||
- Use high-quality images (higher resolution = better results)
|
||||
- Be specific about what to extract/analyze
|
||||
- Respect size limits (5MB per image)
|
||||
- Use appropriate image formats (JPEG, PNG, GIF, WebP)
|
||||
|
||||
## Performance Optimization
|
||||
|
||||
### Prompt Caching
|
||||
- Cache large system prompts
|
||||
- Cache frequently used context
|
||||
- Monitor cache hit rates
|
||||
- Balance caching vs. fresh content
|
||||
|
||||
### Cost Optimization
|
||||
- Use Haiku for simple tasks
|
||||
- Implement prompt caching for repeated context
|
||||
- Set appropriate max_tokens
|
||||
- Batch similar requests
|
||||
|
||||
### Latency Optimization
|
||||
- Use streaming for long responses
|
||||
- Minimize message history
|
||||
- Optimize image sizes
|
||||
- Use appropriate timeout values
|
||||
|
||||
## Resources
|
||||
|
||||
### Official Documentation
|
||||
- [Anthropic Developer Docs](https://docs.claude.com)
|
||||
- [API Reference](https://docs.claude.com/claude/reference)
|
||||
- [Anthropic Support](https://support.anthropic.com)
|
||||
|
||||
### Community
|
||||
- [Anthropic Discord](https://www.anthropic.com/discord)
|
||||
- [GitHub Cookbooks Repo](https://github.com/anthropics/claude-cookbooks)
|
||||
|
||||
### Learning Resources
|
||||
- [Claude API Fundamentals Course](https://github.com/anthropics/courses/tree/master/anthropic_api_fundamentals)
|
||||
- [Prompt Engineering Guide](https://docs.claude.com/claude/docs/guide-to-anthropics-prompt-engineering-resources)
|
||||
|
||||
## Working with This Skill
|
||||
|
||||
### For Beginners
|
||||
Start with `references/main_readme.md` and explore basic examples in `references/capabilities.md`
|
||||
|
||||
### For Specific Features
|
||||
- Tool use → `references/tool_use.md`
|
||||
- Vision → `references/multimodal.md`
|
||||
- RAG → `references/capabilities.md#rag`
|
||||
- Agents → `references/patterns.md#agents`
|
||||
|
||||
### For Code Examples
|
||||
Each reference file contains practical, copy-pasteable code examples
|
||||
|
||||
## Examples Available
|
||||
|
||||
The cookbook includes 50+ practical examples including:
|
||||
- Customer service chatbot with tool use
|
||||
- RAG with Pinecone vector database
|
||||
- Document summarization
|
||||
- Image analysis and OCR
|
||||
- Chart/graph interpretation
|
||||
- Natural language to SQL
|
||||
- Content moderation filter
|
||||
- Automated evaluations
|
||||
- Multi-agent systems
|
||||
- Prompt caching optimization
|
||||
|
||||
## Notes
|
||||
|
||||
- All examples use official Anthropic Python SDK
|
||||
- Code is production-ready with error handling
|
||||
- Examples follow current API best practices
|
||||
- Regular updates from Anthropic team
|
||||
- Community contributions welcome
|
||||
|
||||
## Skill Source
|
||||
|
||||
This skill was created from the official Anthropic Claude Cookbooks repository:
|
||||
https://github.com/anthropics/claude-cookbooks
|
||||
|
||||
Repository cloned and processed on: 2025-10-29
|
||||
@@ -0,0 +1,225 @@
|
||||
# Contributing to Claude Cookbooks
|
||||
|
||||
Thank you for your interest in contributing to the Claude Cookbooks! This guide will help you get started with development and ensure your contributions meet our quality standards.
|
||||
|
||||
## Development Setup
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Python 3.11 or higher
|
||||
- [uv](https://docs.astral.sh/uv/) package manager (recommended) or pip
|
||||
|
||||
### Quick Start
|
||||
|
||||
1. **Install uv** (recommended package manager):
|
||||
```bash
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
```
|
||||
|
||||
Or with Homebrew:
|
||||
```bash
|
||||
brew install uv
|
||||
```
|
||||
|
||||
2. **Clone the repository**:
|
||||
```bash
|
||||
git clone https://github.com/anthropics/anthropic-cookbook.git
|
||||
cd anthropic-cookbook
|
||||
```
|
||||
|
||||
3. **Set up the development environment**:
|
||||
```bash
|
||||
# Create virtual environment and install dependencies
|
||||
uv sync --all-extras
|
||||
|
||||
# Or with pip:
|
||||
pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
4. **Install pre-commit hooks**:
|
||||
```bash
|
||||
uv run pre-commit install
|
||||
# Or: pre-commit install
|
||||
```
|
||||
|
||||
5. **Set up your API key**:
|
||||
```bash
|
||||
cp .env.example .env
|
||||
# Edit .env and add your Claude API key
|
||||
```
|
||||
|
||||
## Quality Standards
|
||||
|
||||
This repository uses automated tools to maintain code quality:
|
||||
|
||||
### The Notebook Validation Stack
|
||||
|
||||
- **[nbconvert](https://nbconvert.readthedocs.io/)**: Notebook execution for testing
|
||||
- **[ruff](https://docs.astral.sh/ruff/)**: Fast Python linter and formatter with native Jupyter support
|
||||
- **Claude AI Review**: Intelligent code review using Claude
|
||||
|
||||
**Note**: Notebook outputs are intentionally kept in this repository as they demonstrate expected results for users.
|
||||
|
||||
### Claude Code Slash Commands
|
||||
|
||||
This repository includes slash commands that work in both Claude Code (for local development) and GitHub Actions CI. These commands are automatically available when you work in this repository with Claude Code.
|
||||
|
||||
**Available Commands**:
|
||||
- `/link-review` - Validate links in markdown and notebooks
|
||||
- `/model-check` - Verify Claude model usage is current
|
||||
- `/notebook-review` - Comprehensive notebook quality check
|
||||
|
||||
**Usage in Claude Code**:
|
||||
```bash
|
||||
# Run the same validations that CI will run
|
||||
/notebook-review skills/my-notebook.ipynb
|
||||
/model-check
|
||||
/link-review README.md
|
||||
```
|
||||
|
||||
These commands use the exact same validation logic as our CI pipeline, helping you catch issues before pushing. The command definitions are stored in `.claude/commands/` for both local and CI use.
|
||||
|
||||
### Before Committing
|
||||
|
||||
1. **Run quality checks**:
|
||||
```bash
|
||||
uv run ruff check skills/ --fix
|
||||
uv run ruff format skills/
|
||||
|
||||
uv run python scripts/validate_notebooks.py
|
||||
```
|
||||
|
||||
3. **Test notebook execution** (optional, requires API key):
|
||||
```bash
|
||||
uv run jupyter nbconvert --to notebook \
|
||||
--execute skills/classification/guide.ipynb \
|
||||
--ExecutePreprocessor.kernel_name=python3 \
|
||||
--output test_output.ipynb
|
||||
```
|
||||
|
||||
### Pre-commit Hooks
|
||||
|
||||
Pre-commit hooks will automatically run before each commit to ensure code quality:
|
||||
|
||||
- Format code with ruff
|
||||
- Validate notebook structure
|
||||
|
||||
If a hook fails, fix the issues and try committing again.
|
||||
|
||||
## Contribution Guidelines
|
||||
|
||||
### Notebook Best Practices
|
||||
|
||||
1. **Use environment variables for API keys**:
|
||||
```python
|
||||
import os
|
||||
api_key = os.environ.get("ANTHROPIC_API_KEY")
|
||||
```
|
||||
|
||||
2. **Use current Claude models**:
|
||||
- Use model aliases for better maintainability when available
|
||||
- Latest Haiku model: `claude-haiku-4-5-20251001` (Haiku 4.5)
|
||||
- Check current models at: https://docs.claude.com/en/docs/about-claude/models/overview
|
||||
- Claude will automatically validate model usage in PR reviews
|
||||
|
||||
3. **Keep notebooks focused**:
|
||||
- One concept per notebook
|
||||
- Clear explanations and comments
|
||||
- Include expected outputs as markdown cells
|
||||
|
||||
4. **Test your notebooks**:
|
||||
- Ensure they run from top to bottom without errors
|
||||
- Use minimal tokens for example API calls
|
||||
- Include error handling
|
||||
|
||||
### Git Workflow
|
||||
|
||||
1. **Create a feature branch**:
|
||||
```bash
|
||||
git checkout -b <your-name>/<feature-description>
|
||||
# Example: git checkout -b alice/add-rag-example
|
||||
```
|
||||
|
||||
2. **Use conventional commits**:
|
||||
```bash
|
||||
# Format: <type>(<scope>): <subject>
|
||||
|
||||
# Types:
|
||||
feat # New feature
|
||||
fix # Bug fix
|
||||
docs # Documentation
|
||||
style # Formatting
|
||||
refactor # Code restructuring
|
||||
test # Tests
|
||||
chore # Maintenance
|
||||
ci # CI/CD changes
|
||||
|
||||
# Examples:
|
||||
git commit -m "feat(skills): add text-to-sql notebook"
|
||||
git commit -m "fix(api): use environment variable for API key"
|
||||
git commit -m "docs(readme): update installation instructions"
|
||||
```
|
||||
|
||||
3. **Keep commits atomic**:
|
||||
- One logical change per commit
|
||||
- Write clear, descriptive messages
|
||||
- Reference issues when applicable
|
||||
|
||||
4. **Push and create PR**:
|
||||
```bash
|
||||
git push -u origin your-branch-name
|
||||
gh pr create # Or use GitHub web interface
|
||||
```
|
||||
|
||||
### Pull Request Guidelines
|
||||
|
||||
1. **PR Title**: Use conventional commit format
|
||||
2. **Description**: Include:
|
||||
- What changes you made
|
||||
- Why you made them
|
||||
- How to test them
|
||||
- Related issue numbers
|
||||
3. **Keep PRs focused**: One feature/fix per PR
|
||||
4. **Respond to feedback**: Address review comments promptly
|
||||
|
||||
## Testing
|
||||
|
||||
### Local Testing
|
||||
|
||||
Run the validation suite:
|
||||
|
||||
```bash
|
||||
# Check all notebooks
|
||||
uv run python scripts/validate_notebooks.py
|
||||
|
||||
# Run pre-commit on all files
|
||||
uv run pre-commit run --all-files
|
||||
```
|
||||
|
||||
### CI/CD
|
||||
|
||||
Our GitHub Actions workflows will automatically:
|
||||
|
||||
- Validate notebook structure
|
||||
- Lint code with ruff
|
||||
- Test notebook execution (for maintainers)
|
||||
- Check links
|
||||
- Claude reviews code and model usage
|
||||
|
||||
External contributors will have limited API testing to conserve resources.
|
||||
|
||||
## Getting Help
|
||||
|
||||
- **Issues**: [GitHub Issues](https://github.com/anthropics/anthropic-cookbook/issues)
|
||||
- **Discussions**: [GitHub Discussions](https://github.com/anthropics/anthropic-cookbook/discussions)
|
||||
- **Discord**: [Anthropic Discord](https://www.anthropic.com/discord)
|
||||
|
||||
## Security
|
||||
|
||||
- Never commit API keys or secrets
|
||||
- Use environment variables for sensitive data
|
||||
- Report security issues privately to security@anthropic.com
|
||||
|
||||
## License
|
||||
|
||||
By contributing, you agree that your contributions will be licensed under the same license as the project (MIT License).
|
||||
@@ -0,0 +1,68 @@
|
||||
# Claude Cookbooks
|
||||
|
||||
The Claude Cookbooks provide code and guides designed to help developers build with Claude, offering copy-able code snippets that you can easily integrate into your own projects.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
To make the most of the examples in this cookbook, you'll need an Claude API key (sign up for free [here](https://www.anthropic.com)).
|
||||
|
||||
While the code examples are primarily written in Python, the concepts can be adapted to any programming language that supports interaction with the Claude API.
|
||||
|
||||
If you're new to working with the Claude API, we recommend starting with our [Claude API Fundamentals course](https://github.com/anthropics/courses/tree/master/anthropic_api_fundamentals) to get a solid foundation.
|
||||
|
||||
## Explore Further
|
||||
|
||||
Looking for more resources to enhance your experience with Claude and AI assistants? Check out these helpful links:
|
||||
|
||||
- [Anthropic developer documentation](https://docs.claude.com/claude/docs/guide-to-anthropics-prompt-engineering-resources)
|
||||
- [Anthropic support docs](https://support.anthropic.com)
|
||||
- [Anthropic Discord community](https://www.anthropic.com/discord)
|
||||
|
||||
## Contributing
|
||||
|
||||
The Claude Cookbooks thrives on the contributions of the developer community. We value your input, whether it's submitting an idea, fixing a typo, adding a new guide, or improving an existing one. By contributing, you help make this resource even more valuable for everyone.
|
||||
|
||||
To avoid duplication of efforts, please review the existing issues and pull requests before contributing.
|
||||
|
||||
If you have ideas for new examples or guides, share them on the [issues page](https://github.com/anthropics/anthropic-cookbook/issues).
|
||||
|
||||
## Table of recipes
|
||||
|
||||
### Capabilities
|
||||
- [Classification](https://github.com/anthropics/anthropic-cookbook/tree/main/capabilities/classification): Explore techniques for text and data classification using Claude.
|
||||
- [Retrieval Augmented Generation](https://github.com/anthropics/anthropic-cookbook/tree/main/capabilities/retrieval_augmented_generation): Learn how to enhance Claude's responses with external knowledge.
|
||||
- [Summarization](https://github.com/anthropics/anthropic-cookbook/tree/main/capabilities/summarization): Discover techniques for effective text summarization with Claude.
|
||||
|
||||
### Tool Use and Integration
|
||||
- [Tool use](https://github.com/anthropics/anthropic-cookbook/tree/main/tool_use): Learn how to integrate Claude with external tools and functions to extend its capabilities.
|
||||
- [Customer service agent](https://github.com/anthropics/anthropic-cookbook/blob/main/tool_use/customer_service_agent.ipynb)
|
||||
- [Calculator integration](https://github.com/anthropics/anthropic-cookbook/blob/main/tool_use/calculator_tool.ipynb)
|
||||
- [SQL queries](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/how_to_make_sql_queries.ipynb)
|
||||
|
||||
### Third-Party Integrations
|
||||
- [Retrieval augmented generation](https://github.com/anthropics/anthropic-cookbook/tree/main/third_party): Supplement Claude's knowledge with external data sources.
|
||||
- [Vector databases (Pinecone)](https://github.com/anthropics/anthropic-cookbook/blob/main/third_party/Pinecone/rag_using_pinecone.ipynb)
|
||||
- [Wikipedia](https://github.com/anthropics/anthropic-cookbook/blob/main/third_party/Wikipedia/wikipedia-search-cookbook.ipynb/)
|
||||
- [Web pages](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/read_web_pages_with_haiku.ipynb)
|
||||
- [Embeddings with Voyage AI](https://github.com/anthropics/anthropic-cookbook/blob/main/third_party/VoyageAI/how_to_create_embeddings.md)
|
||||
|
||||
### Multimodal Capabilities
|
||||
- [Vision with Claude](https://github.com/anthropics/anthropic-cookbook/tree/main/multimodal):
|
||||
- [Getting started with images](https://github.com/anthropics/anthropic-cookbook/blob/main/multimodal/getting_started_with_vision.ipynb)
|
||||
- [Best practices for vision](https://github.com/anthropics/anthropic-cookbook/blob/main/multimodal/best_practices_for_vision.ipynb)
|
||||
- [Interpreting charts and graphs](https://github.com/anthropics/anthropic-cookbook/blob/main/multimodal/reading_charts_graphs_powerpoints.ipynb)
|
||||
- [Extracting content from forms](https://github.com/anthropics/anthropic-cookbook/blob/main/multimodal/how_to_transcribe_text.ipynb)
|
||||
- [Generate images with Claude](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/illustrated_responses.ipynb): Use Claude with Stable Diffusion for image generation.
|
||||
|
||||
### Advanced Techniques
|
||||
- [Sub-agents](https://github.com/anthropics/anthropic-cookbook/blob/main/multimodal/using_sub_agents.ipynb): Learn how to use Haiku as a sub-agent in combination with Opus.
|
||||
- [Upload PDFs to Claude](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/pdf_upload_summarization.ipynb): Parse and pass PDFs as text to Claude.
|
||||
- [Automated evaluations](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/building_evals.ipynb): Use Claude to automate the prompt evaluation process.
|
||||
- [Enable JSON mode](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/how_to_enable_json_mode.ipynb): Ensure consistent JSON output from Claude.
|
||||
- [Create a moderation filter](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/building_moderation_filter.ipynb): Use Claude to create a content moderation filter for your application.
|
||||
- [Prompt caching](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/prompt_caching.ipynb): Learn techniques for efficient prompt caching with Claude.
|
||||
|
||||
## Additional Resources
|
||||
|
||||
- [Anthropic on AWS](https://github.com/aws-samples/anthropic-on-aws): Explore examples and solutions for using Claude on AWS infrastructure.
|
||||
- [AWS Samples](https://github.com/aws-samples/): A collection of code samples from AWS which can be adapted for use with Claude. Note that some samples may require modification to work optimally with Claude.
|
||||
@@ -0,0 +1,19 @@
|
||||
# Claude Capabilities
|
||||
|
||||
Welcome to the Capabilities section of the Claude Cookbooks! This directory contains a collection of guides that showcase specific capabilities where Claude excels. Each guide provides an in-depth exploration of a particular capability, discussing potential use cases, prompt engineering techniques to optimize results, and approaches for evaluating Claude's performance.
|
||||
|
||||
## Guides
|
||||
|
||||
- **[Classification with Claude](./classification/guide.ipynb)**: Discover how Claude can revolutionize classification tasks, especially in scenarios with complex business rules and limited training data. This guide walks you through data preparation, prompt engineering with retrieval-augmented generation (RAG), testing, and evaluation.
|
||||
|
||||
- **[Retrieval Augmented Generation with Claude](./retrieval_augmented_generation/guide.ipynb)**: Learn how to enhance Claude's capabilities with domain-specific knowledge using RAG. This guide demonstrates how to build a RAG system from scratch, optimize its performance, and create an evaluation suite. You'll learn how techniques like summary indexing and re-ranking can significantly improve precision, recall, and overall accuracy in question-answering tasks.
|
||||
|
||||
- **[Retrieval Augmented Generation with Contextual Embeddings](./contextual-embeddings/guide.ipynb)**: Learn how to use a new technique to improve the performance of your RAG system. In traditional RAG, documents are typically split into smaller chunks for efficient retrieval. While this approach works well for many applications, it can lead to problems when individual chunks lack sufficient context. Contextual Embeddings solve this problem by adding relevant context to each chunk before embedding. You'll learn how to use contextual embeddings with semantic search, BM25 search, and reranking to improve performance.
|
||||
|
||||
- **[Summarization with Claude](./summarization/guide.ipynb)**: Explore Claude's ability to summarize and synthesize information from multiple sources. This guide covers a variety of summarization techniques, including multi-shot, domain-based, and chunking methods, as well as strategies for handling long-form content and multiple documents. We also explore evaluating summaries, which can be a balance of art, subjectivity, and the right approach!
|
||||
|
||||
- **[Text-to-SQL with Claude](./text_to_sql/guide.ipynb)**: This guide covers how to generate complex SQL queries from natural language using prompting techniques, self-improvement, and RAG. We'll also explore how to evaluate and improve the accuracy of generated SQL queries, with evals that test for syntax, data correctness, row count, and more.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To get started with these guides, simply navigate to the desired guide's directory and follow the instructions provided in the `guide.ipynb` file. Each guide is self-contained and includes all the necessary code, data, and evaluation scripts to reproduce the examples and experiments.
|
||||
@@ -0,0 +1,31 @@
|
||||
# Claude Cookbooks - Reference Index
|
||||
|
||||
This skill contains code and guides for building with Claude AI.
|
||||
|
||||
## Categories
|
||||
|
||||
### Capabilities
|
||||
- [Classification](capabilities.md#classification)
|
||||
- [Retrieval Augmented Generation](capabilities.md#rag)
|
||||
- [Summarization](capabilities.md#summarization)
|
||||
- [Text to SQL](capabilities.md#text-to-sql)
|
||||
|
||||
### Tool Use and Integration
|
||||
- [Tool Use Basics](tool_use.md#basics)
|
||||
- [Customer Service Agent](tool_use.md#customer-service)
|
||||
- [Calculator Integration](tool_use.md#calculator)
|
||||
|
||||
### Multimodal
|
||||
- [Vision with Claude](multimodal.md#vision)
|
||||
- [Image Generation](multimodal.md#generation)
|
||||
- [Charts and Graphs](multimodal.md#charts)
|
||||
|
||||
### Advanced Patterns
|
||||
- [Agents](patterns.md#agents)
|
||||
- [Sub-agents](patterns.md#sub-agents)
|
||||
- [Prompt Caching](patterns.md#caching)
|
||||
|
||||
### Third Party Integrations
|
||||
- [Vector Databases](third_party.md#vector-db)
|
||||
- [Embeddings](third_party.md#embeddings)
|
||||
- [LlamaIndex](third_party.md#llamaindex)
|
||||
@@ -0,0 +1,68 @@
|
||||
# Claude Cookbooks
|
||||
|
||||
The Claude Cookbooks provide code and guides designed to help developers build with Claude, offering copy-able code snippets that you can easily integrate into your own projects.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
To make the most of the examples in this cookbook, you'll need an Claude API key (sign up for free [here](https://www.anthropic.com)).
|
||||
|
||||
While the code examples are primarily written in Python, the concepts can be adapted to any programming language that supports interaction with the Claude API.
|
||||
|
||||
If you're new to working with the Claude API, we recommend starting with our [Claude API Fundamentals course](https://github.com/anthropics/courses/tree/master/anthropic_api_fundamentals) to get a solid foundation.
|
||||
|
||||
## Explore Further
|
||||
|
||||
Looking for more resources to enhance your experience with Claude and AI assistants? Check out these helpful links:
|
||||
|
||||
- [Anthropic developer documentation](https://docs.claude.com/claude/docs/guide-to-anthropics-prompt-engineering-resources)
|
||||
- [Anthropic support docs](https://support.anthropic.com)
|
||||
- [Anthropic Discord community](https://www.anthropic.com/discord)
|
||||
|
||||
## Contributing
|
||||
|
||||
The Claude Cookbooks thrives on the contributions of the developer community. We value your input, whether it's submitting an idea, fixing a typo, adding a new guide, or improving an existing one. By contributing, you help make this resource even more valuable for everyone.
|
||||
|
||||
To avoid duplication of efforts, please review the existing issues and pull requests before contributing.
|
||||
|
||||
If you have ideas for new examples or guides, share them on the [issues page](https://github.com/anthropics/anthropic-cookbook/issues).
|
||||
|
||||
## Table of recipes
|
||||
|
||||
### Capabilities
|
||||
- [Classification](https://github.com/anthropics/anthropic-cookbook/tree/main/capabilities/classification): Explore techniques for text and data classification using Claude.
|
||||
- [Retrieval Augmented Generation](https://github.com/anthropics/anthropic-cookbook/tree/main/capabilities/retrieval_augmented_generation): Learn how to enhance Claude's responses with external knowledge.
|
||||
- [Summarization](https://github.com/anthropics/anthropic-cookbook/tree/main/capabilities/summarization): Discover techniques for effective text summarization with Claude.
|
||||
|
||||
### Tool Use and Integration
|
||||
- [Tool use](https://github.com/anthropics/anthropic-cookbook/tree/main/tool_use): Learn how to integrate Claude with external tools and functions to extend its capabilities.
|
||||
- [Customer service agent](https://github.com/anthropics/anthropic-cookbook/blob/main/tool_use/customer_service_agent.ipynb)
|
||||
- [Calculator integration](https://github.com/anthropics/anthropic-cookbook/blob/main/tool_use/calculator_tool.ipynb)
|
||||
- [SQL queries](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/how_to_make_sql_queries.ipynb)
|
||||
|
||||
### Third-Party Integrations
|
||||
- [Retrieval augmented generation](https://github.com/anthropics/anthropic-cookbook/tree/main/third_party): Supplement Claude's knowledge with external data sources.
|
||||
- [Vector databases (Pinecone)](https://github.com/anthropics/anthropic-cookbook/blob/main/third_party/Pinecone/rag_using_pinecone.ipynb)
|
||||
- [Wikipedia](https://github.com/anthropics/anthropic-cookbook/blob/main/third_party/Wikipedia/wikipedia-search-cookbook.ipynb/)
|
||||
- [Web pages](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/read_web_pages_with_haiku.ipynb)
|
||||
- [Embeddings with Voyage AI](https://github.com/anthropics/anthropic-cookbook/blob/main/third_party/VoyageAI/how_to_create_embeddings.md)
|
||||
|
||||
### Multimodal Capabilities
|
||||
- [Vision with Claude](https://github.com/anthropics/anthropic-cookbook/tree/main/multimodal):
|
||||
- [Getting started with images](https://github.com/anthropics/anthropic-cookbook/blob/main/multimodal/getting_started_with_vision.ipynb)
|
||||
- [Best practices for vision](https://github.com/anthropics/anthropic-cookbook/blob/main/multimodal/best_practices_for_vision.ipynb)
|
||||
- [Interpreting charts and graphs](https://github.com/anthropics/anthropic-cookbook/blob/main/multimodal/reading_charts_graphs_powerpoints.ipynb)
|
||||
- [Extracting content from forms](https://github.com/anthropics/anthropic-cookbook/blob/main/multimodal/how_to_transcribe_text.ipynb)
|
||||
- [Generate images with Claude](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/illustrated_responses.ipynb): Use Claude with Stable Diffusion for image generation.
|
||||
|
||||
### Advanced Techniques
|
||||
- [Sub-agents](https://github.com/anthropics/anthropic-cookbook/blob/main/multimodal/using_sub_agents.ipynb): Learn how to use Haiku as a sub-agent in combination with Opus.
|
||||
- [Upload PDFs to Claude](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/pdf_upload_summarization.ipynb): Parse and pass PDFs as text to Claude.
|
||||
- [Automated evaluations](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/building_evals.ipynb): Use Claude to automate the prompt evaluation process.
|
||||
- [Enable JSON mode](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/how_to_enable_json_mode.ipynb): Ensure consistent JSON output from Claude.
|
||||
- [Create a moderation filter](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/building_moderation_filter.ipynb): Use Claude to create a content moderation filter for your application.
|
||||
- [Prompt caching](https://github.com/anthropics/anthropic-cookbook/blob/main/misc/prompt_caching.ipynb): Learn techniques for efficient prompt caching with Claude.
|
||||
|
||||
## Additional Resources
|
||||
|
||||
- [Anthropic on AWS](https://github.com/aws-samples/anthropic-on-aws): Explore examples and solutions for using Claude on AWS infrastructure.
|
||||
- [AWS Samples](https://github.com/aws-samples/): A collection of code samples from AWS which can be adapted for use with Claude. Note that some samples may require modification to work optimally with Claude.
|
||||
@@ -0,0 +1,66 @@
|
||||
# Multimodal Capabilities with Claude
|
||||
|
||||
Source: anthropics/claude-cookbooks/multimodal
|
||||
|
||||
## Vision Capabilities
|
||||
|
||||
### Getting Started with Images
|
||||
- **Location**: `multimodal/getting_started_with_vision.ipynb`
|
||||
- **Topics**: Image upload, analysis, OCR, visual question answering
|
||||
|
||||
### Best Practices for Vision
|
||||
- **Location**: `multimodal/best_practices_for_vision.ipynb`
|
||||
- **Topics**: Image quality, prompt engineering for vision, error handling
|
||||
|
||||
### Charts and Graphs
|
||||
- **Location**: `multimodal/reading_charts_graphs_powerpoints.ipynb`
|
||||
- **Topics**: Data extraction from charts, graph interpretation, PowerPoint analysis
|
||||
|
||||
### Form Extraction
|
||||
- **Location**: `multimodal/how_to_transcribe_text.ipynb`
|
||||
- **Topics**: OCR, structured data extraction, form processing
|
||||
|
||||
## Image Generation
|
||||
|
||||
### Illustrated Responses
|
||||
- **Location**: `misc/illustrated_responses.ipynb`
|
||||
- **Topics**: Integration with Stable Diffusion, image generation prompts
|
||||
|
||||
## Code Examples
|
||||
|
||||
```python
|
||||
# Vision API example
|
||||
import anthropic
|
||||
|
||||
client = anthropic.Anthropic()
|
||||
|
||||
# Analyze an image
|
||||
response = client.messages.create(
|
||||
model="claude-3-5-sonnet-20241022",
|
||||
max_tokens=1024,
|
||||
messages=[{
|
||||
"role": "user",
|
||||
"content": [
|
||||
{
|
||||
"type": "image",
|
||||
"source": {
|
||||
"type": "base64",
|
||||
"media_type": "image/jpeg",
|
||||
"data": image_base64
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "What's in this image?"
|
||||
}
|
||||
]
|
||||
}]
|
||||
)
|
||||
```
|
||||
|
||||
## Tips
|
||||
|
||||
1. **Image Quality**: Higher resolution images provide better results
|
||||
2. **Prompt Clarity**: Be specific about what you want to extract or analyze
|
||||
3. **Format Support**: JPEG, PNG, GIF, WebP supported
|
||||
4. **Size Limits**: Max 5MB per image
|
||||
@@ -0,0 +1,20 @@
|
||||
# Building Effective Agents Cookbook
|
||||
|
||||
Reference implementation for [Building Effective Agents](https://anthropic.com/research/building-effective-agents) by Erik Schluntz and Barry Zhang.
|
||||
|
||||
This repository contains example minimal implementations of common agent workflows discussed in the blog:
|
||||
|
||||
- Basic Building Blocks
|
||||
- Prompt Chaining
|
||||
- Routing
|
||||
- Multi-LLM Parallelization
|
||||
- Advanced Workflows
|
||||
- Orchestrator-Subagents
|
||||
- Evaluator-Optimizer
|
||||
|
||||
## Getting Started
|
||||
See the Jupyter notebooks for detailed examples:
|
||||
|
||||
- [Basic Workflows](basic_workflows.ipynb)
|
||||
- [Evaluator-Optimizer Workflow](evaluator_optimizer.ipynb)
|
||||
- [Orchestrator-Workers Workflow](orchestrator_workers.ipynb)
|
||||
@@ -0,0 +1,39 @@
|
||||
# Third Party Integrations
|
||||
|
||||
Source: anthropics/claude-cookbooks/third_party
|
||||
|
||||
## Vector Databases
|
||||
|
||||
### Pinecone
|
||||
- **Location**: `third_party/Pinecone/rag_using_pinecone.ipynb`
|
||||
- **Use Case**: Retrieval Augmented Generation with vector search
|
||||
- **Key Concepts**: Embeddings, similarity search, RAG pipeline
|
||||
|
||||
## Embeddings
|
||||
|
||||
### Voyage AI
|
||||
- **Location**: `third_party/VoyageAI/how_to_create_embeddings.md`
|
||||
- **Use Case**: Creating high-quality embeddings for semantic search
|
||||
- **Key Concepts**: Embedding models, dimensionality, similarity metrics
|
||||
|
||||
## Search Integrations
|
||||
|
||||
### Wikipedia
|
||||
- **Location**: `third_party/Wikipedia/wikipedia-search-cookbook.ipynb`
|
||||
- **Use Case**: Augment Claude with Wikipedia knowledge
|
||||
- **Key Concepts**: API integration, knowledge retrieval
|
||||
|
||||
### Web Pages
|
||||
- **Location**: `misc/read_web_pages_with_haiku.ipynb`
|
||||
- **Use Case**: Extract and analyze web page content
|
||||
- **Key Concepts**: Web scraping, content extraction
|
||||
|
||||
## LlamaIndex
|
||||
- **Location**: `third_party/LlamaIndex/`
|
||||
- **Use Case**: Advanced document indexing and retrieval
|
||||
- **Key Concepts**: Index creation, query engines, document loaders
|
||||
|
||||
## Deepgram
|
||||
- **Location**: `third_party/Deepgram/`
|
||||
- **Use Case**: Audio transcription integration
|
||||
- **Key Concepts**: Speech-to-text, audio processing
|
||||
@@ -0,0 +1,55 @@
|
||||
# Tool Use with Claude
|
||||
|
||||
Source: anthropics/claude-cookbooks/tool_use
|
||||
|
||||
## Overview
|
||||
|
||||
Learn how to integrate Claude with external tools and functions to extend its capabilities.
|
||||
|
||||
## Key Examples
|
||||
|
||||
### Customer Service Agent
|
||||
- **Location**: `tool_use/customer_service_agent.ipynb`
|
||||
- **Description**: Build an intelligent customer service agent using Claude with tool integration
|
||||
- **Key Concepts**: Function calling, state management, conversation flow
|
||||
|
||||
### Calculator Integration
|
||||
- **Location**: `tool_use/calculator_tool.ipynb`
|
||||
- **Description**: Integrate external calculation tools with Claude
|
||||
- **Key Concepts**: Tool definitions, parameter passing, result handling
|
||||
|
||||
### Memory Demo
|
||||
- **Location**: `tool_use/memory_demo/`
|
||||
- **Description**: Implement persistent memory for Claude conversations
|
||||
- **Key Concepts**: Context management, state persistence
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Tool Definition**: Define clear, specific tool schemas
|
||||
2. **Error Handling**: Implement robust error handling for tool calls
|
||||
3. **Validation**: Validate tool inputs and outputs
|
||||
4. **Context**: Maintain context across tool interactions
|
||||
|
||||
## Common Patterns
|
||||
|
||||
```python
|
||||
# Tool definition example
|
||||
tools = [{
|
||||
"name": "calculator",
|
||||
"description": "Performs basic arithmetic operations",
|
||||
"input_schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"operation": {"type": "string"},
|
||||
"a": {"type": "number"},
|
||||
"b": {"type": "number"}
|
||||
},
|
||||
"required": ["operation", "a", "b"]
|
||||
}
|
||||
}]
|
||||
```
|
||||
|
||||
## Related Resources
|
||||
|
||||
- [Anthropic Tool Use Documentation](https://docs.claude.com/claude/docs/tool-use)
|
||||
- [API Reference](https://docs.claude.com/claude/reference)
|
||||
@@ -0,0 +1,362 @@
|
||||
"""
|
||||
Production-ready memory tool handler for Claude's memory_20250818 tool.
|
||||
|
||||
This implementation provides secure, client-side execution of memory operations
|
||||
with path validation, error handling, and comprehensive security measures.
|
||||
"""
|
||||
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
|
||||
class MemoryToolHandler:
|
||||
"""
|
||||
Handles execution of Claude's memory tool commands.
|
||||
|
||||
The memory tool enables Claude to read, write, and manage files in a memory
|
||||
system through a standardized tool interface. This handler provides client-side
|
||||
implementation with security controls.
|
||||
|
||||
Attributes:
|
||||
base_path: Root directory for memory storage
|
||||
memory_root: The /memories directory within base_path
|
||||
"""
|
||||
|
||||
def __init__(self, base_path: str = "./memory_storage"):
|
||||
"""
|
||||
Initialize the memory tool handler.
|
||||
|
||||
Args:
|
||||
base_path: Root directory for all memory operations
|
||||
"""
|
||||
self.base_path = Path(base_path).resolve()
|
||||
self.memory_root = self.base_path / "memories"
|
||||
self.memory_root.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
def _validate_path(self, path: str) -> Path:
|
||||
"""
|
||||
Validate and resolve memory paths to prevent directory traversal attacks.
|
||||
|
||||
Args:
|
||||
path: The path to validate (must start with /memories)
|
||||
|
||||
Returns:
|
||||
Resolved absolute Path object within memory_root
|
||||
|
||||
Raises:
|
||||
ValueError: If path is invalid or attempts to escape memory directory
|
||||
"""
|
||||
if not path.startswith("/memories"):
|
||||
raise ValueError(
|
||||
f"Path must start with /memories, got: {path}. "
|
||||
"All memory operations must be confined to the /memories directory."
|
||||
)
|
||||
|
||||
# Remove /memories prefix and any leading slashes
|
||||
relative_path = path[len("/memories") :].lstrip("/")
|
||||
|
||||
# Resolve to absolute path within memory_root
|
||||
if relative_path:
|
||||
full_path = (self.memory_root / relative_path).resolve()
|
||||
else:
|
||||
full_path = self.memory_root.resolve()
|
||||
|
||||
# Verify the resolved path is still within memory_root
|
||||
try:
|
||||
full_path.relative_to(self.memory_root.resolve())
|
||||
except ValueError as e:
|
||||
raise ValueError(
|
||||
f"Path '{path}' would escape /memories directory. "
|
||||
"Directory traversal attempts are not allowed."
|
||||
) from e
|
||||
|
||||
return full_path
|
||||
|
||||
def execute(self, **params: Any) -> dict[str, str]:
|
||||
"""
|
||||
Execute a memory tool command.
|
||||
|
||||
Args:
|
||||
**params: Command parameters from Claude's tool use
|
||||
|
||||
Returns:
|
||||
Dict with either 'success' or 'error' key
|
||||
|
||||
Supported commands:
|
||||
- view: Show directory contents or file contents
|
||||
- create: Create or overwrite a file
|
||||
- str_replace: Replace text in a file
|
||||
- insert: Insert text at a specific line
|
||||
- delete: Delete a file or directory
|
||||
- rename: Rename or move a file/directory
|
||||
"""
|
||||
command = params.get("command")
|
||||
|
||||
try:
|
||||
if command == "view":
|
||||
return self._view(params)
|
||||
elif command == "create":
|
||||
return self._create(params)
|
||||
elif command == "str_replace":
|
||||
return self._str_replace(params)
|
||||
elif command == "insert":
|
||||
return self._insert(params)
|
||||
elif command == "delete":
|
||||
return self._delete(params)
|
||||
elif command == "rename":
|
||||
return self._rename(params)
|
||||
else:
|
||||
return {
|
||||
"error": f"Unknown command: '{command}'. "
|
||||
"Valid commands are: view, create, str_replace, insert, delete, rename"
|
||||
}
|
||||
except ValueError as e:
|
||||
return {"error": str(e)}
|
||||
except Exception as e:
|
||||
return {"error": f"Unexpected error executing {command}: {e}"}
|
||||
|
||||
def _view(self, params: dict[str, Any]) -> dict[str, str]:
|
||||
"""View directory contents or file contents."""
|
||||
path = params.get("path")
|
||||
view_range = params.get("view_range")
|
||||
|
||||
if not path:
|
||||
return {"error": "Missing required parameter: path"}
|
||||
|
||||
full_path = self._validate_path(path)
|
||||
|
||||
# Handle directory listing
|
||||
if full_path.is_dir():
|
||||
try:
|
||||
items = []
|
||||
for item in sorted(full_path.iterdir()):
|
||||
if item.name.startswith("."):
|
||||
continue
|
||||
items.append(f"{item.name}/" if item.is_dir() else item.name)
|
||||
|
||||
if not items:
|
||||
return {"success": f"Directory: {path}\n(empty)"}
|
||||
|
||||
return {
|
||||
"success": f"Directory: {path}\n" + "\n".join([f"- {item}" for item in items])
|
||||
}
|
||||
except Exception as e:
|
||||
return {"error": f"Cannot read directory {path}: {e}"}
|
||||
|
||||
# Handle file reading
|
||||
elif full_path.is_file():
|
||||
try:
|
||||
content = full_path.read_text(encoding="utf-8")
|
||||
lines = content.splitlines()
|
||||
|
||||
# Apply view range if specified
|
||||
if view_range:
|
||||
start_line = max(1, view_range[0]) - 1 # Convert to 0-indexed
|
||||
end_line = len(lines) if view_range[1] == -1 else view_range[1]
|
||||
lines = lines[start_line:end_line]
|
||||
start_num = start_line + 1
|
||||
else:
|
||||
start_num = 1
|
||||
|
||||
# Format with line numbers
|
||||
numbered_lines = [f"{i + start_num:4d}: {line}" for i, line in enumerate(lines)]
|
||||
return {"success": "\n".join(numbered_lines)}
|
||||
|
||||
except UnicodeDecodeError:
|
||||
return {"error": f"Cannot read {path}: File is not valid UTF-8 text"}
|
||||
except Exception as e:
|
||||
return {"error": f"Cannot read file {path}: {e}"}
|
||||
|
||||
else:
|
||||
return {"error": f"Path not found: {path}"}
|
||||
|
||||
def _create(self, params: dict[str, Any]) -> dict[str, str]:
|
||||
"""Create or overwrite a file."""
|
||||
path = params.get("path")
|
||||
file_text = params.get("file_text", "")
|
||||
|
||||
if not path:
|
||||
return {"error": "Missing required parameter: path"}
|
||||
|
||||
full_path = self._validate_path(path)
|
||||
|
||||
# Don't allow creating directories directly
|
||||
if not path.endswith((".txt", ".md", ".json", ".py", ".yaml", ".yml")):
|
||||
return {
|
||||
"error": f"Cannot create {path}: Only text files are supported. "
|
||||
"Use file extensions: .txt, .md, .json, .py, .yaml, .yml"
|
||||
}
|
||||
|
||||
try:
|
||||
# Create parent directories if needed
|
||||
full_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# Write the file
|
||||
full_path.write_text(file_text, encoding="utf-8")
|
||||
return {"success": f"File created successfully at {path}"}
|
||||
|
||||
except Exception as e:
|
||||
return {"error": f"Cannot create file {path}: {e}"}
|
||||
|
||||
def _str_replace(self, params: dict[str, Any]) -> dict[str, str]:
|
||||
"""Replace text in a file."""
|
||||
path = params.get("path")
|
||||
old_str = params.get("old_str")
|
||||
new_str = params.get("new_str", "")
|
||||
|
||||
if not path or old_str is None:
|
||||
return {"error": "Missing required parameters: path, old_str"}
|
||||
|
||||
full_path = self._validate_path(path)
|
||||
|
||||
if not full_path.is_file():
|
||||
return {"error": f"File not found: {path}"}
|
||||
|
||||
try:
|
||||
content = full_path.read_text(encoding="utf-8")
|
||||
|
||||
# Check if old_str exists
|
||||
count = content.count(old_str)
|
||||
if count == 0:
|
||||
return {
|
||||
"error": f"String not found in {path}. The exact text must exist in the file."
|
||||
}
|
||||
elif count > 1:
|
||||
return {
|
||||
"error": f"String appears {count} times in {path}. "
|
||||
"The string must be unique. Use more specific context."
|
||||
}
|
||||
|
||||
# Perform replacement
|
||||
new_content = content.replace(old_str, new_str, 1)
|
||||
full_path.write_text(new_content, encoding="utf-8")
|
||||
|
||||
return {"success": f"File {path} has been edited successfully"}
|
||||
|
||||
except Exception as e:
|
||||
return {"error": f"Cannot edit file {path}: {e}"}
|
||||
|
||||
def _insert(self, params: dict[str, Any]) -> dict[str, str]:
|
||||
"""Insert text at a specific line."""
|
||||
path = params.get("path")
|
||||
insert_line = params.get("insert_line")
|
||||
insert_text = params.get("insert_text", "")
|
||||
|
||||
if not path or insert_line is None:
|
||||
return {"error": "Missing required parameters: path, insert_line"}
|
||||
|
||||
full_path = self._validate_path(path)
|
||||
|
||||
if not full_path.is_file():
|
||||
return {"error": f"File not found: {path}"}
|
||||
|
||||
try:
|
||||
lines = full_path.read_text(encoding="utf-8").splitlines()
|
||||
|
||||
# Validate insert_line
|
||||
if insert_line < 0 or insert_line > len(lines):
|
||||
return {
|
||||
"error": f"Invalid insert_line {insert_line}. "
|
||||
f"Must be between 0 and {len(lines)}"
|
||||
}
|
||||
|
||||
# Insert the text
|
||||
lines.insert(insert_line, insert_text.rstrip("\n"))
|
||||
|
||||
# Write back
|
||||
full_path.write_text("\n".join(lines) + "\n", encoding="utf-8")
|
||||
|
||||
return {"success": f"Text inserted at line {insert_line} in {path}"}
|
||||
|
||||
except Exception as e:
|
||||
return {"error": f"Cannot insert into {path}: {e}"}
|
||||
|
||||
def _delete(self, params: dict[str, Any]) -> dict[str, str]:
|
||||
"""Delete a file or directory."""
|
||||
path = params.get("path")
|
||||
|
||||
if not path:
|
||||
return {"error": "Missing required parameter: path"}
|
||||
|
||||
# Prevent deletion of root memories directory
|
||||
if path == "/memories":
|
||||
return {"error": "Cannot delete the /memories directory itself"}
|
||||
|
||||
full_path = self._validate_path(path)
|
||||
|
||||
# Verify the path is within /memories to prevent accidental deletion outside the memory directory
|
||||
# This provides an additional safety check beyond _validate_path
|
||||
try:
|
||||
full_path.relative_to(self.memory_root.resolve())
|
||||
except ValueError:
|
||||
return {
|
||||
"error": f"Invalid operation: Path '{path}' is not within /memories directory. "
|
||||
"Only paths within /memories can be deleted."
|
||||
}
|
||||
|
||||
if not full_path.exists():
|
||||
return {"error": f"Path not found: {path}"}
|
||||
|
||||
try:
|
||||
if full_path.is_file():
|
||||
full_path.unlink()
|
||||
return {"success": f"File deleted: {path}"}
|
||||
elif full_path.is_dir():
|
||||
shutil.rmtree(full_path)
|
||||
return {"success": f"Directory deleted: {path}"}
|
||||
|
||||
except Exception as e:
|
||||
return {"error": f"Cannot delete {path}: {e}"}
|
||||
|
||||
def _rename(self, params: dict[str, Any]) -> dict[str, str]:
|
||||
"""Rename or move a file/directory."""
|
||||
old_path = params.get("old_path")
|
||||
new_path = params.get("new_path")
|
||||
|
||||
if not old_path or not new_path:
|
||||
return {"error": "Missing required parameters: old_path, new_path"}
|
||||
|
||||
old_full_path = self._validate_path(old_path)
|
||||
new_full_path = self._validate_path(new_path)
|
||||
|
||||
if not old_full_path.exists():
|
||||
return {"error": f"Source path not found: {old_path}"}
|
||||
|
||||
if new_full_path.exists():
|
||||
return {
|
||||
"error": f"Destination already exists: {new_path}. "
|
||||
"Cannot overwrite existing files/directories."
|
||||
}
|
||||
|
||||
try:
|
||||
# Create parent directories if needed
|
||||
new_full_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# Perform rename/move
|
||||
old_full_path.rename(new_full_path)
|
||||
|
||||
return {"success": f"Renamed {old_path} to {new_path}"}
|
||||
|
||||
except Exception as e:
|
||||
return {"error": f"Cannot rename {old_path} to {new_path}: {e}"}
|
||||
|
||||
def clear_all_memory(self) -> dict[str, str]:
|
||||
"""
|
||||
Clear all memory files (useful for testing or starting fresh).
|
||||
|
||||
⚠️ WARNING: This method is for demonstration and testing purposes only.
|
||||
In production, you should carefully consider whether you need to delete
|
||||
all memory files, as this will permanently remove all learned patterns
|
||||
and stored knowledge. Consider using selective deletion instead.
|
||||
|
||||
Returns:
|
||||
Dict with success message
|
||||
"""
|
||||
try:
|
||||
if self.memory_root.exists():
|
||||
shutil.rmtree(self.memory_root)
|
||||
self.memory_root.mkdir(parents=True, exist_ok=True)
|
||||
return {"success": "All memory cleared successfully"}
|
||||
except Exception as e:
|
||||
return {"error": f"Cannot clear memory: {e}"}
|
||||
@@ -0,0 +1,175 @@
|
||||
---
|
||||
name: headless-cli
|
||||
description: "无头模式 AI CLI 调用技能:支持 Gemini/Claude/Codex CLI 的无交互批量调用,包含 YOLO 模式和安全模式。用于批量翻译、代码审查、多模型编排等场景。"
|
||||
---
|
||||
|
||||
# Headless CLI 技能
|
||||
|
||||
无交互批量调用 AI CLI 工具,支持 stdin/stdout 管道,实现自动化工作流。
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
触发条件:
|
||||
- 需要批量处理文件(翻译、审查、格式化)
|
||||
- 需要在脚本中调用 AI 模型
|
||||
- 需要多模型串联/并联处理
|
||||
- 需要无人值守的 AI 任务执行
|
||||
|
||||
## Not For / Boundaries
|
||||
|
||||
不适用于:
|
||||
- 需要交互式对话的场景
|
||||
- 需要实时反馈的任务
|
||||
- 敏感操作(YOLO 模式需谨慎)
|
||||
|
||||
必需输入:
|
||||
- 已安装对应 CLI 工具
|
||||
- 已完成身份认证
|
||||
- 网络代理配置(如需)
|
||||
|
||||
## Quick Reference
|
||||
|
||||
### 🔴 YOLO 模式(全权限,跳过确认)
|
||||
|
||||
**Codex CLI**
|
||||
```bash
|
||||
# --yolo 是 --dangerously-bypass-approvals-and-sandbox 的别名
|
||||
alias c='codex --enable web_search_request -m gpt-5.3-codex-max -c model_reasoning_effort="high" --yolo'
|
||||
```
|
||||
|
||||
**Claude Code**
|
||||
```bash
|
||||
alias cc='claude --dangerously-skip-permissions'
|
||||
```
|
||||
|
||||
**Gemini CLI**
|
||||
```bash
|
||||
# --yolo 或 --approval-mode yolo
|
||||
alias g='gemini --yolo'
|
||||
```
|
||||
|
||||
### 🟡 Full-Auto 模式(推荐的自动化方式)
|
||||
|
||||
**Codex CLI**
|
||||
```bash
|
||||
# workspace-write 沙箱 + 失败时才审批
|
||||
codex --full-auto "Your prompt"
|
||||
```
|
||||
|
||||
**Gemini CLI**
|
||||
```bash
|
||||
# 自动批准编辑工具
|
||||
gemini --approval-mode auto_edit "Your prompt"
|
||||
```
|
||||
|
||||
### 🟢 安全模式(无头但有限制)
|
||||
|
||||
**Gemini CLI(禁用工具调用)**
|
||||
```bash
|
||||
cat input.md | gemini -p "prompt" --output-format text --allowed-tools '' > output.md
|
||||
```
|
||||
|
||||
**Claude Code(Print 模式)**
|
||||
```bash
|
||||
cat input.md | claude -p "prompt" --output-format text > output.md
|
||||
```
|
||||
|
||||
**Codex CLI(非交互执行)**
|
||||
```bash
|
||||
codex exec "prompt" --json -o result.txt
|
||||
```
|
||||
|
||||
### 📋 常用命令模板
|
||||
|
||||
**批量翻译**
|
||||
```bash
|
||||
# 设置代理(如需)
|
||||
export http_proxy=http://127.0.0.1:9910
|
||||
export https_proxy=http://127.0.0.1:9910
|
||||
|
||||
# Gemini 翻译
|
||||
cat zh.md | gemini -p "Translate to English. Keep code/links unchanged." \
|
||||
--output-format text --allowed-tools '' > en.md
|
||||
```
|
||||
|
||||
**代码审查**
|
||||
```bash
|
||||
cat code.py | claude --dangerously-skip-permissions -p \
|
||||
"Review this code for bugs and security issues. Output markdown." > review.md
|
||||
```
|
||||
|
||||
**多模型编排**
|
||||
```bash
|
||||
# 模型 A 生成 → 模型 B 审查
|
||||
cat spec.md | gemini -p "Generate code" --output-format text | \
|
||||
claude -p "Review and improve this code" --output-format text > result.md
|
||||
```
|
||||
|
||||
### ⚙️ 关键参数对照表
|
||||
|
||||
| 功能 | Gemini CLI | Claude Code | Codex CLI |
|
||||
|:---|:---|:---|:---|
|
||||
| YOLO 模式 | `--yolo` | `--dangerously-skip-permissions` | `--yolo` |
|
||||
| 指定模型 | `-m <model>` | `--model <model>` | `-m <model>` |
|
||||
| 非交互 | `-p "prompt"` | `-p "prompt"` | `exec "prompt"` |
|
||||
| 输出格式 | `--output-format text` | `--output-format text` | `--json` |
|
||||
| 禁用工具 | `--allowed-tools ''` | `--disallowedTools` | N/A |
|
||||
| 继续对话 | N/A | `-c` / `--continue` | `resume --last` |
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1: 批量翻译文档
|
||||
|
||||
**输入**: 中文 Markdown 文件
|
||||
**步骤**:
|
||||
```bash
|
||||
export http_proxy=http://127.0.0.1:9910
|
||||
export https_proxy=http://127.0.0.1:9910
|
||||
|
||||
for f in docs/*.md; do
|
||||
cat "$f" | timeout 120 gemini -p \
|
||||
"Translate to English. Keep code fences unchanged." \
|
||||
--output-format text --allowed-tools '' 2>/dev/null > "en_$(basename $f)"
|
||||
done
|
||||
```
|
||||
**预期输出**: 翻译后的英文文件
|
||||
|
||||
### Example 2: 代码审查流水线
|
||||
|
||||
**输入**: Python 代码文件
|
||||
**步骤**:
|
||||
```bash
|
||||
cat src/*.py | claude --dangerously-skip-permissions -p \
|
||||
"Review for: 1) Bugs 2) Security 3) Performance. Output markdown table." > review.md
|
||||
```
|
||||
**预期输出**: Markdown 格式的审查报告
|
||||
|
||||
### Example 3: 多模型对比验证
|
||||
|
||||
**输入**: 技术问题
|
||||
**步骤**:
|
||||
```bash
|
||||
question="How to implement rate limiting in Python?"
|
||||
|
||||
echo "$question" | gemini -p "$question" --output-format text > gemini_answer.md
|
||||
echo "$question" | claude -p "$question" --output-format text > claude_answer.md
|
||||
|
||||
# 对比两个答案
|
||||
diff gemini_answer.md claude_answer.md
|
||||
```
|
||||
**预期输出**: 两个模型答案的对比
|
||||
|
||||
## References
|
||||
|
||||
- `references/gemini-cli.md` - Gemini CLI 完整参数
|
||||
- `references/claude-cli.md` - Claude Code CLI 参数
|
||||
- `references/codex-cli.md` - Codex CLI 参数
|
||||
- [Gemini CLI 官方文档](https://geminicli.com/docs/)
|
||||
- [Claude Code 官方文档](https://docs.anthropic.com/en/docs/claude-code/)
|
||||
- [Codex CLI 官方文档](https://developers.openai.com/codex/cli/reference)
|
||||
|
||||
## Maintenance
|
||||
|
||||
- 来源: 各 CLI 官方文档
|
||||
- 更新: 2025-12-19
|
||||
- 限制: 需要网络连接和有效认证;YOLO 模式有安全风险
|
||||
@@ -0,0 +1,115 @@
|
||||
# Claude Code CLI 参数参考
|
||||
|
||||
> 来源: [官方文档](https://docs.anthropic.com/en/docs/claude-code/cli-reference)
|
||||
|
||||
## 安装
|
||||
|
||||
```bash
|
||||
npm install -g @anthropic-ai/claude-code
|
||||
```
|
||||
|
||||
## 认证
|
||||
|
||||
需要 Anthropic API Key 或 Claude Pro/Max 订阅:
|
||||
```bash
|
||||
export ANTHROPIC_API_KEY="YOUR_API_KEY"
|
||||
```
|
||||
|
||||
## 核心命令
|
||||
|
||||
| 命令 | 说明 | 示例 |
|
||||
|:---|:---|:---|
|
||||
| `claude` | 启动交互式 REPL | `claude` |
|
||||
| `claude "query"` | 带初始提示词启动 | `claude "explain this"` |
|
||||
| `claude -p "query"` | Print 模式,执行后退出 | `claude -p "review code"` |
|
||||
| `claude -c` | 继续最近的对话 | `claude -c` |
|
||||
| `claude -c -p "query"` | 继续对话(Print 模式) | `claude -c -p "run tests"` |
|
||||
| `claude -r "id" "query"` | 恢复指定会话 | `claude -r "abc123" "continue"` |
|
||||
| `claude update` | 更新到最新版本 | `claude update` |
|
||||
| `claude mcp` | 配置 MCP 服务器 | `claude mcp add server` |
|
||||
|
||||
## CLI 参数
|
||||
|
||||
| 参数 | 说明 | 示例 |
|
||||
|:---|:---|:---|
|
||||
| `--model` | 指定模型 | `--model claude-sonnet-4` |
|
||||
| `--output-format` | 输出格式: `text`/`json`/`stream-json` | `--output-format json` |
|
||||
| `--max-turns` | 限制对话轮数 | `--max-turns 3` |
|
||||
| `--dangerously-skip-permissions` | 跳过所有权限确认 (YOLO) | 见下方 |
|
||||
| `--allowedTools` | 允许的工具列表 | `--allowedTools "Write" "Bash(git *)"` |
|
||||
| `--disallowedTools` | 禁止的工具列表 | `--disallowedTools "Bash(rm *)"` |
|
||||
| `--add-dir` | 添加额外工作目录 | `--add-dir ./apps ./lib` |
|
||||
| `--verbose` | 启用详细日志 | `--verbose` |
|
||||
| `--continue` | 继续最近对话 | `--continue` |
|
||||
| `--resume` | 恢复指定会话 | `--resume abc123` |
|
||||
|
||||
## 可用模型
|
||||
|
||||
- `claude-sonnet-4` - 平衡模型 (默认)
|
||||
- `claude-opus-4` - 最强模型
|
||||
- `claude-opus-4.5` - 最新最强
|
||||
|
||||
## 无头模式用法
|
||||
|
||||
```bash
|
||||
# Print 模式(非交互,执行后退出)
|
||||
claude -p "review this code" --output-format text
|
||||
|
||||
# 管道输入
|
||||
cat input.txt | claude -p "explain these errors"
|
||||
|
||||
# YOLO 模式(跳过所有权限确认)
|
||||
claude --dangerously-skip-permissions "Your prompt"
|
||||
|
||||
# 别名设置
|
||||
alias cc='claude --dangerously-skip-permissions'
|
||||
|
||||
# 继续对话 + Print 模式(适合脚本)
|
||||
claude -c -p "show progress"
|
||||
```
|
||||
|
||||
## 交互式命令 (Slash Commands)
|
||||
|
||||
| 命令 | 说明 |
|
||||
|:---|:---|
|
||||
| `/help` | 显示所有命令 |
|
||||
| `/config` | 配置设置 |
|
||||
| `/allowed-tools` | 配置工具权限 |
|
||||
| `/mcp` | 管理 MCP 服务器 |
|
||||
| `/vim` | 启用 vim 编辑模式 |
|
||||
|
||||
## 配置文件
|
||||
|
||||
- 用户设置: `~/.claude/settings.json`
|
||||
- 项目设置: `.claude/settings.json`
|
||||
- 本地设置: `.claude/settings.local.json`
|
||||
|
||||
```json
|
||||
{
|
||||
"model": "claude-sonnet-4",
|
||||
"permissions": {
|
||||
"allowedTools": ["Read", "Write", "Bash(git *)"],
|
||||
"deny": ["Read(./.env)", "Bash(rm *)"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 上下文文件 (CLAUDE.md)
|
||||
|
||||
- 全局: `~/.claude/CLAUDE.md`
|
||||
- 项目: `./CLAUDE.md`
|
||||
- 子目录: 组件特定指令
|
||||
|
||||
## 深度思考触发词
|
||||
|
||||
强度递增:
|
||||
- `think` - 基础思考
|
||||
- `think hard` - 深入思考
|
||||
- `think harder` - 更深入
|
||||
- `ultrathink` - 最深度思考
|
||||
|
||||
## 常见问题
|
||||
|
||||
1. **权限弹窗**: 使用 `--dangerously-skip-permissions`
|
||||
2. **上下文过长**: 使用 `/compact` 或 `/clear`
|
||||
3. **回退更改**: 使用 `/rewind`
|
||||
@@ -0,0 +1,123 @@
|
||||
# Codex CLI 参数参考
|
||||
|
||||
> 来源: [官方文档](https://developers.openai.com/codex/cli/reference)
|
||||
|
||||
## 安装
|
||||
|
||||
```bash
|
||||
npm install -g @openai/codex
|
||||
```
|
||||
|
||||
## 认证
|
||||
|
||||
```bash
|
||||
# 方式 1: 浏览器 OAuth (ChatGPT 账号)
|
||||
codex login
|
||||
|
||||
# 方式 2: API Key
|
||||
printenv OPENAI_API_KEY | codex login --with-api-key
|
||||
|
||||
# 检查登录状态
|
||||
codex login status
|
||||
```
|
||||
|
||||
## 核心命令
|
||||
|
||||
| 命令 | 说明 | 示例 |
|
||||
|:---|:---|:---|
|
||||
| `codex` | 启动交互式 TUI | `codex` |
|
||||
| `codex "prompt"` | 带提示词启动 | `codex "explain this"` |
|
||||
| `codex exec` / `codex e` | 非交互模式 | `codex exec "fix bugs"` |
|
||||
| `codex resume` | 恢复会话 | `codex resume --last` |
|
||||
| `codex apply` / `codex a` | 应用 Cloud 任务的 diff | `codex apply TASK_ID` |
|
||||
| `codex mcp` | 管理 MCP 服务器 | `codex mcp add server` |
|
||||
| `codex completion` | 生成 shell 补全 | `codex completion zsh` |
|
||||
|
||||
## 全局参数
|
||||
|
||||
| 参数 | 说明 | 示例 |
|
||||
|:---|:---|:---|
|
||||
| `--model, -m` | 指定模型 | `-m gpt-5-codex` |
|
||||
| `--sandbox, -s` | 沙箱策略: `read-only`/`workspace-write`/`danger-full-access` | `-s workspace-write` |
|
||||
| `--ask-for-approval, -a` | 审批模式: `untrusted`/`on-failure`/`on-request`/`never` | `-a on-failure` |
|
||||
| `--full-auto` | 自动化预设 (workspace-write + on-failure) | `--full-auto` |
|
||||
| `--dangerously-bypass-approvals-and-sandbox` / `--yolo` | 跳过所有审批和沙箱 | `--yolo` |
|
||||
| `--search` | 启用网页搜索 | `--search` |
|
||||
| `--add-dir` | 添加额外写入目录 | `--add-dir ./other` |
|
||||
| `--enable` | 启用功能标志 | `--enable web_search_request` |
|
||||
| `--disable` | 禁用功能标志 | `--disable feature_name` |
|
||||
| `--config, -c` | 配置覆盖 | `-c model_reasoning_effort="high"` |
|
||||
| `--image, -i` | 附加图片 | `-i image.png` |
|
||||
| `--cd, -C` | 设置工作目录 | `-C /path/to/project` |
|
||||
| `--profile, -p` | 配置文件 profile | `-p my-profile` |
|
||||
| `--oss` | 使用本地开源模型 (Ollama) | `--oss` |
|
||||
|
||||
## codex exec 专用参数
|
||||
|
||||
| 参数 | 说明 | 示例 |
|
||||
|:---|:---|:---|
|
||||
| `--json` | 输出 JSONL 格式 | `--json` |
|
||||
| `--output-last-message, -o` | 保存最终消息到文件 | `-o result.txt` |
|
||||
| `--output-schema` | JSON Schema 验证输出 | `--output-schema schema.json` |
|
||||
| `--color` | 颜色输出: `always`/`never`/`auto` | `--color never` |
|
||||
| `--skip-git-repo-check` | 允许在非 Git 目录运行 | `--skip-git-repo-check` |
|
||||
|
||||
## 可用模型
|
||||
|
||||
- `gpt-5-codex` - 标准模型
|
||||
- `gpt-5.3-codex` - 增强版
|
||||
- `gpt-5.3-codex-max` - 最强模型
|
||||
|
||||
## 推理强度配置
|
||||
|
||||
```bash
|
||||
-c model_reasoning_effort="low" # 快速
|
||||
-c model_reasoning_effort="medium" # 平衡
|
||||
-c model_reasoning_effort="high" # 深度
|
||||
```
|
||||
|
||||
## 无头模式用法
|
||||
|
||||
```bash
|
||||
# 非交互执行
|
||||
codex exec "fix all linting errors"
|
||||
|
||||
# 管道输入
|
||||
echo "explain this error" | codex exec -
|
||||
|
||||
# YOLO 模式(跳过所有确认和沙箱)
|
||||
codex --yolo "Your prompt"
|
||||
|
||||
# 或完整写法
|
||||
codex --dangerously-bypass-approvals-and-sandbox "Your prompt"
|
||||
|
||||
# full-auto 模式(推荐的自动化方式)
|
||||
codex --full-auto "Your prompt"
|
||||
|
||||
# 完整 YOLO 配置别名
|
||||
alias c='codex --enable web_search_request -m gpt-5.3-codex-max -c model_reasoning_effort="high" --yolo'
|
||||
|
||||
# 恢复最近会话
|
||||
codex resume --last
|
||||
codex exec resume --last "continue"
|
||||
```
|
||||
|
||||
## 配置文件
|
||||
|
||||
配置存储在 `~/.codex/config.toml`:
|
||||
|
||||
```toml
|
||||
model = "gpt-5-codex"
|
||||
sandbox = "workspace-write"
|
||||
ask_for_approval = "on-failure"
|
||||
|
||||
[features]
|
||||
web_search_request = true
|
||||
```
|
||||
|
||||
## 常见问题
|
||||
|
||||
1. **审批弹窗**: 使用 `--yolo` 或 `--full-auto`
|
||||
2. **需要联网**: 使用 `--search` 或 `--enable web_search_request`
|
||||
3. **推理不够深**: 使用 `-c model_reasoning_effort="high"`
|
||||
4. **非 Git 目录**: 使用 `--skip-git-repo-check`
|
||||
@@ -0,0 +1,81 @@
|
||||
# Gemini CLI 参数参考
|
||||
|
||||
> 来源: [官方文档](https://geminicli.com/docs/get-started/configuration/)
|
||||
|
||||
## 安装
|
||||
|
||||
```bash
|
||||
npm install -g @anthropic-ai/gemini-cli
|
||||
```
|
||||
|
||||
## 认证
|
||||
|
||||
首次运行会引导 Google 账号登录,或设置环境变量:
|
||||
```bash
|
||||
export GEMINI_API_KEY="YOUR_API_KEY"
|
||||
```
|
||||
|
||||
## 核心命令行参数
|
||||
|
||||
| 参数 | 说明 | 示例 |
|
||||
|:---|:---|:---|
|
||||
| `--model <model>` | 指定模型 | `--model gemini-2.5-flash` |
|
||||
| `--yolo` | YOLO 模式,自动批准所有工具调用 | `gemini --yolo` |
|
||||
| `--approval-mode <mode>` | 审批模式: `default`/`auto_edit`/`yolo` | `--approval-mode auto_edit` |
|
||||
| `--allowed-tools <tools>` | 允许的工具列表(逗号分隔) | `--allowed-tools ''` (禁用所有) |
|
||||
| `--output-format <format>` | 输出格式: `text`/`json`/`stream-json` | `--output-format text` |
|
||||
| `--sandbox` / `-s` | 启用沙箱模式 | `gemini -s` |
|
||||
| `--prompt <prompt>` / `-p` | 非交互模式,直接传入提示词 | `gemini -p "query"` |
|
||||
| `--prompt-interactive <prompt>` / `-i` | 交互模式,带初始提示词 | `gemini -i "explain"` |
|
||||
| `--debug` / `-d` | 启用调试模式 | `gemini -d` |
|
||||
|
||||
## 可用模型
|
||||
|
||||
- `gemini-2.5-flash` - 快速模型
|
||||
- `gemini-2.5-pro` - 高级模型
|
||||
- `gemini-3-flash-preview` - 最新 Flash
|
||||
- `gemini-3-pro-preview` - 最新 Pro
|
||||
|
||||
## 无头模式用法
|
||||
|
||||
```bash
|
||||
# 基础无头调用(管道输入)
|
||||
cat input.txt | gemini -p "Your prompt" --output-format text
|
||||
|
||||
# 禁用工具调用(纯文本输出)
|
||||
cat input.txt | gemini -p "Your prompt" --output-format text --allowed-tools ''
|
||||
|
||||
# YOLO 模式(跳过所有确认)
|
||||
gemini --yolo "Your prompt"
|
||||
|
||||
# 或使用 approval-mode
|
||||
gemini --approval-mode yolo "Your prompt"
|
||||
```
|
||||
|
||||
## 配置文件
|
||||
|
||||
配置存储在 `~/.gemini/settings.json` 或项目 `.gemini/settings.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"security": {
|
||||
"disableYoloMode": false
|
||||
},
|
||||
"model": {
|
||||
"name": "gemini-2.5-flash"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 代理配置
|
||||
|
||||
```bash
|
||||
export http_proxy=http://127.0.0.1:9910
|
||||
export https_proxy=http://127.0.0.1:9910
|
||||
```
|
||||
|
||||
## 常见问题
|
||||
|
||||
1. **MCP 初始化慢**: 使用 `--allowed-tools ''` 跳过
|
||||
2. **超时**: 使用 `timeout` 命令包装
|
||||
3. **输出包含日志**: 重定向 stderr `2>/dev/null`
|
||||
@@ -0,0 +1,15 @@
|
||||
# Headless CLI References
|
||||
|
||||
> ⚠️ CLI 参数可能随版本更新变化,请以官方文档为准
|
||||
|
||||
## 目录
|
||||
|
||||
- [gemini-cli.md](./gemini-cli.md) - Gemini CLI 参数
|
||||
- [claude-cli.md](./claude-cli.md) - Claude Code CLI 参数
|
||||
- [codex-cli.md](./codex-cli.md) - Codex CLI 参数
|
||||
|
||||
## 官方文档
|
||||
|
||||
- [Gemini CLI](https://github.com/google-gemini/gemini-cli)
|
||||
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code)
|
||||
- [Codex CLI](https://github.com/openai/codex)
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
# Postgresql Documentation Index
|
||||
|
||||
## Categories
|
||||
|
||||
### Getting Started
|
||||
**File:** `getting_started.md`
|
||||
**Pages:** 36
|
||||
|
||||
### Sql
|
||||
**File:** `sql.md`
|
||||
**Pages:** 460
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,108 @@
|
||||
---
|
||||
name: timescaledb
|
||||
description: TimescaleDB - PostgreSQL extension for high-performance time-series and event data analytics, hypertables, continuous aggregates, compression, and real-time analytics
|
||||
---
|
||||
|
||||
# Timescaledb Skill
|
||||
|
||||
Comprehensive assistance with timescaledb development, generated from official documentation.
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
This skill should be triggered when:
|
||||
- Working with timescaledb
|
||||
- Asking about timescaledb features or APIs
|
||||
- Implementing timescaledb solutions
|
||||
- Debugging timescaledb code
|
||||
- Learning timescaledb best practices
|
||||
|
||||
## Quick Reference
|
||||
|
||||
### Common Patterns
|
||||
|
||||
*Quick reference patterns will be added as you use the skill.*
|
||||
|
||||
### Example Code Patterns
|
||||
|
||||
**Example 1** (bash):
|
||||
```bash
|
||||
rails new my_app -d=postgresql
|
||||
cd my_app
|
||||
```
|
||||
|
||||
**Example 2** (ruby):
|
||||
```ruby
|
||||
gem 'timescaledb'
|
||||
```
|
||||
|
||||
**Example 3** (shell):
|
||||
```shell
|
||||
kubectl create namespace timescale
|
||||
```
|
||||
|
||||
**Example 4** (shell):
|
||||
```shell
|
||||
kubectl config set-context --current --namespace=timescale
|
||||
```
|
||||
|
||||
**Example 5** (sql):
|
||||
```sql
|
||||
DROP EXTENSION timescaledb;
|
||||
```
|
||||
|
||||
## Reference Files
|
||||
|
||||
This skill includes comprehensive documentation in `references/`:
|
||||
|
||||
- **api.md** - Api documentation
|
||||
- **compression.md** - Compression documentation
|
||||
- **continuous_aggregates.md** - Continuous Aggregates documentation
|
||||
- **getting_started.md** - Getting Started documentation
|
||||
- **hyperfunctions.md** - Hyperfunctions documentation
|
||||
- **hypertables.md** - Hypertables documentation
|
||||
- **installation.md** - Installation documentation
|
||||
- **other.md** - Other documentation
|
||||
- **performance.md** - Performance documentation
|
||||
- **time_buckets.md** - Time Buckets documentation
|
||||
- **tutorials.md** - Tutorials documentation
|
||||
|
||||
Use `view` to read specific reference files when detailed information is needed.
|
||||
|
||||
## Working with This Skill
|
||||
|
||||
### For Beginners
|
||||
Start with the getting_started or tutorials reference files for foundational concepts.
|
||||
|
||||
### For Specific Features
|
||||
Use the appropriate category reference file (api, guides, etc.) for detailed information.
|
||||
|
||||
### For Code Examples
|
||||
The quick reference section above contains common patterns extracted from the official docs.
|
||||
|
||||
## Resources
|
||||
|
||||
### references/
|
||||
Organized documentation extracted from official sources. These files contain:
|
||||
- Detailed explanations
|
||||
- Code examples with language annotations
|
||||
- Links to original documentation
|
||||
- Table of contents for quick navigation
|
||||
|
||||
### scripts/
|
||||
Add helper scripts here for common automation tasks.
|
||||
|
||||
### assets/
|
||||
Add templates, boilerplate, or example projects here.
|
||||
|
||||
## Notes
|
||||
|
||||
- This skill was automatically generated from official documentation
|
||||
- Reference files preserve the structure and examples from source docs
|
||||
- Code examples include language detection for better syntax highlighting
|
||||
- Quick reference patterns are extracted from common usage examples in the docs
|
||||
|
||||
## Updating
|
||||
|
||||
To refresh this skill with updated documentation:
|
||||
1. Re-run the scraper with the same configuration
|
||||
2. The skill will be rebuilt with the latest information
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,47 @@
|
||||
# Timescaledb Documentation Index
|
||||
|
||||
## Categories
|
||||
|
||||
### Api
|
||||
**File:** `api.md`
|
||||
**Pages:** 100
|
||||
|
||||
### Compression
|
||||
**File:** `compression.md`
|
||||
**Pages:** 19
|
||||
|
||||
### Continuous Aggregates
|
||||
**File:** `continuous_aggregates.md`
|
||||
**Pages:** 21
|
||||
|
||||
### Getting Started
|
||||
**File:** `getting_started.md`
|
||||
**Pages:** 3
|
||||
|
||||
### Hyperfunctions
|
||||
**File:** `hyperfunctions.md`
|
||||
**Pages:** 34
|
||||
|
||||
### Hypertables
|
||||
**File:** `hypertables.md`
|
||||
**Pages:** 103
|
||||
|
||||
### Installation
|
||||
**File:** `installation.md`
|
||||
**Pages:** 37
|
||||
|
||||
### Other
|
||||
**File:** `other.md`
|
||||
**Pages:** 248
|
||||
|
||||
### Performance
|
||||
**File:** `performance.md`
|
||||
**Pages:** 2
|
||||
|
||||
### Time Buckets
|
||||
**File:** `time_buckets.md`
|
||||
**Pages:** 16
|
||||
|
||||
### Tutorials
|
||||
**File:** `tutorials.md`
|
||||
**Pages:** 12
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,381 @@
|
||||
# Tiger DataDocumentation
|
||||
|
||||
Over 3 million Tiger Datadatabases power customer-facing applications. Speed without sacrifice for real-time analytics, time series, and vector workloads. Creators of TimescaleDB.
|
||||
|
||||
Tiger Cloud is the modern Postgres data platform for all your applications. It enhances Postgres to handle time series, events, real-time analytics, and vector search—all in a single database alongside transactional workloads.
|
||||
|
||||
You get one system that handles live data ingestion, late and out-of-order updates, and low latency queries, with the performance, reliability, and scalability your app needs. Ideal for IoT, crypto, finance, SaaS, and a myriad other domains, Tiger Cloud allows you to build data-heavy, mission-critical apps while retaining the familiarity and reliability of PostgreSQL.
|
||||
|
||||
This repository contains the complete documentation for Tiger Dataproducts available at https://docs.tigerdata.com/.
|
||||
|
||||
## Getting Started
|
||||
|
||||
- [Get started overview](https://docs.tigerdata.com/getting-started/latest/): Introduction to Tiger Dataproducts and services
|
||||
- [Create a Tiger Cloud service](https://docs.tigerdata.com/getting-started/latest/services/): Learn about Tiger Cloud capabilities and create your first service
|
||||
- [Run queries from Tiger Cloud Console](https://docs.tigerdata.com/getting-started/latest/run-queries-from-console/): Use the SQL editor and SQL Assistant in Tiger Cloud
|
||||
- [Try key Tiger Datafeatures](https://docs.tigerdata.com/getting-started/latest/try-key-features-timescale-products/): Explore hypertables, time buckets, compression, and continuous aggregates
|
||||
- [Start coding with TigerData](https://docs.tigerdata.com/getting-started/latest/start-coding-with-timescale/): Connect and code with your preferred programming language
|
||||
|
||||
## Core Features and Functionality
|
||||
|
||||
### Hypertables
|
||||
- [About hypertables](https://docs.tigerdata.com/use-timescale/latest/hypertables/about-hypertables/): Core concept for time-series optimization
|
||||
- [Create and manage hypertables](https://docs.tigerdata.com/use-timescale/latest/hypertables/hypertable-crud/): CRUD operations on hypertables
|
||||
- [Improve query performance](https://docs.tigerdata.com/use-timescale/latest/hypertables/improve-query-performance/): Performance optimization techniques
|
||||
- [Unique indexes on hypertables](https://docs.tigerdata.com/use-timescale/latest/hypertables/hypertables-and-unique-indexes/): Handling unique constraints
|
||||
|
||||
### Hypercore (Columnar Storage)
|
||||
- [Hypercore overview](https://docs.tigerdata.com/use-timescale/latest/hypercore/): Advanced columnar storage for real-time analytics
|
||||
- [Real-time analytics in Hypercore](https://docs.tigerdata.com/use-timescale/latest/hypercore/real-time-analytics-in-hypercore/): High-performance analytics capabilities
|
||||
- [Compression methods](https://docs.tigerdata.com/use-timescale/latest/hypercore/compression-methods/): Advanced compression techniques
|
||||
- [Secondary indexes](https://docs.tigerdata.com/use-timescale/latest/hypercore/secondary-indexes/): Indexing strategies for columnar data
|
||||
- [Modify data in Hypercore](https://docs.tigerdata.com/use-timescale/latest/hypercore/modify-data-in-hypercore/): Data modification operations
|
||||
|
||||
### Continuous Aggregates
|
||||
- [About continuous aggregates](https://docs.tigerdata.com/use-timescale/latest/continuous-aggregates/about-continuous-aggregates/): Materialized views for time-series data
|
||||
- [Create continuous aggregates](https://docs.tigerdata.com/use-timescale/latest/continuous-aggregates/create-a-continuous-aggregate/): Implementation guide
|
||||
- [Real-time aggregates](https://docs.tigerdata.com/use-timescale/latest/continuous-aggregates/real-time-aggregates/): Real-time query capabilities
|
||||
- [Hierarchical continuous aggregates](https://docs.tigerdata.com/use-timescale/latest/continuous-aggregates/hierarchical-continuous-aggregates/): Multi-level aggregation
|
||||
- [Refresh policies](https://docs.tigerdata.com/use-timescale/latest/continuous-aggregates/refresh-policies/): Automated refresh management
|
||||
- [Compression on continuous aggregates](https://docs.tigerdata.com/use-timescale/latest/continuous-aggregates/compression-on-continuous-aggregates/): Storage optimization
|
||||
|
||||
### Hyperfunctions
|
||||
- [About hyperfunctions](https://docs.tigerdata.com/use-timescale/latest/hyperfunctions/about-hyperfunctions/): Advanced analytical functions
|
||||
- [Function pipelines](https://docs.tigerdata.com/use-timescale/latest/hyperfunctions/function-pipelines/): Chaining analytical operations
|
||||
- [Statistical aggregates](https://docs.tigerdata.com/use-timescale/latest/hyperfunctions/stats-aggs/): Statistical analysis functions
|
||||
- [Time-weighted averages](https://docs.tigerdata.com/use-timescale/latest/hyperfunctions/time-weighted-averages/): Time-series averaging
|
||||
- [Gapfilling and interpolation](https://docs.tigerdata.com/use-timescale/latest/hyperfunctions/gapfilling-interpolation/): Handle missing data
|
||||
- [Counter aggregation](https://docs.tigerdata.com/use-timescale/latest/hyperfunctions/counter-aggregation/): Monitor counter metrics
|
||||
- [Approximate count distincts](https://docs.tigerdata.com/use-timescale/latest/hyperfunctions/approx-count-distincts/): Efficient distinct counting
|
||||
- [Percentile approximation](https://docs.tigerdata.com/use-timescale/latest/hyperfunctions/percentile-approx/): Statistical percentile calculations
|
||||
|
||||
## Data Operations
|
||||
|
||||
### Writing Data
|
||||
- [About writing data](https://docs.tigerdata.com/use-timescale/latest/write-data/about-writing-data/): Overview of data ingestion
|
||||
- [Insert data](https://docs.tigerdata.com/use-timescale/latest/write-data/insert/): Insert operations and best practices
|
||||
- [Update data](https://docs.tigerdata.com/use-timescale/latest/write-data/update/): Update existing records
|
||||
- [Upsert data](https://docs.tigerdata.com/use-timescale/latest/write-data/upsert/): Insert or update patterns
|
||||
- [Delete data](https://docs.tigerdata.com/use-timescale/latest/write-data/delete/): Data deletion strategies
|
||||
|
||||
### Querying Data
|
||||
- [About querying data](https://docs.tigerdata.com/use-timescale/latest/query-data/about-query-data/): Query fundamentals
|
||||
- [SELECT queries](https://docs.tigerdata.com/use-timescale/latest/query-data/select/): Basic and advanced SELECT operations
|
||||
- [Advanced analytic queries](https://docs.tigerdata.com/use-timescale/latest/query-data/advanced-analytic-queries/): Complex analytical queries
|
||||
- [SkipScan for DISTINCT](https://docs.tigerdata.com/use-timescale/latest/query-data/skipscan/): Optimized DISTINCT operations
|
||||
|
||||
### Time Buckets
|
||||
- [About time buckets](https://docs.tigerdata.com/use-timescale/latest/time-buckets/about-time-buckets/): Time-based data grouping
|
||||
- [Use time buckets](https://docs.tigerdata.com/use-timescale/latest/time-buckets/use-time-buckets/): Implementation examples
|
||||
|
||||
### Data Ingestion
|
||||
- [Import CSV data](https://docs.tigerdata.com/use-timescale/latest/ingest-data/import-csv/): CSV data import
|
||||
- [Import from MySQL](https://docs.tigerdata.com/use-timescale/latest/ingest-data/import-mysql/): MySQL migration
|
||||
- [Import Parquet files](https://docs.tigerdata.com/use-timescale/latest/ingest-data/import-parquet/): Parquet data ingestion
|
||||
- [Ingest from Kafka](https://docs.tigerdata.com/use-timescale/latest/ingest-data/ingest-kafka/): Apache Kafka integration
|
||||
- [Ingest with Telegraf](https://docs.tigerdata.com/use-timescale/latest/ingest-data/ingest-telegraf/): Telegraf data collection
|
||||
|
||||
## Data Management
|
||||
|
||||
### Compression
|
||||
- [About compression](https://docs.tigerdata.com/use-timescale/latest/compression/about-compression/): Storage optimization overview
|
||||
- [Compression design](https://docs.tigerdata.com/use-timescale/latest/compression/compression-design/): Design considerations
|
||||
- [Manual compression](https://docs.tigerdata.com/use-timescale/latest/compression/manual-compression/): Manual compression operations
|
||||
- [Compression policies](https://docs.tigerdata.com/use-timescale/latest/compression/compression-policy/): Automated compression
|
||||
- [Modify compressed data](https://docs.tigerdata.com/use-timescale/latest/compression/modify-compressed-data/): Working with compressed data
|
||||
- [Modify schemas](https://docs.tigerdata.com/use-timescale/latest/compression/modify-a-schema/): Schema changes on compressed tables
|
||||
|
||||
### Data Retention
|
||||
- [About data retention](https://docs.tigerdata.com/use-timescale/latest/data-retention/about-data-retention/): Automated data lifecycle management
|
||||
- [Create retention policies](https://docs.tigerdata.com/use-timescale/latest/data-retention/create-a-retention-policy/): Policy creation and management
|
||||
- [Data retention with continuous aggregates](https://docs.tigerdata.com/use-timescale/latest/data-retention/data-retention-with-continuous-aggregates/): Retention for aggregated data
|
||||
- [Manually drop chunks](https://docs.tigerdata.com/use-timescale/latest/data-retention/manually-drop-chunks/): Manual data removal
|
||||
|
||||
### Data Tiering
|
||||
- [About data tiering](https://docs.tigerdata.com/use-timescale/latest/data-tiering/about-data-tiering/): Multi-tier storage strategy
|
||||
- [Enable data tiering](https://docs.tigerdata.com/use-timescale/latest/data-tiering/enabling-data-tiering/): Setup and configuration
|
||||
- [Query tiered data](https://docs.tigerdata.com/use-timescale/latest/data-tiering/querying-tiered-data/): Working with tiered storage
|
||||
- [Tiered data with replicas and forks](https://docs.tigerdata.com/use-timescale/latest/data-tiering/tiered-data-replicas-forks/): Advanced tiering scenarios
|
||||
|
||||
### Jobs and Automation
|
||||
- [Create and manage jobs](https://docs.tigerdata.com/use-timescale/latest/jobs/create-and-manage-jobs/): Background job management
|
||||
- [Downsample and compress example](https://docs.tigerdata.com/use-timescale/latest/jobs/example-downsample-and-compress/): Automated data processing
|
||||
- [Generic retention example](https://docs.tigerdata.com/use-timescale/latest/jobs/example-generic-retention/): Custom retention policies
|
||||
- [Tiered storage example](https://docs.tigerdata.com/use-timescale/latest/jobs/example-tiered-storage/): Automated tiering
|
||||
|
||||
## Infrastructure and Operations
|
||||
|
||||
### Tiger Cloud Services
|
||||
- [Service overview](https://docs.tigerdata.com/use-timescale/latest/services/service-overview/): Tiger Cloud service architecture
|
||||
- [Service management](https://docs.tigerdata.com/use-timescale/latest/services/service-management/): Lifecycle management
|
||||
- [Service explorer](https://docs.tigerdata.com/use-timescale/latest/services/service-explorer/): Service monitoring and insights
|
||||
- [Change resources](https://docs.tigerdata.com/use-timescale/latest/services/change-resources/): Scale compute and storage
|
||||
- [Connection pooling](https://docs.tigerdata.com/use-timescale/latest/services/connection-pooling/): Manage database connections
|
||||
|
||||
### Configuration
|
||||
- [About configuration](https://docs.tigerdata.com/use-timescale/latest/configuration/about-configuration/): Configuration overview
|
||||
- [Customize configuration](https://docs.tigerdata.com/use-timescale/latest/configuration/customize-configuration/): Custom settings
|
||||
- [Advanced parameters](https://docs.tigerdata.com/use-timescale/latest/configuration/advanced-parameters/): Advanced tuning options
|
||||
|
||||
### High Availability
|
||||
- [High availability overview](https://docs.tigerdata.com/use-timescale/latest/ha-replicas/high-availability/): HA architecture and setup
|
||||
- [Read scaling](https://docs.tigerdata.com/use-timescale/latest/ha-replicas/read-scaling/): Read replica configuration
|
||||
|
||||
### Backup and Restore
|
||||
- [Backup and restore overview](https://docs.tigerdata.com/use-timescale/latest/backup-restore/backup-restore-cloud/): Cloud backup strategies
|
||||
- [Point-in-time recovery](https://docs.tigerdata.com/use-timescale/latest/backup-restore/point-in-time-recovery/): PITR capabilities
|
||||
|
||||
### Security
|
||||
- [Security overview](https://docs.tigerdata.com/use-timescale/latest/security/overview/): Security architecture
|
||||
- [Member management](https://docs.tigerdata.com/use-timescale/latest/security/members/): User and role management
|
||||
- [Multi-factor authentication](https://docs.tigerdata.com/use-timescale/latest/security/multi-factor-authentication/): MFA setup
|
||||
- [SAML authentication](https://docs.tigerdata.com/use-timescale/latest/security/saml/): SSO integration
|
||||
- [Client credentials](https://docs.tigerdata.com/use-timescale/latest/security/client-credentials/): Application authentication
|
||||
- [Read-only role](https://docs.tigerdata.com/use-timescale/latest/security/read-only-role/): Restricted access roles
|
||||
- [Strict SSL](https://docs.tigerdata.com/use-timescale/latest/security/strict-ssl/): SSL configuration
|
||||
- [VPC peering](https://docs.tigerdata.com/use-timescale/latest/security/vpc/): Private network connectivity
|
||||
- [Transit Gateway](https://docs.tigerdata.com/use-timescale/latest/security/transit-gateway/): Multi-cloud connectivity
|
||||
- [IP allow list](https://docs.tigerdata.com/use-timescale/latest/security/ip-allow-list/): Network access control
|
||||
|
||||
### Schema Management
|
||||
- [About schemas](https://docs.tigerdata.com/use-timescale/latest/schema-management/about-schemas/): Schema design principles
|
||||
- [About indexing](https://docs.tigerdata.com/use-timescale/latest/schema-management/about-indexing/): Index strategies
|
||||
- [About constraints](https://docs.tigerdata.com/use-timescale/latest/schema-management/about-constraints/): Constraint management
|
||||
- [About tablespaces](https://docs.tigerdata.com/use-timescale/latest/schema-management/about-tablespaces/): Storage management
|
||||
- [Alter operations](https://docs.tigerdata.com/use-timescale/latest/schema-management/alter/): Schema modifications
|
||||
- [Indexing](https://docs.tigerdata.com/use-timescale/latest/schema-management/indexing/): Index creation and management
|
||||
- [JSON support](https://docs.tigerdata.com/use-timescale/latest/schema-management/json/): Working with JSON data
|
||||
- [Triggers](https://docs.tigerdata.com/use-timescale/latest/schema-management/triggers/): Database triggers
|
||||
- [Foreign data wrappers](https://docs.tigerdata.com/use-timescale/latest/schema-management/foreign-data-wrappers/): External data integration
|
||||
|
||||
### Extensions
|
||||
- [pgvector](https://docs.tigerdata.com/use-timescale/latest/extensions/pgvector/): Vector similarity search
|
||||
- [PostGIS](https://docs.tigerdata.com/use-timescale/latest/extensions/postgis/): Geospatial data support
|
||||
- [pgcrypto](https://docs.tigerdata.com/use-timescale/latest/extensions/pgcrypto/): Cryptographic functions
|
||||
|
||||
### Monitoring and Metrics
|
||||
- [Monitoring overview](https://docs.tigerdata.com/use-timescale/latest/metrics-logging/monitoring/): System monitoring
|
||||
- [AWS CloudWatch](https://docs.tigerdata.com/use-timescale/latest/metrics-logging/aws-cloudwatch/): CloudWatch integration
|
||||
- [Datadog](https://docs.tigerdata.com/use-timescale/latest/metrics-logging/datadog/): Datadog monitoring
|
||||
- [Prometheus metrics](https://docs.tigerdata.com/use-timescale/latest/metrics-logging/metrics-to-prometheus/): Prometheus integration
|
||||
|
||||
## Integrate AI with Tiger Data
|
||||
|
||||
- [AI overview](https://docs.tigerdata.com/ai/latest/): Integrate AI with your Tiger Data products
|
||||
- [Integrate Tiger Cloud with your AI Assistant](https://docs.tigerdata.com/ai/latest/mcp-server/): Manage your services and optimize your schema and queries with your AI Assistant
|
||||
- [Aggregate organizational data with AI agents](https://docs.tigerdata.com/ai/latest/tiger-eon/): Unify company knowledge with slack-native AI agents
|
||||
- [Integrate a slack-native AI agent](https://docs.tigerdata.com/ai/latest/tiger-agents-for-work/): Configure a Slack-native AI agent to do what you want
|
||||
- [Key vector database concepts](https://docs.tigerdata.com/ai/latest/key-vector-database-concepts-for-understanding-pgvector/): Key concepts for working with pgvector data in Postgres
|
||||
- [SQL interface for pgvector](https://docs.tigerdata.com/ai/latest/sql-interface-for-pgvector-and-timescale-vector/): SQL interface for pgai, pgvector and pgvectorscale in Postgres
|
||||
|
||||
## Tutorials and Examples
|
||||
|
||||
- [Tutorials overview](https://docs.tigerdata.com/tutorials/latest/): Hands-on tutorials and examples
|
||||
- [Community cookbook](https://docs.tigerdata.com/tutorials/latest/cookbook/): Code examples and recipes
|
||||
- [Real-time analytics for energy consumption](https://docs.tigerdata.com/tutorials/latest/real-time-analytics-energy-consumption/): Energy data analysis
|
||||
- [Real-time analytics for transport](https://docs.tigerdata.com/tutorials/latest/real-time-analytics-transport/): Transportation data analysis
|
||||
- [Simulate IoT sensor data](https://docs.tigerdata.com/tutorials/latest/simulate-iot-sensor-data/): IoT data simulation
|
||||
- [Ingest real-time websocket data](https://docs.tigerdata.com/tutorials/latest/ingest-real-time-websocket-data/): WebSocket data streaming
|
||||
|
||||
### Dataset Tutorials
|
||||
- [Bitcoin blockchain analysis](https://docs.tigerdata.com/tutorials/latest/blockchain-analyze/): Analyze blockchain transactions with Hypercore
|
||||
- [Financial tick data analysis](https://docs.tigerdata.com/tutorials/latest/financial-tick-data/): High-frequency financial data
|
||||
- [Financial real-time ingestion](https://docs.tigerdata.com/tutorials/latest/financial-ingest-real-time/): Real-time financial data streaming
|
||||
- [NYC taxi data analysis](https://docs.tigerdata.com/tutorials/latest/nyc-taxi-cab/): Time-series analysis with NYC taxi data
|
||||
- [NYC taxi geospatial analysis](https://docs.tigerdata.com/tutorials/latest/nyc-taxi-geospatial/): Geospatial data visualization
|
||||
- [Energy consumption analysis](https://docs.tigerdata.com/tutorials/latest/energy-data/): Energy usage patterns and optimization
|
||||
|
||||
## Integrations
|
||||
|
||||
### Cloud Platforms
|
||||
- [AWS integrations](https://docs.tigerdata.com/integrations/latest/aws/): Amazon Web Services integration
|
||||
- [AWS Lambda](https://docs.tigerdata.com/integrations/latest/aws-lambda/): Serverless functions
|
||||
- [Amazon SageMaker](https://docs.tigerdata.com/integrations/latest/amazon-sagemaker/): Machine learning platform
|
||||
- [Google Cloud](https://docs.tigerdata.com/integrations/latest/google-cloud/): Google Cloud Platform integration
|
||||
- [Microsoft Azure](https://docs.tigerdata.com/integrations/latest/microsoft-azure/): Microsoft Azure integration
|
||||
|
||||
### Data Integration
|
||||
- [Apache Kafka](https://docs.tigerdata.com/integrations/latest/apache-kafka/): Kafka streaming integration
|
||||
- [Apache Airflow](https://docs.tigerdata.com/integrations/latest/apache-airflow/): Workflow orchestration
|
||||
- [Debezium](https://docs.tigerdata.com/integrations/latest/debezium/): Change data capture
|
||||
- [Decodable](https://docs.tigerdata.com/integrations/latest/decodable/): Real-time stream processing
|
||||
- [Fivetran](https://docs.tigerdata.com/integrations/latest/fivetran/): Data pipeline automation
|
||||
- [PostgreSQL](https://docs.tigerdata.com/integrations/latest/postgresql/): PostgreSQL compatibility
|
||||
|
||||
### Visualization and Analytics
|
||||
- [Grafana](https://docs.tigerdata.com/integrations/latest/grafana/): Monitoring and visualization
|
||||
- [Tableau](https://docs.tigerdata.com/integrations/latest/tableau/): Business intelligence
|
||||
- [Power BI](https://docs.tigerdata.com/integrations/latest/power-bi/): Microsoft business analytics
|
||||
|
||||
### Development Tools
|
||||
- [psql](https://docs.tigerdata.com/integrations/latest/psql/): PostgreSQL command line
|
||||
- [pgAdmin](https://docs.tigerdata.com/integrations/latest/pgadmin/): PostgreSQL administration
|
||||
- [DBeaver](https://docs.tigerdata.com/integrations/latest/dbeaver/): Database management tool
|
||||
- [Azure Data Studio](https://docs.tigerdata.com/integrations/latest/azure-data-studio/): Microsoft database tool
|
||||
- [qStudio](https://docs.tigerdata.com/integrations/latest/qstudio/): SQL analytics platform
|
||||
|
||||
### Monitoring and Observability
|
||||
- [Prometheus](https://docs.tigerdata.com/integrations/latest/prometheus/): Monitoring and alerting
|
||||
- [Datadog](https://docs.tigerdata.com/integrations/latest/datadog/): Infrastructure monitoring
|
||||
- [CloudWatch](https://docs.tigerdata.com/integrations/latest/cloudwatch/): AWS monitoring service
|
||||
|
||||
### Infrastructure
|
||||
- [Kubernetes](https://docs.tigerdata.com/integrations/latest/kubernetes/): Container orchestration
|
||||
- [Terraform](https://docs.tigerdata.com/integrations/latest/terraform/): Infrastructure as code
|
||||
- [Supabase](https://docs.tigerdata.com/integrations/latest/supabase/): Backend-as-a-service
|
||||
- [Corporate Data Center](https://docs.tigerdata.com/integrations/latest/corporate-data-center/): On-premises connectivity
|
||||
|
||||
### Connection Details
|
||||
- [Find connection details](https://docs.tigerdata.com/integrations/latest/find-connection-details/): Service connection information
|
||||
- [Troubleshooting](https://docs.tigerdata.com/integrations/latest/troubleshooting/): Integration troubleshooting guide
|
||||
|
||||
## Migration and Sync
|
||||
|
||||
- [Migration overview](https://docs.tigerdata.com/migrate/latest/): Migration strategies and tools
|
||||
- [pg_dump and restore](https://docs.tigerdata.com/migrate/latest/pg-dump-and-restore/): Traditional PostgreSQL migration
|
||||
- [Live migration](https://docs.tigerdata.com/migrate/latest/live-migration/): Low-downtime migration for large databases
|
||||
- [Live sync for PostgreSQL](https://docs.tigerdata.com/migrate/latest/livesync-for-postgresql/): Real-time sync from PostgreSQL
|
||||
- [Live sync for S3](https://docs.tigerdata.com/migrate/latest/livesync-for-s3/): Sync data from S3 storage
|
||||
- [Dual-write and backfill](https://docs.tigerdata.com/migrate/latest/dual-write-and-backfill/): Migration with zero downtime
|
||||
- [Migration troubleshooting](https://docs.tigerdata.com/migrate/latest/troubleshooting/): Common migration issues
|
||||
|
||||
## Self-hosted TimescaleDB
|
||||
|
||||
### Installation
|
||||
- [Self-hosted overview](https://docs.tigerdata.com/self-hosted/latest/): Installation options
|
||||
- [Docker installation](https://docs.tigerdata.com/self-hosted/latest/install/installation-docker/): Docker-based deployment
|
||||
- [Kubernetes installation](https://docs.tigerdata.com/self-hosted/latest/install/installation-kubernetes/): Kubernetes deployment
|
||||
- [Linux installation](https://docs.tigerdata.com/self-hosted/latest/install/installation-linux/): Linux package installation
|
||||
- [macOS installation](https://docs.tigerdata.com/self-hosted/latest/install/installation-macos/): macOS Homebrew/MacPorts
|
||||
- [Windows installation](https://docs.tigerdata.com/self-hosted/latest/install/installation-windows/): Windows installation
|
||||
- [Source installation](https://docs.tigerdata.com/self-hosted/latest/install/installation-source/): Build from source
|
||||
|
||||
### Configuration and Management
|
||||
- [Configuration overview](https://docs.tigerdata.com/self-hosted/latest/configuration/about-configuration/): Configuration fundamentals
|
||||
- [TimescaleDB configuration](https://docs.tigerdata.com/self-hosted/latest/configuration/timescaledb-config/): TimescaleDB-specific settings
|
||||
- [PostgreSQL configuration](https://docs.tigerdata.com/self-hosted/latest/configuration/postgres-config/): PostgreSQL tuning
|
||||
- [Docker configuration](https://docs.tigerdata.com/self-hosted/latest/configuration/docker-config/): Docker-specific configuration
|
||||
- [timescaledb-tune](https://docs.tigerdata.com/self-hosted/latest/configuration/timescaledb-tune/): Automated tuning tool
|
||||
- [Telemetry](https://docs.tigerdata.com/self-hosted/latest/configuration/telemetry/): Usage telemetry configuration
|
||||
|
||||
### Backup and Restore
|
||||
- [Backup overview](https://docs.tigerdata.com/self-hosted/latest/backup-and-restore/): Self-hosted backup strategies
|
||||
- [Logical backups](https://docs.tigerdata.com/self-hosted/latest/backup-and-restore/logical-backup/): pg_dump/pg_restore
|
||||
- [Physical backups](https://docs.tigerdata.com/self-hosted/latest/backup-and-restore/physical/): WAL-E and pgBackRest
|
||||
- [Docker and WAL-E](https://docs.tigerdata.com/self-hosted/latest/backup-and-restore/docker-and-wale/): Container backup solutions
|
||||
|
||||
### High Availability and Replication
|
||||
- [About high availability](https://docs.tigerdata.com/self-hosted/latest/replication-and-ha/about-ha/): HA architecture
|
||||
- [Configure replication](https://docs.tigerdata.com/self-hosted/latest/replication-and-ha/configure-replication/): Replication setup
|
||||
|
||||
### Migration
|
||||
- [Entire database migration](https://docs.tigerdata.com/self-hosted/latest/migration/entire-database/): Full database migration
|
||||
- [Schema then data migration](https://docs.tigerdata.com/self-hosted/latest/migration/schema-then-data/): Phased migration approach
|
||||
- [Same database migration](https://docs.tigerdata.com/self-hosted/latest/migration/same-db/): In-place migration
|
||||
- [Migrate from InfluxDB](https://docs.tigerdata.com/self-hosted/latest/migration/migrate-influxdb/): InfluxDB migration
|
||||
|
||||
### Upgrades and Maintenance
|
||||
- [About upgrades](https://docs.tigerdata.com/self-hosted/latest/upgrades/about-upgrades/): Upgrade strategies
|
||||
- [Major upgrades](https://docs.tigerdata.com/self-hosted/latest/upgrades/major-upgrade/): Major version upgrades
|
||||
- [Minor upgrades](https://docs.tigerdata.com/self-hosted/latest/upgrades/minor-upgrade/): Minor version upgrades
|
||||
- [Docker upgrades](https://docs.tigerdata.com/self-hosted/latest/upgrades/upgrade-docker/): Container upgrades
|
||||
- [PostgreSQL upgrades](https://docs.tigerdata.com/self-hosted/latest/upgrades/upgrade-pg/): PostgreSQL version upgrades
|
||||
- [Downgrade](https://docs.tigerdata.com/self-hosted/latest/upgrades/downgrade/): Version rollback
|
||||
|
||||
### Tooling
|
||||
- [About timescaledb-tune](https://docs.tigerdata.com/self-hosted/latest/tooling/about-timescaledb-tune/): Performance tuning tool
|
||||
- [Install toolkit](https://docs.tigerdata.com/self-hosted/latest/tooling/install-toolkit/): TimescaleDB toolkit installation
|
||||
|
||||
### Storage Management
|
||||
- [Manage storage](https://docs.tigerdata.com/self-hosted/latest/manage-storage/): Storage and tablespace management
|
||||
|
||||
### Uninstallation
|
||||
- [Uninstall TimescaleDB](https://docs.tigerdata.com/self-hosted/latest/uninstall/uninstall-timescaledb/): Clean removal
|
||||
|
||||
## Managed Service for TimescaleDB (MST)
|
||||
|
||||
### Getting Started
|
||||
- [About MST](https://docs.tigerdata.com/mst/latest/about-mst/): Managed service overview
|
||||
- [Install MST](https://docs.tigerdata.com/mst/latest/installation-mst/): Service setup and configuration
|
||||
- [User management](https://docs.tigerdata.com/mst/latest/user-management/): User roles and permissions
|
||||
- [Billing](https://docs.tigerdata.com/mst/latest/billing/): Pricing and billing information
|
||||
|
||||
### Data Operations
|
||||
- [Ingest data](https://docs.tigerdata.com/mst/latest/ingest-data/): Data ingestion patterns
|
||||
- [Migrate to MST](https://docs.tigerdata.com/mst/latest/migrate-to-mst/): Migration to managed service
|
||||
|
||||
### Infrastructure and Networking
|
||||
- [Connection pools](https://docs.tigerdata.com/mst/latest/connection-pools/): Connection management
|
||||
- [PostgreSQL read replicas](https://docs.tigerdata.com/mst/latest/postgresql-read-replica/): Read scaling
|
||||
- [VPC peering overview](https://docs.tigerdata.com/mst/latest/vpc-peering/): Private network connectivity
|
||||
- [AWS VPC peering](https://docs.tigerdata.com/mst/latest/vpc-peering/vpc-peering-aws/): Amazon VPC integration
|
||||
- [AWS Transit Gateway](https://docs.tigerdata.com/mst/latest/vpc-peering/vpc-peering-aws-transit/): Multi-VPC connectivity
|
||||
- [Azure VPC peering](https://docs.tigerdata.com/mst/latest/vpc-peering/vpc-peering-azure/): Microsoft Azure networking
|
||||
- [GCP VPC peering](https://docs.tigerdata.com/mst/latest/vpc-peering/vpc-peering-gcp/): Google Cloud networking
|
||||
|
||||
### Operations and Monitoring
|
||||
- [Extensions](https://docs.tigerdata.com/mst/latest/extensions/): Available PostgreSQL extensions
|
||||
- [Security](https://docs.tigerdata.com/mst/latest/security/): Security configuration
|
||||
- [Maintenance](https://docs.tigerdata.com/mst/latest/maintenance/): Maintenance windows and updates
|
||||
- [Failover](https://docs.tigerdata.com/mst/latest/failover/): High availability failover
|
||||
- [Manage backups](https://docs.tigerdata.com/mst/latest/manage-backups/): Backup management
|
||||
- [View service logs](https://docs.tigerdata.com/mst/latest/viewing-service-logs/): Log access and analysis
|
||||
|
||||
### Tools and APIs
|
||||
- [Aiven Client](https://docs.tigerdata.com/mst/latest/aiven-client/): Command-line management tool
|
||||
- [REST API](https://docs.tigerdata.com/mst/latest/restapi/): Programmatic service management
|
||||
- [Identify index issues](https://docs.tigerdata.com/mst/latest/identify-index-issues/): Performance optimization
|
||||
|
||||
### Integrations
|
||||
- [MST integrations overview](https://docs.tigerdata.com/mst/latest/integrations/): Integration options
|
||||
- [Grafana integration](https://docs.tigerdata.com/mst/latest/integrations/grafana-mst/): Visualization
|
||||
- [Prometheus integration](https://docs.tigerdata.com/mst/latest/integrations/prometheus-mst/): Monitoring
|
||||
- [Datadog metrics](https://docs.tigerdata.com/mst/latest/integrations/metrics-datadog/): Infrastructure monitoring
|
||||
- [Logging integration](https://docs.tigerdata.com/mst/latest/integrations/logging/): Log management
|
||||
|
||||
## API Reference
|
||||
|
||||
### Core APIs
|
||||
- [API overview](https://docs.tigerdata.com/api/latest/): Complete API reference
|
||||
- [Hypertable management](https://docs.tigerdata.com/api/latest/hypertable/): Hypertable creation and management
|
||||
- [Hypercore APIs](https://docs.tigerdata.com/api/latest/hypercore/): Columnar storage operations
|
||||
- [Continuous aggregates](https://docs.tigerdata.com/api/latest/continuous-aggregates/): Materialized view management
|
||||
- [Compression APIs](https://docs.tigerdata.com/api/latest/compression/): Data compression functions
|
||||
- [Data retention](https://docs.tigerdata.com/api/latest/data-retention/): Retention policy management
|
||||
- [Jobs and automation](https://docs.tigerdata.com/api/latest/jobs-automation/): Background job management
|
||||
|
||||
### Hyperfunctions
|
||||
- [Hyperfunctions overview](https://docs.tigerdata.com/api/latest/hyperfunctions/): Advanced analytical functions
|
||||
- [Statistical aggregates](https://docs.tigerdata.com/api/latest/stats-aggregates/): Statistical analysis
|
||||
- [Frequency analysis](https://docs.tigerdata.com/api/latest/frequency-analysis/): Frequency and histogram functions
|
||||
- [Time-weighted averages](https://docs.tigerdata.com/api/latest/time-weighted-averages/): Time-series averaging
|
||||
- [Gapfilling and interpolation](https://docs.tigerdata.com/api/latest/gapfilling-interpolation/): Missing data handling
|
||||
- [Counter aggregates](https://docs.tigerdata.com/api/latest/counter-aggregates/): Counter metrics
|
||||
- [Gauge aggregates](https://docs.tigerdata.com/api/latest/gauge-aggregates/): Gauge metrics
|
||||
- [State aggregates](https://docs.tigerdata.com/api/latest/state-aggregates/): State tracking
|
||||
|
||||
### Configuration and Administration
|
||||
- [Configuration APIs](https://docs.tigerdata.com/api/latest/configuration/): Database configuration
|
||||
- [Administration functions](https://docs.tigerdata.com/api/latest/administration/): Administrative operations
|
||||
- [Informational views](https://docs.tigerdata.com/api/latest/informational-views/): System information views
|
||||
|
||||
## About TigerData
|
||||
|
||||
- [About overview](https://docs.tigerdata.com/about/latest/): Company and product information
|
||||
- [Pricing and account management](https://docs.tigerdata.com/about/latest/pricing-and-account-management/): Pricing plans and billing
|
||||
- [TimescaleDB editions](https://docs.tigerdata.com/about/latest/timescaledb-editions/): Product tiers and features
|
||||
- [Changelog](https://docs.tigerdata.com/about/latest/changelog/): Latest product updates
|
||||
- [Release notes](https://docs.tigerdata.com/about/latest/release-notes/): Version release information
|
||||
- [Whitepaper](https://docs.tigerdata.com/about/latest/whitepaper/): Technical architecture paper
|
||||
- [Contribute to TigerData](https://docs.tigerdata.com/about/latest/contribute-to-timescale/): Community contribution guide
|
||||
|
||||
## Contributing
|
||||
|
||||
To contribute to this documentation:
|
||||
1. Fork or clone the repository
|
||||
2. Create a branch from `latest`
|
||||
3. Make your changes following the style guide in CONTRIBUTING.md
|
||||
4. Submit a pull request back to `latest`
|
||||
5. Sign the Contributor License Agreement (CLA) if this is your first contribution
|
||||
|
||||
The documentation is built using Gatsby and automatically generates preview links for pull requests.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,183 @@
|
||||
# Timescaledb - Performance
|
||||
|
||||
**Pages:** 2
|
||||
|
||||
---
|
||||
|
||||
## Alerting
|
||||
|
||||
**URL:** llms-txt#alerting
|
||||
|
||||
**Contents:**
|
||||
- Grafana
|
||||
- Other alerting tools
|
||||
|
||||
Early issue detecting and prevention, ensuring high availability, and performance optimization are only a few of the reasons why alerting plays a major role for modern applications, databases, and services.
|
||||
|
||||
There are a variety of different alerting solutions you can use in conjunction
|
||||
with Tiger Cloud that are part of the Postgres ecosystem. Regardless of
|
||||
whether you are creating custom alerts embedded in your applications, or using
|
||||
third-party alerting tools to monitor event data across your organization, there
|
||||
are a wide selection of tools available.
|
||||
|
||||
Grafana is a great way to visualize your analytical queries, and it has a
|
||||
first-class integration with Tiger Data products. Beyond data visualization, Grafana
|
||||
also provides alerting functionality to keep you notified of anomalies.
|
||||
|
||||
Within Grafana, you can [define alert rules][define alert rules] which are
|
||||
time-based thresholds for your dashboard data (for example, "Average CPU usage
|
||||
greater than 80 percent for 5 minutes"). When those alert rules are triggered,
|
||||
Grafana sends a message via the chosen notification channel. Grafana provides
|
||||
integration with webhooks, email and more than a dozen external services
|
||||
including Slack and PagerDuty.
|
||||
|
||||
To get started, first download and install [Grafana][Grafana-install]. Next, add
|
||||
a new [Postgres data source][PostgreSQL datasource] that points to your
|
||||
Tiger Cloud service. This data source was built by Tiger Data engineers, and
|
||||
it is designed to take advantage of the database's time-series capabilities.
|
||||
From there, proceed to your dashboard and set up alert rules as described above.
|
||||
|
||||
Alerting is only available in Grafana v4.0 and later.
|
||||
|
||||
## Other alerting tools
|
||||
|
||||
Tiger Cloud works with a variety of alerting tools within the Postgres
|
||||
ecosystem. Users can use these tools to set up notifications about meaningful
|
||||
events that signify notable changes to the system.
|
||||
|
||||
Some popular alerting tools that work with Tiger Cloud include:
|
||||
|
||||
* [DataDog][datadog-install]
|
||||
* [Nagios][nagios-install]
|
||||
* [Zabbix][zabbix-install]
|
||||
|
||||
See the [integration guides][integration-docs] for details.
|
||||
|
||||
===== PAGE: https://docs.tigerdata.com/use-timescale/data-retention/ =====
|
||||
|
||||
---
|
||||
|
||||
## Improve query and upsert performance
|
||||
|
||||
**URL:** llms-txt#improve-query-and-upsert-performance
|
||||
|
||||
**Contents:**
|
||||
- Segmenting and ordering data
|
||||
- Improve performance in the columnstore by segmenting and ordering data
|
||||
|
||||
Real-time analytics applications require more than fast inserts and analytical queries. They also need high performance
|
||||
when retrieving individual records, enforcing constraints, or performing upserts, something that OLAP/columnar databases
|
||||
lack. This pages explains how to improve performance by segmenting and ordering data.
|
||||
|
||||
To improve query performance using indexes, see [About indexes][about-index] and [Indexing data][create-index].
|
||||
|
||||
## Segmenting and ordering data
|
||||
|
||||
To optimize query performance, TimescaleDB enables you to explicitly control the way your data is physically organized
|
||||
in the columnstore. By structuring data effectively, queries can minimize disk reads and execute more efficiently, using
|
||||
vectorized execution for parallel batch processing where possible.
|
||||
|
||||
<center>
|
||||
<img
|
||||
class="main-content__illustration"
|
||||
width="80%"
|
||||
src="https://assets.timescale.com/docs/images/columnstore-segmentby.png"
|
||||
alt=""
|
||||
/>
|
||||
</center>
|
||||
|
||||
* **Group related data together to improve scan efficiency**: organizing rows into logical segments ensures that queries
|
||||
filtering by a specific value only scan relevant data sections. For example, in the above, querying for a specific ID
|
||||
is particularly fast.
|
||||
* **Sort data within segments to accelerate range queries**: defining a consistent order reduces the need for post-query
|
||||
sorting, making time-based queries and range scans more efficient.
|
||||
* **Reduce disk reads and maximize vectorized execution**: a well-structured storage layout enables efficient batch
|
||||
processing (Single Instruction, Multiple Data, or SIMD vectorization) and parallel execution, optimizing query performance.
|
||||
|
||||
By combining segmentation and ordering, TimescaleDB ensures that columnar queries are not only fast but also
|
||||
resource-efficient, enabling high-performance real-time analytics.
|
||||
|
||||
### Improve performance in the columnstore by segmenting and ordering data
|
||||
|
||||
Ordering data in the columnstore has a large impact on the compression ratio and performance of your queries.
|
||||
Rows that change over a dimension should be close to each other. As hypertables contain time-series data,
|
||||
they are partitioned by time. This makes the time column a perfect candidate for ordering your data since the
|
||||
measurements evolve as time goes on.
|
||||
|
||||
If you use `orderby` as your only columnstore setting, you get a good enough compression ratio to save a lot of
|
||||
storage and your queries are faster. However, if you only use `orderby`, you always have to access your data using the
|
||||
time dimension, then filter the rows returned on other criteria.
|
||||
|
||||
Accessing the data effectively depends on your use case and your queries. You segment data in the columnstore
|
||||
to match the way you want to access it. That is, in a way that makes it easier for your queries to fetch the right data
|
||||
at the right time. When you segment your data to access specific columns, your queries are optimized and yield even better performance.
|
||||
|
||||
For example, to access information about a single device with a specific `device_id`, you segment on the `device_id` column.
|
||||
This enables you to run analytical queries on compressed data in the columnstore much faster.
|
||||
|
||||
For example for the following hypertable:
|
||||
|
||||
1. **Execute a query on a regular hypertable**
|
||||
1. Query your data
|
||||
|
||||
Gives the following result:
|
||||
|
||||
1. **Execute a query on the same data segmented and ordered in the columnstore**
|
||||
|
||||
1. Control the way your data is ordered in the columnstore:
|
||||
|
||||
1. Query your data
|
||||
|
||||
Gives the following result:
|
||||
|
||||
As you see, using `orderby` and `segmentby` not only reduces the amount of space taken by your data, but also
|
||||
vastly improves query speed.
|
||||
|
||||
The number of rows that are compressed together in a single batch (like the ones we see above) is 1000.
|
||||
If your chunk does not contain enough data to create big enough batches, your compression ratio will be reduced.
|
||||
This needs to be taken into account when you define your columnstore settings.
|
||||
|
||||
===== PAGE: https://docs.tigerdata.com/use-timescale/hypercore/modify-data-in-hypercore/ =====
|
||||
|
||||
**Examples:**
|
||||
|
||||
Example 1 (sql):
|
||||
```sql
|
||||
CREATE TABLE metrics (
|
||||
time TIMESTAMPTZ,
|
||||
user_id INT,
|
||||
device_id INT,
|
||||
data JSONB
|
||||
) WITH (
|
||||
tsdb.hypertable,
|
||||
tsdb.partition_column='time'
|
||||
);
|
||||
```
|
||||
|
||||
Example 2 (sql):
|
||||
```sql
|
||||
SELECT device_id, AVG(cpu) AS avg_cpu, AVG(disk_io) AS avg_disk_io
|
||||
FROM metrics
|
||||
WHERE device_id = 5
|
||||
GROUP BY device_id;
|
||||
```
|
||||
|
||||
Example 3 (sql):
|
||||
```sql
|
||||
device_id | avg_cpu | avg_disk_io
|
||||
-----------+--------------------+---------------------
|
||||
5 | 0.4972598866221261 | 0.49820356730280524
|
||||
(1 row)
|
||||
Time: 177,399 ms
|
||||
```
|
||||
|
||||
Example 4 (sql):
|
||||
```sql
|
||||
ALTER TABLE metrics SET (
|
||||
timescaledb.enable_columnstore = true,
|
||||
timescaledb.orderby = 'time',
|
||||
timescaledb.segmentby = 'device_id'
|
||||
);
|
||||
```
|
||||
|
||||
---
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,69 @@
|
||||
# Ccxt - Cli
|
||||
|
||||
**Pages:** 1
|
||||
|
||||
---
|
||||
|
||||
## Search code, repositories, users, issues, pull requests...
|
||||
|
||||
**URL:** https://github.com/ccxt/ccxt/wiki/CLI
|
||||
|
||||
**Contents:**
|
||||
- CCXT CLI (Command-Line Interface)
|
||||
- Install globally
|
||||
- Install
|
||||
- Usage
|
||||
- Inspecting Exchange Properties
|
||||
- Calling A Unified Method By Name
|
||||
- Calling An Exchange-Specific Method By Name
|
||||
- Authentication And Overrides
|
||||
- Unified API vs Exchange-Specific API
|
||||
- Run with jq
|
||||
|
||||
CCXT includes an example that allows calling all exchange methods and properties from command line. One doesn't even have to be a programmer or write code – any user can use it!
|
||||
|
||||
The CLI interface is a program in CCXT that takes the exchange name and some params from the command line and executes a corresponding call from CCXT printing the output of the call back to the user. Thus, with CLI you can use CCXT out of the box, not a single line of code needed.
|
||||
|
||||
CCXT command line interface is very handy and useful for:
|
||||
|
||||
For the CCXT library users – we highly recommend to try CLI at least a few times to get a feel of it. For the CCXT library developers – CLI is more than just a recommendation, it's a must.
|
||||
|
||||
The best way to learn and understand CCXT CLI – is by experimentation, trial and error. Warning: CLI executes your command and does not ask for a confirmation after you launch it, so be careful with numbers, confusing amounts with prices can cause a loss of funds.
|
||||
|
||||
The same CLI design is implemented in all supported languages, TypeScript, JavaScript, Python and PHP – for the purposes of example code for the developers. In other words, the existing CLI contains three implementations that are in many ways identical. The code in those three CLI examples is intended to be "easily understandable".
|
||||
|
||||
The source code of the CLI is available here:
|
||||
|
||||
Clone the CCXT repository:
|
||||
|
||||
Change directory to the cloned repository:
|
||||
|
||||
Install the dependencies:
|
||||
|
||||
The CLI script requires at least one argument, that is, the exchange id (the list of supported exchanges and their ids). If you don't specify the exchange id, the script will print the list of all exchange ids for reference.
|
||||
|
||||
Upon launch, CLI will create and initialize the exchange instance and will also call exchange.loadMarkets() on that exchange. If you don't specify any other command-line arguments to CLI except the exchange id argument, then the CLI script will print out all the contents of the exchange object, including the list of all the methods and properties and all the loaded markets (the output may be extremely long in that case).
|
||||
|
||||
Normally, following the exchange id argument one would specify a method name to call with its arguments or an exchange property to inspect on the exchange instance.
|
||||
|
||||
If the only parameter you specify to CLI is the exchange id, then it will print out the contents of the exchange instance including all properties, methods, markets, currencies, etc. Warning: exchange contents are HUGE and this will dump A LOT of output to your screen!
|
||||
|
||||
You can specify the name of the property of the exchange to narrow the output down to a reasonable size.
|
||||
|
||||
You can easily view which methods are supported on the various exchanges:
|
||||
|
||||
Calling unified methods is easy:
|
||||
|
||||
Exchange specific parameters can be set in the last argument of every unified method:
|
||||
|
||||
Here's an example of fetching the order book on okx in sandbox mode using the implicit API and the exchange specific instId and sz parameters:
|
||||
|
||||
Public exchange APIs don't require authentication. You can use the CLI to call any method of a public API. The difference between public APIs and private APIs is described in the Manual, here: Public/Private API.
|
||||
|
||||
For private API calls, by default the CLI script will look for API keys in the keys.local.json file in the root of the repository cloned to your working directory and will also look up exchange credentials in the environment variables. More details here: Adding Exchange Credentials.
|
||||
|
||||
CLI supports all possible methods and properties that exist on the exchange instance.
|
||||
|
||||
(If the page is not being rendered for you, you can refer to the mirror at https://docs.ccxt.com/)
|
||||
|
||||
---
|
||||
@@ -0,0 +1,29 @@
|
||||
# Ccxt - Exchanges
|
||||
|
||||
**Pages:** 2
|
||||
|
||||
---
|
||||
|
||||
## Search code, repositories, users, issues, pull requests...
|
||||
|
||||
**URL:** https://github.com/ccxt/ccxt/wiki/Exchange-Markets
|
||||
|
||||
**Contents:**
|
||||
- Supported Exchanges
|
||||
|
||||
(If the page is not being rendered for you, you can refer to the mirror at https://docs.ccxt.com/)
|
||||
|
||||
---
|
||||
|
||||
## Search code, repositories, users, issues, pull requests...
|
||||
|
||||
**URL:** https://github.com/ccxt/ccxt/wiki/Exchange-Markets-By-Country
|
||||
|
||||
**Contents:**
|
||||
- Exchanges By Country
|
||||
|
||||
The ccxt library currently supports the following cryptocurrency exchange markets and trading APIs:
|
||||
|
||||
(If the page is not being rendered for you, you can refer to the mirror at https://docs.ccxt.com/)
|
||||
|
||||
---
|
||||
@@ -0,0 +1,111 @@
|
||||
# Ccxt - Faq
|
||||
|
||||
**Pages:** 1
|
||||
|
||||
---
|
||||
|
||||
## Search code, repositories, users, issues, pull requests...
|
||||
|
||||
**URL:** https://github.com/ccxt/ccxt/wiki/FAQ
|
||||
|
||||
**Contents:**
|
||||
- Frequently Asked Questions
|
||||
- I'm trying to run the code, but it's not working, how do I fix it?
|
||||
- What is required to get help?
|
||||
- I am calling a method and I get an error, what am I doing wrong?
|
||||
- I got an incorrect result from a method call, can you help?
|
||||
- Can you implement feature foo in exchange bar?
|
||||
- When will you add feature foo for exchange bar ? What's the estimated time? When should we expect this?
|
||||
- When will you add the support for an exchange requested in the Issues?
|
||||
- How long should I wait for a feature to be added? I need to decide whether to implement it myself or to wait for the CCXT Dev Team to implement it for me.
|
||||
- What's your progress on adding the feature foo that was requested earlier? How do you do implementing exchange bar?
|
||||
|
||||
If your question is formulated in a short manner like the above, we won't help. We don't teach programming. If you're unable to read and understand the Manual or you can't follow precisely the guides from the CONTRIBUTING doc on how to report an issue, we won't help either. Read the CONTRIBUTING guides on how to report an issue and read the Manual. You should not risk anyone's money and time without reading the entire Manual very carefully. You should not risk anything if you're not used to a lot of reading with tons of details. Also, if you don't have the confidence with the programming language you're using, there are much better places for coding fundamentals and practice. Search for python tutorials, js videos, play with examples, this is how other people climb up the learning curve. No shortcuts, if you want to learn something.
|
||||
|
||||
When asking a question:
|
||||
|
||||
Use the search button for duplicates first!
|
||||
|
||||
Post your request and response in verbose mode! Add exchange.verbose = true right before the line you're having issues with, and copypaste what you see on your screen. It's written and mentioned everywhere, in the Troubleshooting section, in the README and in many answers to similar questions among previous issues and pull requests. No excuses. The verbose output should include both the request and response from the exchange.
|
||||
|
||||
Include the full error callstack!
|
||||
|
||||
Write your programming language and language version number
|
||||
|
||||
Write the CCXT / CCXT Pro library version number
|
||||
|
||||
Which method you're trying to call
|
||||
|
||||
Post your code to reproduce the problem. Make it a complete short runnable program, don't swallow the lines and make it as compact as you can (5-10 lines of code), including the exchange instantation code. Remove all irrelevant parts from it, leaving just the essence of the code to reproduce the issue.
|
||||
|
||||
DO NOT POST YOUR apiKey AND secret! Keep them safe (remove them before posting)!
|
||||
|
||||
You're not reporting the issue properly ) Please, help the community to help you ) Read this and follow the steps: https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-submit-an-issue. Once again, your code to reproduce the issue and your verbose request and response ARE REQUIRED. Just the error traceback, or just the response, or just the request, or just the code – is not enough!
|
||||
|
||||
Basically the same answer as the previous question. Read and follow precisely: https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-submit-an-issue. Once again, your code to reproduce the issue and your verbose request and response ARE REQUIRED. Just the error traceback, or just the response, or just the request, or just the code – is not enough!
|
||||
|
||||
Yes, we can. And we will, if nobody else does that before us. There's very little point in asking this type of questions, because the answer is always positive. When someone asks if we can do this or that, the question is not about our abilities, it all boils down to time and management needed for implementing all accumulated feature requests.
|
||||
|
||||
Moreover, this is an open-source library which is a work in progress. This means, that this project is intended to be developed by the community of users, who are using it. What you're asking is not whether we can or cannot implement it, in fact you're actually telling us to go do that particular task and this is not how we see a voluntary collaboration. Your contributions, PRs and commits are welcome: https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code.
|
||||
|
||||
We don't give promises or estimates on the free open-source work. If you wish to speed it up, feel free to reach out to us via info@ccxt.trade.
|
||||
|
||||
We don't give promises or estimates on the open-source work. The reasoning behind this is explained in the previous paragraph.
|
||||
|
||||
Again, we can't promise on the dates for adding this or that exchange, due to reasons outlined above. The answer will always remain the same: as soon as we can.
|
||||
|
||||
Please, go for implemeting it yourself, do not wait for us. We will add it as soon as we can. Also, your contributions are very welcome:
|
||||
|
||||
This type of questions is usually a waste of time, because answering it usually requires too much time for context-switching, and it often takes more time to answer this question, than to actually satisfy the request with code for a new feature or a new exchange. The progress of this open-source project is also open, so, whenever you're wondering how it is doing, take a look into commit history.
|
||||
|
||||
If it is not merged, it means that the PR contains errors, that should be fixed first. If it could be merged as is – we would merge it, and you wouldn't have asked this question in the first place. The most frequent reason for not merging a PR is a violation of any of the CONTRIBUTING guidelines. Those guidelines should be taken literally, cannot skip a single line or word from there if you want your PR to be merged quickly. Code contributions that do not break the guidelines get merged almost immediately (usually, within hours).
|
||||
|
||||
Unfortunately, we don't always have the time to quickly list out each and every single error in the code that prevents it from merging. It is often easier and faster to just go and fix the error rather than explain what one should do to fix it. Most of them are already outlined in the CONTRIBUTING guidelines. The main rule of thumb is to follow all guidelines literally.
|
||||
|
||||
Our build system generates exchange-specific JavaScript, Python and PHP code for us automatically, so it is transpiled from TypeScript, and there's no need to fix all languages separately one by one.
|
||||
|
||||
Thus, if it is fixed in TypeScript, it is fixed in JavaScript NPM, Python pip and PHP Composer as well. The automatic build usually takes 15-20 minutes. Just upgrade your version with npm, pip or composer after the new version arrives and you'll be fine.
|
||||
|
||||
Some exchanges support createOrder with the additional "attached" stopLoss & takeProfit sub-orders - view StopLoss And TakeProfit Orders Attached To A Position. However, some exchanges might not support that feature and you will need to run separate createOrder methods to add conditional order (e.g. *trigger order | stoploss order | takeprofit order) to the already open position - view [Conditional orders](Manual.md#Conditional Orders). You can also check them by looking at exchange.has['createOrderWithTakeProfitAndStopLoss'], exchange.has['createStopLossOrder'] and exchange.has['createTakeProfitOrder'], however they are not as precise as .features property.
|
||||
|
||||
To create a market-buy order with cost, first, you need to check if the exchange supports that feature (exchange.has['createMarketBuyOrderWithCost']). If it does, then you can use the createMarketBuyOrderWithCost` method. Example:
|
||||
|
||||
Many exchanges require the amount to be in the quote currency (they don't accept the base amount) when placing spot-market buy orders. In those cases, the exchange will have the option createMarketBuyRequiresPrice set to true.
|
||||
|
||||
Example: If you wanted to buy BTC/USDT with a market buy-order, you would need to provide an amount = 5 USDT instead of 0.000X. We have a check to prevent errors that explicitly require the price because users will usually provide the amount in the base currency.
|
||||
|
||||
So by default, if you do, create_order(symbol, 'market,' 'buy,' 10) will throw an error if the exchange has that option (createOrder() requires the price argument for market buy orders to calculate the total cost to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to false...).
|
||||
|
||||
If the exchange requires the cost and the user provided the base amount, we need to request an extra parameter price and multiply them to get the cost. If you're aware of this behavior, you can simply disable createMarketBuyOrderRequiresPrice and pass the cost in the amount parameter, but disabling it does not mean you can place the order using the base amount instead of the quote.
|
||||
|
||||
If you do create_order(symbol, 'market', 'buy', 0.001, 20000) ccxt will use the required price to calculate the cost by doing 0.01*20000 and send that value to the exchange.
|
||||
|
||||
If you want to provide the cost directly in the amount argument, you can do exchange.options['createMarketBuyOrderRequiresPrice'] = False (you acknowledge that the amount will be the cost for market-buy) and then you can do create_order(symbol, 'market', 'buy', 10)
|
||||
|
||||
This is basically to avoid a user doing this: create_order('SHIB/USDT', market, buy, 1000000) and thinking he's trying to buy 1kk of shib but in reality he's buying 1kk USDT worth of SHIB. For that reason, by default ccxt always accepts the base currency in the amount parameter.
|
||||
|
||||
Alternatively, you can use the functions createMarketBuyOrderWithCost/ createMarketSellOrderWithCost if they are available.
|
||||
|
||||
See more: Market Buys
|
||||
|
||||
Spot trading involves buying or selling a financial instrument (like a cryptocurrency) for immediate delivery. It's straightforward, involving the direct exchange of assets.
|
||||
|
||||
Swap trading, on the other hand, involves derivative contracts where two parties exchange financial instruments or cash flows at a set date in the future, based on the underlying asset. Swaps are often used for leverage, speculation, or hedging and do not necessarily involve the exchange of the underlying asset until the contract expires.
|
||||
|
||||
Besides that, you will be handling contracts if you're trading swaps and not the base currency (e.g., BTC) directly, so if you create an order with amount = 1, the amount in BTC will vary depending on the contractSize. You can check the contract size by doing:
|
||||
|
||||
A reduceOnly order is a type of order that can only reduce a position, not increase it. To place a reduceOnly order, you typically use the createOrder method with a reduceOnly parameter set to true. This ensures that the order will only execute if it decreases the size of an open position, and it will either partially fill or not fill at all if executing it would increase the position size.
|
||||
|
||||
See more: Trailing Orders
|
||||
|
||||
To check the endpoint used by a unified method in the CCXT library, you would typically need to refer to the source code of the library for the specific exchange implementation you're interested in. The unified methods in CCXT abstract away the details of the specific endpoints they interact with, so this information is not directly exposed via the library's API. For detailed inspection, you can look at the implementation of the method for the particular exchange in the CCXT library's source code on GitHub.
|
||||
|
||||
See more: Unified API
|
||||
|
||||
The funding rate structure has three different funding rate values that can be returned:
|
||||
|
||||
As an example, say it is 12:30. The previousFundingRate happened at 12:00 and we're looking to see what the upcoming funding rate will be by checking the fundingRate value. In this example, given 4-hour intervals, the fundingRate will happen in the future at 4:00 and the nextFundingRate is the predicted rate that will happen at 8:00.
|
||||
|
||||
(If the page is not being rendered for you, you can refer to the mirror at https://docs.ccxt.com/)
|
||||
|
||||
---
|
||||
@@ -0,0 +1,72 @@
|
||||
# Ccxt - Getting Started
|
||||
|
||||
**Pages:** 1
|
||||
|
||||
---
|
||||
|
||||
## Search code, repositories, users, issues, pull requests...
|
||||
|
||||
**URL:** https://github.com/ccxt/ccxt/wiki/Install
|
||||
|
||||
**Contents:**
|
||||
- Install
|
||||
- JavaScript (NPM)
|
||||
- JavaScript (for use with the <script> tag):
|
||||
- Custom JavaScript Builds
|
||||
- Python
|
||||
- PHP
|
||||
- .net/C#
|
||||
- Docker
|
||||
- Proxy
|
||||
|
||||
The easiest way to install the ccxt library is to use builtin package managers:
|
||||
|
||||
This library is shipped as an all-in-one module implementation with minimalistic dependencies and requirements:
|
||||
|
||||
You can also clone it into your project directory from ccxt GitHub repository and copy files manually into your working directory with language extension appropriate for your environment.
|
||||
|
||||
An alternative way of installing this library is to build a custom bundle from source. Choose exchanges you need in exchanges.cfg.
|
||||
|
||||
JavaScript version of ccxt works both in Node and web browsers. Requires ES6 and async/await syntax support (Node 15+). When compiling with Webpack and Babel, make sure it is not excluded in your babel-loader config.
|
||||
|
||||
ccxt crypto trading library in npm
|
||||
|
||||
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
||||
|
||||
You can obtain a live-updated version of the bundle by removing the version number from the URL (the @a.b.c thing) or the /latest/ on our cdn — however, we do not recommend to do that, as it may break your app eventually. Also, please keep in mind that we are not responsible for the correct operation of those CDN servers.
|
||||
|
||||
We also provide webpack minified and tree-shaken versions of the library starting from version 3.0.35 - Visit https://cdn.ccxt.com to browse the prebundled versions we distribute.
|
||||
|
||||
Note: the file sizes are subject to change.
|
||||
|
||||
Here is an example using a custom bybit bundle from our cdn in the browser
|
||||
|
||||
The default entry point for the browser is window.ccxt and it creates a global ccxt object:
|
||||
|
||||
It takes time to load all scripts and resources. The problem with in-browser usage is that the entire CCXT library weighs a few megabytes which is a lot for a web application. Sometimes it is also critical for a Node app. Therefore to lower the loading time you might want to make your own custom build of CCXT for your app with just the exchanges you need. CCXT uses webpack to remove dead code paths to make the package smaller.
|
||||
|
||||
ccxt algotrading library in PyPI
|
||||
|
||||
The library supports concurrent asynchronous mode with asyncio and async/await in Python 3.5.3+
|
||||
|
||||
The autoloadable version of ccxt can be installed with Packagist/Composer (PHP 8.1+).
|
||||
|
||||
It can also be installed from the source code: ccxt.php
|
||||
|
||||
It requires common PHP modules:
|
||||
|
||||
The library supports concurrent asynchronous mode using tools from ReactPHP in PHP 8.1+. Read the Manual for more details.
|
||||
|
||||
ccxt in C# with Nugget (netstandard 2.0 and netstandard 2.1)
|
||||
|
||||
You can get CCXT installed in a container along with all the supported languages and dependencies. This may be useful if you want to contribute to CCXT (e.g. run the build scripts and tests — please see the Contributing document for the details on that).
|
||||
|
||||
You don't need the Docker image if you're not going to develop CCXT. If you just want to use CCXT – just install it as a regular package into your project.
|
||||
|
||||
Using docker-compose (in the cloned CCXT repository):
|
||||
|
||||
If you are unable to obtain data from exchanges due to location restrictions read the proxy section.
|
||||
|
||||
(If the page is not being rendered for you, you can refer to the mirror at https://docs.ccxt.com/)
|
||||
|
||||
---
|
||||
@@ -0,0 +1,35 @@
|
||||
# Ccxt Documentation Index
|
||||
|
||||
## Categories
|
||||
|
||||
### Cli
|
||||
**File:** `cli.md`
|
||||
**Pages:** 1
|
||||
|
||||
### Exchanges
|
||||
**File:** `exchanges.md`
|
||||
**Pages:** 2
|
||||
|
||||
### Faq
|
||||
**File:** `faq.md`
|
||||
**Pages:** 1
|
||||
|
||||
### Getting Started
|
||||
**File:** `getting_started.md`
|
||||
**Pages:** 1
|
||||
|
||||
### Manual
|
||||
**File:** `manual.md`
|
||||
**Pages:** 2
|
||||
|
||||
### Other
|
||||
**File:** `other.md`
|
||||
**Pages:** 1
|
||||
|
||||
### Pro
|
||||
**File:** `pro.md`
|
||||
**Pages:** 1
|
||||
|
||||
### Specification
|
||||
**File:** `specification.md`
|
||||
**Pages:** 2
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,27 @@
|
||||
# Ccxt - Other
|
||||
|
||||
**Pages:** 1
|
||||
|
||||
---
|
||||
|
||||
## Search code, repositories, users, issues, pull requests...
|
||||
|
||||
**URL:** https://github.com/ccxt/ccxt/wiki
|
||||
|
||||
**Contents:**
|
||||
- General Information
|
||||
- How To Install
|
||||
- How To Use
|
||||
- WebSocket Support
|
||||
- Troubleshooting
|
||||
- Examples
|
||||
- New Exchanges
|
||||
- API Reference
|
||||
|
||||
Welcome to the ccxt wiki!
|
||||
|
||||
We recommend to visit our full documentation at https://docs.ccxt.com
|
||||
|
||||
(If the page is not being rendered for you, you can refer to the mirror at https://docs.ccxt.com/)
|
||||
|
||||
---
|
||||
@@ -0,0 +1,18 @@
|
||||
# Ccxt - Pro
|
||||
|
||||
**Pages:** 1
|
||||
|
||||
---
|
||||
|
||||
## Search code, repositories, users, issues, pull requests...
|
||||
|
||||
**URL:** https://github.com/ccxt/ccxt/wiki/ccxt.pro
|
||||
|
||||
**Contents:**
|
||||
- CCXT Pro
|
||||
|
||||
CCXT supports WebSockets (Pro part) for many exchanges.
|
||||
|
||||
(If the page is not being rendered for you, you can refer to the mirror at https://docs.ccxt.com/)
|
||||
|
||||
---
|
||||
@@ -0,0 +1,44 @@
|
||||
# Ccxt - Specification
|
||||
|
||||
**Pages:** 2
|
||||
|
||||
---
|
||||
|
||||
## Search code, repositories, users, issues, pull requests...
|
||||
|
||||
**URL:** https://github.com/ccxt/ccxt/wiki/Requirements
|
||||
|
||||
**Contents:**
|
||||
- CCXT Integration Requirements
|
||||
- Public API
|
||||
- Exchange Information, Fee Schedule and Trading Rules
|
||||
- Market Data
|
||||
- Private API
|
||||
- Trading
|
||||
- Trading History
|
||||
- Funding
|
||||
|
||||
The exchange is required to implement the following list of methods and structures in order to get integrated with CCXT.
|
||||
|
||||
(If the page is not being rendered for you, you can refer to the mirror at https://docs.ccxt.com/)
|
||||
|
||||
---
|
||||
|
||||
## Search code, repositories, users, issues, pull requests...
|
||||
|
||||
**URL:** https://github.com/ccxt/ccxt/wiki/Certification
|
||||
|
||||
**Contents:**
|
||||
- CCXT Certification Program ·
|
||||
- Requirements
|
||||
- Contact Us
|
||||
|
||||
The structure of CCXT defines a good, portable and cross-compatible standard for exchanges' API interfaces, that is implemented in the CCXT Unified API. Exchanges are welcome to apply for our certification program. Certification is technically supervised and quality-assured by members of the CCXT Dev Team. That implies that an exchange having a "certified" badge is properly implemented and tested by the authors of CCXT. Certification means less bugs, more functionality, priority support and a much more stable and efficient implementation in general.
|
||||
|
||||
Getting integrated and certified requires the exchange to implement a quality API. Please, see the full list of technical requirements here: https://github.com/ccxt/ccxt/wiki/Requirements
|
||||
|
||||
For inquiries on getting your exchange integrated, listed and certified: info@ccxt.trade
|
||||
|
||||
(If the page is not being rendered for you, you can refer to the mirror at https://docs.ccxt.com/)
|
||||
|
||||
---
|
||||
@@ -0,0 +1,80 @@
|
||||
---
|
||||
name: coingecko
|
||||
description: CoinGecko API documentation - cryptocurrency market data API, price feeds, market cap, volume, historical data. Use when integrating CoinGecko API, building crypto price trackers, or accessing cryptocurrency market data.
|
||||
---
|
||||
|
||||
# Coingecko Skill
|
||||
|
||||
Comprehensive assistance with coingecko development, generated from official documentation.
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
This skill should be triggered when:
|
||||
- Working with coingecko
|
||||
- Asking about coingecko features or APIs
|
||||
- Implementing coingecko solutions
|
||||
- Debugging coingecko code
|
||||
- Learning coingecko best practices
|
||||
|
||||
## Quick Reference
|
||||
|
||||
### Common Patterns
|
||||
|
||||
*Quick reference patterns will be added as you use the skill.*
|
||||
|
||||
## Reference Files
|
||||
|
||||
This skill includes comprehensive documentation in `references/`:
|
||||
|
||||
- **authentication.md** - Authentication documentation
|
||||
- **coins.md** - Coins documentation
|
||||
- **contract.md** - Contract documentation
|
||||
- **exchanges.md** - Exchanges documentation
|
||||
- **introduction.md** - Introduction documentation
|
||||
- **market_data.md** - Market Data documentation
|
||||
- **nfts.md** - Nfts documentation
|
||||
- **other.md** - Other documentation
|
||||
- **pricing.md** - Pricing documentation
|
||||
- **reference.md** - Reference documentation
|
||||
- **trending.md** - Trending documentation
|
||||
|
||||
Use `view` to read specific reference files when detailed information is needed.
|
||||
|
||||
## Working with This Skill
|
||||
|
||||
### For Beginners
|
||||
Start with the getting_started or tutorials reference files for foundational concepts.
|
||||
|
||||
### For Specific Features
|
||||
Use the appropriate category reference file (api, guides, etc.) for detailed information.
|
||||
|
||||
### For Code Examples
|
||||
The quick reference section above contains common patterns extracted from the official docs.
|
||||
|
||||
## Resources
|
||||
|
||||
### references/
|
||||
Organized documentation extracted from official sources. These files contain:
|
||||
- Detailed explanations
|
||||
- Code examples with language annotations
|
||||
- Links to original documentation
|
||||
- Table of contents for quick navigation
|
||||
|
||||
### scripts/
|
||||
Add helper scripts here for common automation tasks.
|
||||
|
||||
### assets/
|
||||
Add templates, boilerplate, or example projects here.
|
||||
|
||||
## Notes
|
||||
|
||||
- This skill was automatically generated from official documentation
|
||||
- Reference files preserve the structure and examples from source docs
|
||||
- Code examples include language detection for better syntax highlighting
|
||||
- Quick reference patterns are extracted from common usage examples in the docs
|
||||
|
||||
## Updating
|
||||
|
||||
To refresh this skill with updated documentation:
|
||||
1. Re-run the scraper with the same configuration
|
||||
2. The skill will be rebuilt with the latest information
|
||||
@@ -0,0 +1,200 @@
|
||||
# Coingecko - Authentication
|
||||
|
||||
**Pages:** 3
|
||||
|
||||
---
|
||||
|
||||
## Authentication (Public/Demo)
|
||||
|
||||
**URL:** llms-txt#authentication-(public/demo)
|
||||
|
||||
**Contents:**
|
||||
- CoinGecko API Authentication Method
|
||||
- API Key Usage Credits
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/authentication
|
||||
|
||||
Authentication method for CoinGecko Public API (Demo plan users)
|
||||
|
||||
<Note>
|
||||
### **Notes**
|
||||
|
||||
* Demo API Key is only available for CoinGecko Public Demo API Plan, the root URL for CoinGecko Public Demo API must be `https://api.coingecko.com/api/v3/`.
|
||||
* ⚠️ You are recommended to store the API key securely in your own backend and use a proxy to insert the key into the request URL.
|
||||
* The authentication method below is for CoinGecko Public Demo API only. For **paid plan users with Pro-API key**, please refer to [this page](/reference/authentication) instead.
|
||||
* User Guide: [How to sign up for CoinGecko Demo API and generate an API key?](https://support.coingecko.com/hc/en-us/articles/21880397454233)
|
||||
* It's highly recommended to use the **Headers method** when making API requests for better security. Using query string parameters can risk exposing your API key.
|
||||
</Note>
|
||||
|
||||
## CoinGecko API Authentication Method
|
||||
|
||||
If this is your first time using the Demo API key, you can supply API Key to the root URL using one of these ways:
|
||||
|
||||
1. Header (Recommended): `x-cg-demo-api-key`
|
||||
2. Query String Parameter: `x_cg_demo_api_key`
|
||||
|
||||
| Authentication Method | Example using [Ping](/v3.0.1/reference/ping-server) Endpoint |
|
||||
| ---------------------- | ------------------------------------------------------------------------------------------ |
|
||||
| Header (cURL) | `curl -X GET "https://api.coingecko.com/api/v3/ping" -H "x-cg-demo-api-key: YOUR_API_KEY"` |
|
||||
| Query String Parameter | `https://api.coingecko.com/api/v3/ping?x_cg_demo_api_key=YOUR_API_KEY` |
|
||||
|
||||
## API Key Usage Credits
|
||||
|
||||
* Each request made to any endpoint counts as a single call (1 call = 1 credit).
|
||||
* Your monthly credit & rate limit are determined by the paid plan to which you subscribe. For more details, please refer to this [page](https://www.coingecko.com/en/api/pricing).
|
||||
* To check the API usage, please go to the [developer dashboard](https://www.coingecko.com/en/developers/dashboard) or follow the guide [here](/v3.0.1/reference/setting-up-your-api-key#4-api-usage-report).
|
||||
|
||||
---
|
||||
|
||||
## Authentication (Pro API)
|
||||
|
||||
**URL:** llms-txt#authentication-(pro-api)
|
||||
|
||||
**Contents:**
|
||||
- CoinGecko API Authentication Method
|
||||
- 🔥 Accessing Onchain DEX data
|
||||
- API Key Usage Credits
|
||||
|
||||
Source: https://docs.coingecko.com/reference/authentication
|
||||
|
||||
Authentication method for CoinGecko Pro API (Paid plan subscribers with Pro-API keys)
|
||||
|
||||
<Note>
|
||||
### **Notes**
|
||||
|
||||
* Pro API Key is only available for [CoinGecko API paid plan](https://www.coingecko.com/en/api/pricing) subscribers, the root URL for CoinGecko Pro API must be `https://pro-api.coingecko.com/api/v3/`.
|
||||
* You are recommended to store the API key securely in your own backend and use a proxy to insert the key into the request URL.
|
||||
* It's highly recommended to use the Headers method when making API requests for better security. Using query string parameters can risk exposing your API key.
|
||||
</Note>
|
||||
|
||||
## CoinGecko API Authentication Method
|
||||
|
||||
If this is your first time using the Pro API key, you can supply API Key to the root URL using one of these ways:
|
||||
|
||||
1. Header (Recommended): `x-cg-pro-api-key`
|
||||
2. Query String Parameter: `x_cg_pro_api_key`
|
||||
|
||||
| Authentication Method | Example using [Ping](/reference/ping-server) Endpoint |
|
||||
| ---------------------- | --------------------------------------------------------------------------------------------- |
|
||||
| Header (cURL) | `curl -X GET "https://pro-api.coingecko.com/api/v3/ping" -H "x-cg-pro-api-key: YOUR_API_KEY"` |
|
||||
| Query String Parameter | `https://pro-api.coingecko.com/api/v3/ping?x_cg_pro_api_key=YOUR_API_KEY` |
|
||||
|
||||
## 🔥 Accessing Onchain DEX data
|
||||
|
||||
You can now use the Pro-API key (exclusive to any paid plan subscriber) to call onchain DEX data powered by [GeckoTerminal](https://www.geckoterminal.com/).
|
||||
|
||||
<Note>
|
||||
### **Notes**
|
||||
|
||||
* Authentication method for onchain endpoints is exactly same as other endpoints.
|
||||
* When using the CG Pro API to access onchain DEX data, include the `/onchain` endpoint path in the request.
|
||||
</Note>
|
||||
|
||||
| Authentication Method | Example using [Simple Token Price](/reference/onchain-simple-price) Endpoint |
|
||||
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Header (cURL) | `curl -X GET "<https://pro-api.coingecko.com/api/v3/onchain/simple/networks/eth/token_price/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2>" -H "x-cg-pro-api-key: YOUR_API_KEY"` |
|
||||
| Query String Parameter | `https://pro-api.coingecko.com/api/v3/onchain/simple/networks/eth/token_price/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2?x_cg_pro_api_key=YOUR_API_KEY` |
|
||||
|
||||
## API Key Usage Credits
|
||||
|
||||
* Each request made to any endpoint counts as a single call (1 call = 1 credit).
|
||||
* Each successful API request (Status 200) will deduct 1 credit from your monthly credit allowance.
|
||||
* Unsuccessful Requests (Status 4xx, 5xx, etc) will not count towards credit deduction.
|
||||
* Regardless of the HTTP status code returned (including 4xx and 5xx errors), all API requests will count towards your **minute rate limit**.
|
||||
* Your monthly credit & rate limit are determined by the paid plan to which you subscribe. For more details, please refer to this [page](https://www.coingecko.com/en/api/pricing).
|
||||
* To check the API usage, please go to the [developer dashboard](https://www.coingecko.com/en/developers/dashboard) or follow the guide [here](/reference/setting-up-your-api-key#4-api-usage-report)
|
||||
|
||||
---
|
||||
|
||||
## Setting Up Your API Key
|
||||
|
||||
**URL:** llms-txt#setting-up-your-api-key
|
||||
|
||||
**Contents:**
|
||||
- 1. Creating a new API Key
|
||||
- 2. Making API Request
|
||||
- 3. Edit or Delete API Key
|
||||
- 4. API Usage Report
|
||||
- 5. Others
|
||||
- Call Consumption Alerts
|
||||
- Overage Option (Beta)
|
||||
|
||||
Source: https://docs.coingecko.com/docs/setting-up-your-api-key
|
||||
|
||||
👋 **New to CoinGecko API?** Sign up for an account [here](https://www.coingecko.com/en/api/pricing)
|
||||
|
||||
## 1. Creating a new API Key
|
||||
|
||||
* Once you have signed up and logged in to your CoinGecko account, go to [Developer Dashboard](https://www.coingecko.com/en/developers/dashboard):
|
||||
|
||||
<Frame>
|
||||
<img src="https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/d5fdca3-image.png?fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=01b58675fd1f038e4998877c0dde2cce" data-og-width="2535" width="2535" data-og-height="1454" height="1454" data-path="images/reference/d5fdca3-image.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/d5fdca3-image.png?w=280&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=73cd461df259d6584539d8fa4182e8c7 280w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/d5fdca3-image.png?w=560&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=b450ef8d7ff960560975cfbcf02c9cd8 560w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/d5fdca3-image.png?w=840&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=a712cb1278b923471296f9eff1a66bcb 840w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/d5fdca3-image.png?w=1100&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=ad1648c3f6875aad6a69b7d885545f9f 1100w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/d5fdca3-image.png?w=1650&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=bb4f72d8c718de14aa95dc77195b1b6f 1650w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/d5fdca3-image.png?w=2500&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=a04a90a2ac24c43094ed536a92d6c125 2500w" />
|
||||
</Frame>
|
||||
|
||||
* Click on **+ Add New Key** button to create a new API key:
|
||||
|
||||
<Frame>
|
||||
<img src="https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/0e2f30d-image.png?fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=49cf69a9b5ada9685301fe90281ec4ca" data-og-width="2380" width="2380" data-og-height="1695" height="1695" data-path="images/reference/0e2f30d-image.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/0e2f30d-image.png?w=280&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=dae015f221e2baf42b535213c492282d 280w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/0e2f30d-image.png?w=560&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=475c556a13a18691d600261b16f36c3f 560w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/0e2f30d-image.png?w=840&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=6c707c3bd727ef27a62a122c612f70af 840w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/0e2f30d-image.png?w=1100&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=e575c119ac20eddb902be7eba947e8e3 1100w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/0e2f30d-image.png?w=1650&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=6543d53ea75c2f201ea1bd9e03bec784 1650w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/0e2f30d-image.png?w=2500&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=ef098f326f88369b848b496374bb90b6 2500w" />
|
||||
</Frame>
|
||||
|
||||
## 2. Making API Request
|
||||
|
||||
* **Root URLs:**
|
||||
* Pro API: `https://pro-api.coingecko.com/api/v3/`, refer to [Pro API Authentication](/reference/authentication).
|
||||
* Demo API: `https://api.coingecko.com/api/v3/`, refer to [Demo API Authentication](/v3.0.1/reference/authentication).
|
||||
* **Example using the `/ping` endpoint:**
|
||||
|
||||
* Pro API: `https://pro-api.coingecko.com/api/v3/ping?x_cg_pro_api_key=YOUR_API_KEY`
|
||||
* Demo API: `https://api.coingecko.com/api/v3/ping?x_cg_demo_api_key=YOUR_API_KEY`
|
||||
|
||||
<Frame>
|
||||
<img src="https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/27ff800-image.png?fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=e3d99147f58fba36640e1bfe509349b1" data-og-width="1784" width="1784" data-og-height="604" height="604" data-path="images/reference/27ff800-image.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/27ff800-image.png?w=280&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=591078670f4f8bd13429f7fb18afaa90 280w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/27ff800-image.png?w=560&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=f5a27f6ae38522bb400bef3b620920ce 560w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/27ff800-image.png?w=840&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=a1aec54f1196f3f1b34f6f6124750fa7 840w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/27ff800-image.png?w=1100&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=c69aba5a0e5cd26d4789a231d168eb05 1100w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/27ff800-image.png?w=1650&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=ce2ee82a0be4d2b2595b5a356995c8d2 1650w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/27ff800-image.png?w=2500&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=cf0d9441cf738541947802398d367d65 2500w" />
|
||||
</Frame>
|
||||
|
||||
## 3. Edit or Delete API Key
|
||||
|
||||
* Go to Developer's Dashboard and click “Edit” button on a specific API Key.
|
||||
* In case the API Key is compromised, you may delete the API Key by clicking the "Delete" button.
|
||||
* You may also update the label and save the changes by clicking "Save" button.
|
||||
|
||||
<Frame>
|
||||
<img src="https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/cf29b58-image.png?fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=106da6dd2c0954fdac0b343222bd47d0" data-og-width="2372" width="2372" data-og-height="1054" height="1054" data-path="images/reference/cf29b58-image.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/cf29b58-image.png?w=280&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=34459564277bfa0cad6f5a700ecf8eb3 280w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/cf29b58-image.png?w=560&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=54225845278952d0a07ccec89b21b045 560w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/cf29b58-image.png?w=840&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=4504c5e87fc757c04537e3684ee675af 840w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/cf29b58-image.png?w=1100&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=8b2e7beb62498611215c9380911729e2 1100w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/cf29b58-image.png?w=1650&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=785b9d021240f872e1c5e94253ec59c0 1650w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/cf29b58-image.png?w=2500&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=d595ad19992b79691106f91ff2ef035c 2500w" />
|
||||
</Frame>
|
||||
|
||||
## 4. API Usage Report
|
||||
|
||||
* You can monitor your API usage in the Usage Report section, which provides details such as:
|
||||
|
||||
* Total Monthly API Calls.
|
||||
* Remaining Monthly API Calls.
|
||||
* Rate Limit (Request Per Minute) — maximum number of API requests allowed in one minute.
|
||||
* Last Used — the timestamp of the last used instance.
|
||||
|
||||
<Frame>
|
||||
<img src="https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/c436404-image.png?fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=731ada28dc58aa21345e3ad74f79638a" data-og-width="2373" width="2373" data-og-height="1047" height="1047" data-path="images/reference/c436404-image.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/c436404-image.png?w=280&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=2f15435343b765ff33590235b98bb9ab 280w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/c436404-image.png?w=560&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=844e00763035fb01d9b6daed2db54c1d 560w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/c436404-image.png?w=840&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=8e2d5ed4c8da42f24554c97051e92d86 840w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/c436404-image.png?w=1100&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=ba78440ee678f4accc817e389c1b8928 1100w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/c436404-image.png?w=1650&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=403f14e82c4670b20f1440aa482d18c9 1650w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/c436404-image.png?w=2500&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=994b3e54b5d7d9327c4a23e6a28f6088 2500w" />
|
||||
</Frame>
|
||||
|
||||
* You can also check your full historical usage by specifying "API Keys", "timeframe" or "date range". You may export as CSV for more comprehensive view.
|
||||
|
||||
<Frame>
|
||||
<img src="https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/ed3143e-image.png?fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=fdebb203ab2f8c54dd4d2b57188131e6" data-og-width="2108" width="2108" data-og-height="1328" height="1328" data-path="images/reference/ed3143e-image.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/ed3143e-image.png?w=280&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=c396c9240b947a2380f40b4abf463208 280w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/ed3143e-image.png?w=560&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=8fc0778d14dad543359ee1f5e484ab2b 560w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/ed3143e-image.png?w=840&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=930dac6d510ce69c0261298b752c21c3 840w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/ed3143e-image.png?w=1100&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=9d617276ba1552ba5053377231c0205c 1100w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/ed3143e-image.png?w=1650&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=b14b89d98e4426e80e8d85b73702f954 1650w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/ed3143e-image.png?w=2500&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=752bf481dc327a547568d4701cd5e531 2500w" />
|
||||
</Frame>
|
||||
|
||||
### Call Consumption Alerts
|
||||
|
||||
You may enable or disable call consumption alerts in the tab below to receive emails when specific credit usage thresholds are reached.
|
||||
|
||||
<Frame>
|
||||
<img src="https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/752e839-image.png?fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=0152d66e48fe99fe40f6738f1b9a196c" data-og-width="2112" width="2112" data-og-height="1044" height="1044" data-path="images/reference/752e839-image.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/752e839-image.png?w=280&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=7c1eb5850e0ed72d674e76be142a2e05 280w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/752e839-image.png?w=560&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=64e6884c71f6e9514b1a76fffccbc3ee 560w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/752e839-image.png?w=840&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=bec801fac3b85f6cfa6b662ae626eab3 840w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/752e839-image.png?w=1100&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=d7b15b7e7df828c7872fa2a523138473 1100w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/752e839-image.png?w=1650&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=4787aae81682669a51ce54dd9d830941 1650w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/752e839-image.png?w=2500&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=09437ce25f2f9d9c42018967537b0d13 2500w" />
|
||||
</Frame>
|
||||
|
||||
### Overage Option (Beta)
|
||||
|
||||
* The overage option enables you to make API calls when your usage exceeds the monthly credits.
|
||||
* You can activate the overage option by clicking the "Turn On Overage" button, ensuring uninterrupted service and allowing you to continue making API calls or vice versa.
|
||||
|
||||
<Frame>
|
||||
<img src="https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/b4711e6-image.png?fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=6d293516eea9798436bd1a28fcf55cd8" data-og-width="2218" width="2218" data-og-height="1074" height="1074" data-path="images/reference/b4711e6-image.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/b4711e6-image.png?w=280&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=3fc7358d6a4b47e0ac5b9ab1170731ea 280w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/b4711e6-image.png?w=560&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=50aac137f52b5c6d3ff3c0dfbcf440ed 560w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/b4711e6-image.png?w=840&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=5c0a29a1fb4d1a16e588c2ab1d7725df 840w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/b4711e6-image.png?w=1100&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=96aab6a665b736e7eff55b04f2202346 1100w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/b4711e6-image.png?w=1650&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=56b3971e1aaa69dc6ed99ee745fe6f7a 1650w, https://mintcdn.com/coingecko/a7cplMjqO5fc2v5e/images/reference/b4711e6-image.png?w=2500&fit=max&auto=format&n=a7cplMjqO5fc2v5e&q=85&s=a090e24c154fffcc39f4fc8c069840bb 2500w" />
|
||||
</Frame>
|
||||
|
||||
---
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,23 @@
|
||||
# Coingecko - Contract
|
||||
|
||||
**Pages:** 1
|
||||
|
||||
---
|
||||
|
||||
## NFTs Collection Data by Contract Address
|
||||
|
||||
**URL:** llms-txt#nfts-collection-data-by-contract-address
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/nfts-contract-address
|
||||
|
||||
v3.0.1/reference/api-reference/coingecko-demo.json get /nfts/{asset_platform_id}/contract/{contract_address}
|
||||
This endpoint allows you to **query all the NFT data (name, floor price, 24hr volume ...) based on the NFT collection contract address and respective asset platform**
|
||||
|
||||
* You may also obtain the asset platform id and contract address through [/nfts/list](/v3.0.1/reference/nfts-list) endpoint.
|
||||
</Tip>
|
||||
|
||||
* Solana NFT & Art Blocks are not supported for this endpoint, please use [/nfts/\{id}](/v3.0.1/reference/nfts-id) endpoint instead.
|
||||
* Cache / Update Frequency: every 60 seconds for all the API plans.
|
||||
</Note>
|
||||
|
||||
---
|
||||
@@ -0,0 +1,259 @@
|
||||
# Coingecko - Exchanges
|
||||
|
||||
**Pages:** 14
|
||||
|
||||
---
|
||||
|
||||
## Exchange Volume Chart by ID
|
||||
|
||||
**URL:** llms-txt#exchange-volume-chart-by-id
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/exchanges-id-volume-chart
|
||||
|
||||
v3.0.1/reference/api-reference/coingecko-demo.json get /exchanges/{id}/volume_chart
|
||||
This endpoint allows you to **query the historical volume chart data with time in UNIX and trading volume data in BTC based on exchange's ID**
|
||||
|
||||
* You can use this endpoint to query the historical volume chart data of **derivatives exchanges** as well.
|
||||
* The exchange volume in the response is provided in BTC. To convert it to other currencies, please use [/exchange\_rates](/v3.0.1/reference/exchange-rates) endpoint.
|
||||
* Data granularity is automatic (cannot be adjusted):
|
||||
* 1 day = 10-minutely
|
||||
* 7, 14 days = hourly
|
||||
* 30 days & above = daily
|
||||
* Cache / Update Frequency: every 60 seconds for all the API plans.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## Derivatives Tickers List
|
||||
|
||||
**URL:** llms-txt#derivatives-tickers-list
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/derivatives-tickers
|
||||
|
||||
v3.0.1/reference/api-reference/coingecko-demo.json get /derivatives
|
||||
This endpoint allows you to **query all the tickers from derivatives exchanges on CoinGecko**
|
||||
|
||||
* Data for `open_interest` and `volume_24h` in the endpoint responses are in USD.
|
||||
* Cache / Update Frequency: every 30 seconds for all the API plans.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## 💼 Exchange Volume Chart within Time Range by ID
|
||||
|
||||
**URL:** llms-txt#💼-exchange-volume-chart-within-time-range-by-id
|
||||
|
||||
Source: https://docs.coingecko.com/reference/exchanges-id-volume-chart-range
|
||||
|
||||
reference/api-reference/coingecko-pro.json get /exchanges/{id}/volume_chart/range
|
||||
This endpoint allows you to **query the historical volume chart data in BTC by specifying date range in UNIX based on exchange's ID**
|
||||
|
||||
* You can query the historical volume chart data of **derivatives exchanges** with this endpoint as well.
|
||||
* The data interval for this endpoint is fixed at daily.
|
||||
* The date range between `from` and `to` must be within 31 days.
|
||||
* Cache/Update Frequency: 5 minutes
|
||||
* Exclusive for Paid Plan Subscribers (Analyst, Lite, Pro and Enterprise)
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## Derivatives Exchange Data by ID
|
||||
|
||||
**URL:** llms-txt#derivatives-exchange-data-by-id
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/derivatives-exchanges-id
|
||||
|
||||
v3.0.1/reference/api-reference/coingecko-demo.json get /derivatives/exchanges/{id}
|
||||
This endpoint allows you to **query the derivatives exchange's related data (ID, name, open interest, ...) based on the exchanges' ID**
|
||||
|
||||
* For `include_tickers` param, you may change the value to either `all` to include all the tickers or `unexpired` to include unexpired tickers in the responses. You may leave it blank to omit the tickers data.
|
||||
</Tip>
|
||||
|
||||
* Cache / Update Frequency: every 30 seconds for all the API plans.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## Supported Dexes List by Network (ID Map)
|
||||
|
||||
**URL:** llms-txt#supported-dexes-list-by-network-(id-map)
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/dexes-list
|
||||
|
||||
v3.0.1/reference/api-reference/onchain-demo.json get /networks/{network}/dexes
|
||||
This endpoint allows you to **query all the supported decentralized exchanges (DEXs) based on the provided network on GeckoTerminal**
|
||||
|
||||
* You may use this endpoint to query the list of DEXs with DEX ID for other endpoints that contain params like `dex`.
|
||||
* You may include values such as `page` to specify which page of responses you would like to show.
|
||||
</Tip>
|
||||
|
||||
---
|
||||
|
||||
## Exchanges List with data
|
||||
|
||||
**URL:** llms-txt#exchanges-list-with-data
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/exchanges
|
||||
|
||||
v3.0.1/reference/api-reference/coingecko-demo.json get /exchanges
|
||||
This endpoint allows you to **query all the supported exchanges with exchanges' data (ID, name, country, ...) that have active trading volumes on CoinGecko**
|
||||
|
||||
* You may include values such as `per_page` and `page` to specify how many results you would like to show in the responses per page and which page of responses you would like to show.
|
||||
</Tip>
|
||||
|
||||
* All the exchanges in the responses are the exchanges with active trading volume on CoinGecko, any inactive or deactivated exchanges will be removed from the list.
|
||||
* Cache / Update Frequency: every 60 seconds for all the API plans.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## Derivatives Exchanges List with Data
|
||||
|
||||
**URL:** llms-txt#derivatives-exchanges-list-with-data
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/derivatives-exchanges
|
||||
|
||||
v3.0.1/reference/api-reference/coingecko-demo.json get /derivatives/exchanges
|
||||
This endpoint allows you to **query all the derivatives exchanges with related data (ID, name, open interest, ...) on CoinGecko**
|
||||
|
||||
* You may include values such as `per_page` and `page` to specify how many results you would like to show in the responses per page and which page of responses you would like to show.
|
||||
</Tip>
|
||||
|
||||
* Cache / Update Frequency: every 60 seconds for all the API plans.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## Exchanges List (ID Map)
|
||||
|
||||
**URL:** llms-txt#exchanges-list-(id-map)
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/exchanges-list
|
||||
|
||||
v3.0.1/reference/api-reference/coingecko-demo.json get /exchanges/list
|
||||
This endpoint allows you to **query all the exchanges with ID and name**
|
||||
|
||||
* You may use this endpoint to query the list of exchanges including **derivatives exchanges** for other endpoints that contain params like `id`(exchange ID).
|
||||
</Tip>
|
||||
|
||||
* There is no pagination required for this endpoint.
|
||||
* Cache / Update Frequency: every 5 minutes for all the API plans.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## 💼 Global Market Cap Chart Data
|
||||
|
||||
**URL:** llms-txt#💼-global-market-cap-chart-data
|
||||
|
||||
Source: https://docs.coingecko.com/reference/global-market-cap-chart
|
||||
|
||||
reference/api-reference/coingecko-pro.json get /global/market_cap_chart
|
||||
This endpoint allows you to **query historical global market cap and volume data by number of days away from now**
|
||||
|
||||
* CoinGecko equivalent page: [https://www.coingecko.com/en/global-charts](https://www.coingecko.com/en/global-charts).
|
||||
* Data Granularity (auto):
|
||||
* 1 day from now = **hourly** data
|
||||
* 2 days & above from now = **daily** data
|
||||
* Exclusive for all Paid Plan Subscribers (Analyst, Lite, Pro and Enterprise).
|
||||
* The last completed UTC day (00:00) is available 5 minutes after midnight on the next UTC day (00:05). The cache will **always expire at 00:05 UTC**. If you wish to get the latest daily data (00:00 UTC), you can make request at 00:05 UTC or later.
|
||||
* Cache / Update Frequency: every 1 minute.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## 💼 NFTs List with Market Data
|
||||
|
||||
**URL:** llms-txt#💼-nfts-list-with-market-data
|
||||
|
||||
Source: https://docs.coingecko.com/reference/nfts-markets
|
||||
|
||||
reference/api-reference/coingecko-pro.json get /nfts/markets
|
||||
This endpoint allows you to **query all the supported NFT collections with floor price, market cap, volume and market related data on CoinGecko**
|
||||
|
||||
* You may include values such as `per_page` and `page` to specify how many results you would like to show in the responses per page and which page of responses you would like to show.
|
||||
</Tip>
|
||||
|
||||
* Cache / Update Frequency: every 5 minutes.
|
||||
* Exclusive for Paid Plan Subscribers (Analyst, Lite, Pro and Enterprise).
|
||||
* CoinGecko equivalent page: [https://www.coingecko.com/en/nft](https://www.coingecko.com/en/nft).
|
||||
* Some collection with low liquidity may not be ranked by Market Cap value, learn more [here](https://support.coingecko.com/hc/en-us/articles/37226121227545-What-is-NFT-Market-Cap). Sorting by Mcap ranking will first prioritise Market Cap value of liquid NFT collections, then followed by trading volume of illiquid NFT collections.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## Exchange Tickers by ID
|
||||
|
||||
**URL:** llms-txt#exchange-tickers-by-id
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/exchanges-id-tickers
|
||||
|
||||
v3.0.1/reference/api-reference/coingecko-demo.json get /exchanges/{id}/tickers
|
||||
This endpoint allows you to **query exchange's tickers based on exchange's ID**
|
||||
|
||||
* Responses are paginated and limited to 100 tickers per page. You may specify the page number using the `page` params to retrieve the tickers accordingly.
|
||||
* `order=base_target` sorts tickers by `base` symbol, then `target` symbol, in lexicographical order (`0 -> 9`, followed by `a -> z`).\
|
||||
This sorting method ensures stable pagination results, minimizing cases where cached responses might otherwise cause duplicate or missing tickers across paginated pages.
|
||||
* When `dex_pair_format=symbol`, the DEX pair `base` and `target` are displayed in symbol format (e.g. `WETH`, `USDC`) instead of as contract addresses.
|
||||
* Cache / Update Frequency: every 60 seconds for all the API plans.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## BTC-to-Currency Exchange Rates
|
||||
|
||||
**URL:** llms-txt#btc-to-currency-exchange-rates
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/exchange-rates
|
||||
|
||||
v3.0.1/reference/api-reference/coingecko-demo.json get /exchange_rates
|
||||
This endpoint allows you to **query BTC exchange rates with other currencies**
|
||||
|
||||
* You may use this endpoint to convert the response data, which is originally in BTC, to other currencies.
|
||||
</Tip>
|
||||
|
||||
* Cache / Update Frequency: every 5 minutes for all the API plans.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## Exchange Data by ID
|
||||
|
||||
**URL:** llms-txt#exchange-data-by-id
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/exchanges-id
|
||||
|
||||
v3.0.1/reference/api-reference/coingecko-demo.json get /exchanges/{id}
|
||||
This endpoint allows you to **query exchange's data (name, year established, country, ...), exchange volume in BTC and top 100 tickers based on exchange's ID**
|
||||
|
||||
<Warning>
|
||||
### Notice
|
||||
|
||||
* Please note that the `trade_volume_24h_btc_normalized` data field will no longer be supported by our API starting on June 15, 2025. Please refer to [changelog](/changelog#may-2025) for more details.
|
||||
</Warning>
|
||||
|
||||
* The exchange volume in the response is provided in BTC. To convert it to other currencies, please use [/exchange\_rates](/v3.0.1/reference/exchange-rates) endpoint.
|
||||
* For derivatives (e.g. bitmex, binance\_futures), to get derivatives exchanges data, please go to [/derivatives/exchange/\{id}](/v3.0.1/reference/derivatives-exchanges-id) endpoint.
|
||||
* Tickers are limited to 100 items, to get more tickers, please go to [/exchanges/\{id}/tickers](/v3.0.1/reference/exchanges-id-tickers) endpoint.
|
||||
* When `dex_pair_format=symbol`, the DEX pair `base` and `target` are displayed in symbol format (e.g. `WETH`, `USDC`) instead of as contract addresses.
|
||||
* Cache / Update Frequency: every 60 seconds for all the API plans.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## Derivatives Exchanges List (ID Map)
|
||||
|
||||
**URL:** llms-txt#derivatives-exchanges-list-(id-map)
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/derivatives-exchanges-list
|
||||
|
||||
v3.0.1/reference/api-reference/coingecko-demo.json get /derivatives/exchanges/list
|
||||
This endpoint allows you to **query all the derivatives exchanges with ID and name on CoinGecko**
|
||||
|
||||
* You may use this endpoint to query the list of exchanges for other endpoints that contain params like `id` (derivatives exchange's ID)
|
||||
</Tip>
|
||||
|
||||
* Cache / Update Frequency: every 5 minutes for all the API plans.
|
||||
</Note>
|
||||
|
||||
---
|
||||
@@ -0,0 +1,47 @@
|
||||
# Coingecko Documentation Index
|
||||
|
||||
## Categories
|
||||
|
||||
### Authentication
|
||||
**File:** `authentication.md`
|
||||
**Pages:** 3
|
||||
|
||||
### Coins
|
||||
**File:** `coins.md`
|
||||
**Pages:** 65
|
||||
|
||||
### Contract
|
||||
**File:** `contract.md`
|
||||
**Pages:** 1
|
||||
|
||||
### Exchanges
|
||||
**File:** `exchanges.md`
|
||||
**Pages:** 14
|
||||
|
||||
### Introduction
|
||||
**File:** `introduction.md`
|
||||
**Pages:** 4
|
||||
|
||||
### Market Data
|
||||
**File:** `market_data.md`
|
||||
**Pages:** 3
|
||||
|
||||
### Nfts
|
||||
**File:** `nfts.md`
|
||||
**Pages:** 2
|
||||
|
||||
### Other
|
||||
**File:** `other.md`
|
||||
**Pages:** 16
|
||||
|
||||
### Pricing
|
||||
**File:** `pricing.md`
|
||||
**Pages:** 1
|
||||
|
||||
### Reference
|
||||
**File:** `reference.md`
|
||||
**Pages:** 9
|
||||
|
||||
### Trending
|
||||
**File:** `trending.md`
|
||||
**Pages:** 2
|
||||
@@ -0,0 +1,392 @@
|
||||
# Coingecko - Introduction
|
||||
|
||||
**Pages:** 4
|
||||
|
||||
---
|
||||
|
||||
## 🔥 Getting Started
|
||||
|
||||
**URL:** llms-txt#🔥-getting-started
|
||||
|
||||
**Contents:**
|
||||
- Which MCP Server Should You Use?
|
||||
- 🔗 Endpoint Options
|
||||
- Primary Endpoint (HTTP Streaming)
|
||||
- Alternative Endpoint (SSE — Server-Sent Events)
|
||||
- Remote Server (Public, Keyless)
|
||||
- Remote Server (Authenticated)
|
||||
- Step 1: Add the configuration
|
||||
- Step 2: Authorize your MCP access
|
||||
- Local Server (API Key Required)
|
||||
|
||||
Connecting your AI to CoinGecko is simple. We offer several MCP server options to fit your needs, from keyless access for testing to authenticated connections for production applications.
|
||||
|
||||
Most MCP-compatible clients, like Claude Desktop, Gemini CLI, and Cursor, can be configured using a simple JSON file (e.g., `claude_desktop_config.json`)
|
||||
|
||||
<Note>
|
||||
### Prerequisites
|
||||
|
||||
* Make sure your device has `node` installed. You can download it from [nodejs.org/download](https://nodejs.org/en/download)
|
||||
</Note>
|
||||
|
||||
## Which MCP Server Should You Use?
|
||||
|
||||
Here's a breakdown of the available options to help you choose the right one:
|
||||
|
||||
| MCP Server Type | Best For | Endpoints | Status | Setup Details |
|
||||
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- | ----------- | ----------------------------------------------------------------------------- |
|
||||
| Remote Server (Public, Keyless) | - First-time users, quick tests, and basic queries<br />- Connect instantly without any registration<br />- Subject to shared rate limits, not for heavy use | Primary: `/mcp`<br />Alternative: `/sse` | Public Beta | [mcp.api.coingecko.com](https://mcp.api.coingecko.com/) |
|
||||
| Remote Server (Authenticated) | - Scalable apps, AI agent integrations<br />- Unlocks 76+ tools available under your Demo/Pro plan<br />- Higher, reliable rate limits with 24/7 uptime. Get your API key [here](https://www.coingecko.com/en/api/pricing) | Primary: `/mcp`<br />Alternative: `/sse` | Public Beta | [mcp.pro-api.coingecko.com](https://mcp.pro-api.coingecko.com/) |
|
||||
| Local Server | - Ideal for local development, desktop AI apps<br />- Build/test your AI app even without an active internet connection<br />- Demo/Pro API key to access more tools. Get your API key [here](https://www.coingecko.com/en/api/pricing) | Local server instance | Beta | [npmjs/coingecko-mcp](https://www.npmjs.com/package/@coingecko/coingecko-mcp) |
|
||||
|
||||
## 🔗 Endpoint Options
|
||||
|
||||
Each remote server offers two connection methods to ensure compatibility with various MCP clients:
|
||||
|
||||
### Primary Endpoint (HTTP Streaming)
|
||||
|
||||
* **Public Server**: `https://mcp.api.coingecko.com/mcp`
|
||||
* **Pro Server**: `https://mcp.pro-api.coingecko.com/mcp`
|
||||
* Uses HTTP streaming protocol for real-time data transfer.
|
||||
* Recommended for most modern MCP clients.
|
||||
|
||||
### Alternative Endpoint (SSE — Server-Sent Events)
|
||||
|
||||
* **Public Server**: `https://mcp.api.coingecko.com/sse`
|
||||
* **Pro Server**: `https://mcp.pro-api.coingecko.com/sse`
|
||||
* Uses Server-Sent Events for compatibility.
|
||||
* Use this if you encounter connection issues with the primary endpoint.
|
||||
|
||||
<Note>
|
||||
Most clients work with either endpoint. The configuration examples below use the SSE endpoint by default for maximum compatibility.
|
||||
</Note>
|
||||
|
||||
## Remote Server (Public, Keyless)
|
||||
|
||||
The easiest way to get started. Just add the following to your client's `mcp_config.json` file.
|
||||
|
||||
<Note>
|
||||
### Client-Specific Config
|
||||
|
||||
The file name and location depend on your client. Find your config file here: [modelcontextprotocol.io/quickstart](https://modelcontextprotocol.io/quickstart/user#2-add-the-filesystem-mcp-server)
|
||||
</Note>
|
||||
|
||||
Add the following configuration to your `mcp_config.json`:
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
Here's a quick 2-minute tutorial for setting up the public server with Claude Desktop:
|
||||
|
||||
<iframe className="w-full aspect-video rounded-xl" src="https://www.youtube.com/embed/PDYJvtKok0E" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />
|
||||
|
||||
## Remote Server (Authenticated)
|
||||
|
||||
To access more tools and higher rate limits, use your CoinGecko API key with our hosted "Bring Your Own Key" (BYOK) server. Get your API key [here](https://www.coingecko.com/en/api/pricing)
|
||||
|
||||
### Step 1: Add the configuration
|
||||
|
||||
Add the following configuration to your `mcp_config.json`:
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
### Step 2: Authorize your MCP access
|
||||
|
||||
After adding the config, the first time your client tries to use the CoinGecko MCP, a new browser tab will open, redirecting you to our authentication page:
|
||||
|
||||
<img src="https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/0fd54e7-image.png?fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=c40d3876ad3b12c0c3177231e8642bf7" alt="" data-og-width="1627" width="1627" data-og-height="1611" height="1611" data-path="images/reference/0fd54e7-image.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/0fd54e7-image.png?w=280&fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=b44038862f84320e55096acf29d704ab 280w, https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/0fd54e7-image.png?w=560&fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=d7518c452993e3c2191de720716fc28a 560w, https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/0fd54e7-image.png?w=840&fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=f4e361fa7c96759e52cf23b245e44bfc 840w, https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/0fd54e7-image.png?w=1100&fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=41d3e848470a50259a8aabd2f11f879d 1100w, https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/0fd54e7-image.png?w=1650&fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=4767ab92447bc5ba7a7f1ed2994945ea 1650w, https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/0fd54e7-image.png?w=2500&fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=686d5177b5697a4561eae0f10f157694 2500w" />
|
||||
|
||||
* Simply paste in your CoinGecko API key, and authorize to link your key to the MCP session.
|
||||
|
||||
✨ Don't have an API key yet? Upgrade to Pro today! Read more [here](https://www.coingecko.com/en/api/pricing).
|
||||
|
||||
* You can also toggle between dynamic/static tools here. Learn more about [Dynamic Tools](#dynamic-vs-static-tools).
|
||||
|
||||
## Local Server (API Key Required)
|
||||
|
||||
For local development and maximum control, run the MCP server directly on your machine. This method offers the rate limits based on your API plan.
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
✨ Don't have an API key yet? Get your free Demo key or upgrade to Pro! Read more [here](https://www.coingecko.com/en/api/pricing).
|
||||
|
||||
* Configure the `env` based on your API key tier:
|
||||
|
||||
* Pro API access:
|
||||
<CodeGroup>
|
||||
|
||||
</CodeGroup>
|
||||
* Demo API access:
|
||||
<CodeGroup>
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
**Examples:**
|
||||
|
||||
Example 1 (unknown):
|
||||
```unknown
|
||||
</CodeGroup>
|
||||
|
||||
Here's a quick 2-minute tutorial for setting up the public server with Claude Desktop:
|
||||
|
||||
<iframe className="w-full aspect-video rounded-xl" src="https://www.youtube.com/embed/PDYJvtKok0E" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />
|
||||
|
||||
## Remote Server (Authenticated)
|
||||
|
||||
To access more tools and higher rate limits, use your CoinGecko API key with our hosted "Bring Your Own Key" (BYOK) server. Get your API key [here](https://www.coingecko.com/en/api/pricing)
|
||||
|
||||
### Step 1: Add the configuration
|
||||
|
||||
Add the following configuration to your `mcp_config.json`:
|
||||
|
||||
<CodeGroup>
|
||||
```
|
||||
|
||||
Example 2 (unknown):
|
||||
```unknown
|
||||
</CodeGroup>
|
||||
|
||||
### Step 2: Authorize your MCP access
|
||||
|
||||
After adding the config, the first time your client tries to use the CoinGecko MCP, a new browser tab will open, redirecting you to our authentication page:
|
||||
|
||||
<img src="https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/0fd54e7-image.png?fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=c40d3876ad3b12c0c3177231e8642bf7" alt="" data-og-width="1627" width="1627" data-og-height="1611" height="1611" data-path="images/reference/0fd54e7-image.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/0fd54e7-image.png?w=280&fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=b44038862f84320e55096acf29d704ab 280w, https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/0fd54e7-image.png?w=560&fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=d7518c452993e3c2191de720716fc28a 560w, https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/0fd54e7-image.png?w=840&fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=f4e361fa7c96759e52cf23b245e44bfc 840w, https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/0fd54e7-image.png?w=1100&fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=41d3e848470a50259a8aabd2f11f879d 1100w, https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/0fd54e7-image.png?w=1650&fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=4767ab92447bc5ba7a7f1ed2994945ea 1650w, https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/0fd54e7-image.png?w=2500&fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=686d5177b5697a4561eae0f10f157694 2500w" />
|
||||
|
||||
* Simply paste in your CoinGecko API key, and authorize to link your key to the MCP session.
|
||||
|
||||
✨ Don't have an API key yet? Upgrade to Pro today! Read more [here](https://www.coingecko.com/en/api/pricing).
|
||||
|
||||
* You can also toggle between dynamic/static tools here. Learn more about [Dynamic Tools](#dynamic-vs-static-tools).
|
||||
|
||||
## Local Server (API Key Required)
|
||||
|
||||
For local development and maximum control, run the MCP server directly on your machine. This method offers the rate limits based on your API plan.
|
||||
|
||||
<CodeGroup>
|
||||
```
|
||||
|
||||
Example 3 (unknown):
|
||||
```unknown
|
||||
</CodeGroup>
|
||||
|
||||
✨ Don't have an API key yet? Get your free Demo key or upgrade to Pro! Read more [here](https://www.coingecko.com/en/api/pricing).
|
||||
|
||||
* Configure the `env` based on your API key tier:
|
||||
|
||||
* Pro API access:
|
||||
<CodeGroup>
|
||||
```
|
||||
|
||||
Example 4 (unknown):
|
||||
```unknown
|
||||
</CodeGroup>
|
||||
* Demo API access:
|
||||
<CodeGroup>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Endpoint Overview
|
||||
|
||||
**URL:** llms-txt#endpoint-overview
|
||||
|
||||
**Contents:**
|
||||
- CoinGecko Endpoints: Coins
|
||||
- CoinGecko Endpoints: NFT
|
||||
- CoinGecko Endpoints: Exchanges & Derivatives
|
||||
- CoinGecko Endpoints: Public Treasuries
|
||||
- CoinGecko Endpoints: General
|
||||
- Onchain DEX Endpoints (GeckoTerminal)
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/endpoint-overview
|
||||
|
||||
Any exclusive endpoints for Pro-API users (any paid plan subscribers) will not be included here.
|
||||
|
||||
For a full list of endpoints, please visit [Pro API Documentation](/reference/endpoint-overview) instead.
|
||||
</Note>
|
||||
|
||||
## CoinGecko Endpoints: Coins
|
||||
|
||||
| Endpoint | Description |
|
||||
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [/ping](/v3.0.1/reference/ping-server) | Check the API server status |
|
||||
| [/simple/price](/v3.0.1/reference/simple-price) | Query the prices of one or more coins by using their unique Coin API IDs |
|
||||
| [/simple/token\_price/\{id}](/v3.0.1/reference/simple-token-price) | Query the prices of one or more coins by using their unique Coin API IDs |
|
||||
| [/simple/supported\_vs\_currencies](/v3.0.1/reference/simple-supported-currencies) | Query all the supported currencies on CoinGecko |
|
||||
| [/coins/list](/v3.0.1/reference/coins-list) | Query all the supported coins on CoinGecko with coins ID, name and symbol |
|
||||
| [/coins/markets](/v3.0.1/reference/coins-markets) | Query all the supported coins with price, market cap, volume and market related data |
|
||||
| [/coins/\{id}](/v3.0.1/reference/coins-id) | Query all the metadata (image, websites, socials, description, contract address, etc.) from the CoinGecko coin page based on a particular coin ID |
|
||||
| [/coins/\{id}/tickers](/v3.0.1/reference/coins-id-tickers) | Query the coin tickers on both centralized exchange (CEX) and decentralized exchange (DEX) based on a particular coin ID |
|
||||
| [/coins/\{id}/history](/v3.0.1/reference/coins-id-history) | Query the historical data (price, market cap, 24hr volume, ...) at a given date for a coin based on a particular coin ID |
|
||||
| [/coins/\{id}/market\_chart](/v3.0.1/reference/coins-id-market-chart) | Get the historical chart data of a coin including time in UNIX, price, market cap and 24hr volume based on particular coin ID |
|
||||
| [/coins/\{id}/market\_chart/range](/v3.0.1/reference/coins-id-market-chart-range) | Get the historical chart data of a coin within certain time range in UNIX along with price, market cap and 24hr volume based on particular coin ID |
|
||||
| [/coins-id-ohlc](/v3.0.1/reference/coins-id-ohlc) | Get the OHLC chart (Open, High, Low, Close) of a coin based on particular coin ID |
|
||||
| [/coins/../contract/..](/v3.0.1/reference/coins-contract-address) | Query all the metadata (image, websites, socials, description, contract address, etc.) from the CoinGecko coin page based on an asset platform and a particular token contract address |
|
||||
| [/coins/../contract/../market\_chart](/v3.0.1/reference/contract-address-market-chart) | Get the historical chart data including time in UNIX, price, market cap and 24hr volume based on asset platform and particular token contract address |
|
||||
| [/coins/../contract/../market\_chart/range](/v3.0.1/reference/contract-address-market-chart-range) | Get the historical chart data within certain time range in UNIX along with price, market cap and 24hr volume based on asset platform and particular token contract address |
|
||||
| [/coins/categories/list](/v3.0.1/reference/coins-categories-list) | Query all the coins categories on CoinGecko |
|
||||
| [/coins/categories](/v3.0.1/reference/coins-categories) | Query all the coins categories with market data (market cap, volume, ...) on CoinGecko |
|
||||
|
||||
## CoinGecko Endpoints: NFT
|
||||
|
||||
| Endpoint | Description |
|
||||
| --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [/nfts/list](/v3.0.1/reference/nfts-list) | Query all supported NFTs with ID, contract address, name, asset platform ID and symbol on CoinGecko |
|
||||
| [/nfts/..](/v3.0.1/reference/nfts-id) | Query all the NFT data (name, floor price, 24hr volume, ...) based on the NFT collection ID |
|
||||
| [/nfts/../contract/..](/v3.0.1/reference/nfts-contract-address) | Query all the NFT data (name, floor price, 24hr volume, ...) based on the NFT collection contract address and respective asset platform |
|
||||
|
||||
## CoinGecko Endpoints: Exchanges & Derivatives
|
||||
|
||||
| Endpoint | Description |
|
||||
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [/exchanges](/v3.0.1/reference/exchanges) | Query all the supported exchanges with exchanges' data (ID, name, country, ...) that have active trading volumes on CoinGecko |
|
||||
| [/exchanges/list](/v3.0.1/reference/exchanges-list) | Query all the exchanges with ID and name |
|
||||
| [/exchanges/\{id}](/v3.0.1/reference/exchanges-id) | Query exchange's data (name, year established, country, ...), exchange volume in BTC and tickers based on exchange's ID |
|
||||
| [/exchanges/\{id}/tickers](/v3.0.1/reference/exchanges-id-tickers) | Query exchange's tickers based on exchange's ID |
|
||||
| [/exchanges/\{id}/volume\_chart](/v3.0.1/reference/exchanges-id-volume-chart) | Query the historical volume chart data with time in UNIX and trading volume data in BTC based on exchange's ID |
|
||||
| [/derivatives](/v3.0.1/reference/derivatives-tickers) | Query all the tickers from derivatives exchanges on CoinGecko |
|
||||
| [/derivatives/exchanges](/v3.0.1/reference/derivatives-exchanges) | Query all the derivatives exchanges with related data (ID, name, open interest, ...) on CoinGecko |
|
||||
| [/derivatives/exchanges/\{id}](/v3.0.1/reference/derivatives-exchanges-id) | Query the derivatives exchange's related data (ID, name, open interest, ...) based on the exchanges' ID |
|
||||
| [/derivatives/exchanges/list](/v3.0.1/reference/derivatives-exchanges-list) | Query all the derivatives exchanges with ID and name on CoinGecko |
|
||||
|
||||
## CoinGecko Endpoints: Public Treasuries
|
||||
|
||||
| Endpoint | Description |
|
||||
| ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
||||
| [/\{entity}/public\_treasury/\{coin\_id}](/reference/companies-public-treasury) | Query public companies & governments' cryptocurrency holdings by coin ID |
|
||||
| [/public\_treasury/\{entity\_id}](/reference/public-treasury-entity) | Query public companies & governments' cryptocurrency holdings by entity ID |
|
||||
| [/entities/list](/reference/entities-list) | Query all the supported entities on CoinGecko with entities ID, name, symbol, and country |
|
||||
|
||||
## CoinGecko Endpoints: General
|
||||
|
||||
| Endpoint | Description |
|
||||
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
|
||||
| [/exchange\_rates](/v3.0.1/reference/exchange-rates) | Query BTC exchange rates with other currencies |
|
||||
| [/asset\_platforms](/v3.0.1/reference/asset-platforms-list) | Query all the asset platforms (blockchain networks) on CoinGecko |
|
||||
| [/token\_lists/\{asset\_platform\_id}/all.json](/v3.0.1/reference/token-lists) | Get full list of tokens of a blockchain network (asset platform) that is supported by Ethereum token list standard |
|
||||
| [/search](/v3.0.1/reference/search-data) | Search for coins, categories and markets listed on CoinGecko |
|
||||
| [/search/trending](/v3.0.1/reference/trending-search) | Query trending search coins, NFTs and categories on CoinGecko in the last 24 hours |
|
||||
| [/global](/v3.0.1/reference/crypto-global) | Query cryptocurrency global data including active cryptocurrencies, markets, total crypto market cap and etc. |
|
||||
| [/global/decentralized\_finance\_defi](/v3.0.1/reference/global-defi) | Query cryptocurrency global decentralized finance (DeFi) data including DeFi market cap, trading volume |
|
||||
|
||||
## Onchain DEX Endpoints (GeckoTerminal)
|
||||
|
||||
| Endpoint | Description |
|
||||
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| [/onchain/simple/networks/../token\_price/..](/v3.0.1/reference/onchain-simple-price) | Get token price based on the provided token contract address on a network |
|
||||
| [/onchain/networks](/v3.0.1/reference/networks-list) | Query all the supported networks on GeckoTerminal |
|
||||
| [/onchain/networks/../dexes](/v3.0.1/reference/dexes-list) | Query all the supported decentralized exchanges (DEXs) based on the provided network on GeckoTerminal |
|
||||
| [/onchain/networks/trending\_pools](/v3.0.1/reference/trending-pools-list) | Query all the trending pools across all networks on GeckoTerminal |
|
||||
| [/onchain/networks/../trending\_pools](/v3.0.1/reference/trending-pools-network) | Query the trending pools based on the provided network |
|
||||
| [/onchain/networks/../pools/..](/v3.0.1/reference/pool-address) | Query the specific pool based on the provided network and pool address |
|
||||
| [/onchain/networks/../pools/multi/..](/v3.0.1/reference/pools-addresses) | Query multiple pools based on the provided network and pool address |
|
||||
| [/onchain/networks/../pools](/v3.0.1/reference/top-pools-network) | Query all the top pools based on the provided network |
|
||||
| [/onchain/networks/../dexes/../pools](/v3.0.1/reference/top-pools-dex) | Query all the top pools based on the provided network and decentralized exchange (DEX) |
|
||||
| [/onchain/networks/../new\_pools](/v3.0.1/reference/latest-pools-network) | Query all the latest pools based on provided network |
|
||||
| [/onchain/networks/new\_pools](/v3.0.1/reference/latest-pools-list) | Query all the latest pools across all networks on GeckoTerminal |
|
||||
| [/onchain/search/pools](/v3.0.1/reference/search-pools) | Search for pools on a network |
|
||||
| [/onchain/networks/../tokens/../pools](/v3.0.1/reference/top-pools-contract-address) | Query top pools based on the provided token contract address on a network |
|
||||
| [/onchain/networks/../tokens/..](/v3.0.1/reference/token-data-contract-address) | Query specific token data based on the provided token contract address on a network |
|
||||
| [/onchain/networks/../tokens/multi/..](/v3.0.1/reference/tokens-data-contract-addresses) | Query multiple tokens data based on the provided token contract addresses on a network |
|
||||
| [/onchain/networks/../tokens/../info](/v3.0.1/reference/token-info-contract-address) | Query token metadata (name, symbol, CoinGecko ID, image, socials, websites, description, etc.) based on a provided token contract address on a network |
|
||||
| [/onchain/networks/../pools/../info](/v3.0.1/reference/pool-token-info-contract-address) | Query pool metadata (base and quote token details, image, socials, websites, description, contract address, etc.) based on a provided pool contract address on a network |
|
||||
| [/onchain/tokens/info\_recently\_updated](/v3.0.1/reference/tokens-info-recent-updated) | Query 100 most recently updated tokens info across all networks on GeckoTerminal |
|
||||
| [/onchain/networks/../pools/../ohlcv/..](/v3.0.1/reference/pool-ohlcv-contract-address) | Get the OHLCV chart (Open, High, Low, Close, Volume) of a pool based on the provided pool address on a network |
|
||||
| [/onchain/networks/../pools/../trades](/v3.0.1/reference/pool-trades-contract-address) | Query the last 300 trades in the past 24 hours based on the provided pool address |
|
||||
|
||||
⚡️ Need Real-time Data Streams? Try [WebSocket API](https://docs.coingecko.com/websocket)
|
||||
|
||||
<a href="/websocket">
|
||||
<Frame>
|
||||
<img src="https://mintcdn.com/coingecko/VlaOc2UnIs8mj72v/images/wss-banner-2.png?fit=max&auto=format&n=VlaOc2UnIs8mj72v&q=85&s=2c88f667113256b6285720c468fb53a1" noZoom data-og-width="2400" width="2400" data-og-height="470" height="470" data-path="images/wss-banner-2.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/coingecko/VlaOc2UnIs8mj72v/images/wss-banner-2.png?w=280&fit=max&auto=format&n=VlaOc2UnIs8mj72v&q=85&s=d2eafb93fcd670d5df221d617fd6f6a7 280w, https://mintcdn.com/coingecko/VlaOc2UnIs8mj72v/images/wss-banner-2.png?w=560&fit=max&auto=format&n=VlaOc2UnIs8mj72v&q=85&s=24f635622a42c0ae03695cc940112699 560w, https://mintcdn.com/coingecko/VlaOc2UnIs8mj72v/images/wss-banner-2.png?w=840&fit=max&auto=format&n=VlaOc2UnIs8mj72v&q=85&s=82ef1c05b6f45d6d8ec0bcef0f19d49a 840w, https://mintcdn.com/coingecko/VlaOc2UnIs8mj72v/images/wss-banner-2.png?w=1100&fit=max&auto=format&n=VlaOc2UnIs8mj72v&q=85&s=b119e8746bb1a78b759e6d94d96b7c8b 1100w, https://mintcdn.com/coingecko/VlaOc2UnIs8mj72v/images/wss-banner-2.png?w=1650&fit=max&auto=format&n=VlaOc2UnIs8mj72v&q=85&s=95797e7366c7f280e3e4b570b6db2b49 1650w, https://mintcdn.com/coingecko/VlaOc2UnIs8mj72v/images/wss-banner-2.png?w=2500&fit=max&auto=format&n=VlaOc2UnIs8mj72v&q=85&s=2f120e8a31b5793213494d4ae2d46fb3 2500w" />
|
||||
</Frame>
|
||||
</a>
|
||||
|
||||
With WebSocket, you can now stream ultra-low latency, real-time prices, trades, and OHLCV chart data. <br />
|
||||
Subscribe to our [paid API plan](https://www.coingecko.com/en/api/pricing) (Analyst plan & above) to access WebSocket and REST API data delivery methods.
|
||||
|
||||
---
|
||||
|
||||
## Introduction
|
||||
|
||||
**URL:** llms-txt#introduction
|
||||
|
||||
Source: https://docs.coingecko.com/index
|
||||
|
||||
Started in 2014, CoinGecko is the world's largest independent crypto data aggregator that is integrated with more than 1,000 crypto exchanges and lists more than 18,000 coins across 600+ categories. CoinGecko API offers the most comprehensive and reliable crypto market data through RESTful JSON endpoints.
|
||||
|
||||
CoinGecko API now serves **onchain DEX data** across 250+ blockchain networks, 1,700+ decentralized exchanges (DEXes), and 15M+ tokens, powered by GeckoTerminal.
|
||||
|
||||
Thousands of forward-thinking projects, Web3 developers, researchers, institutions, and enterprises use our API to obtain **price feeds, market data, metadata, and historical data of crypto assets, NFTs, and exchanges**.
|
||||
|
||||
Here are some of the **common use cases** for clients who use CoinGecko API:
|
||||
|
||||
* Crypto Exchanges (CEX, DEX), Trading Apps
|
||||
* Wallets (Hot, Cold)
|
||||
* Data Aggregator, Crypto Screener, Analytics Dashboard
|
||||
* AI Agents, DeFAI Apps
|
||||
* Block Explorer, Portfolio Tracker
|
||||
* DeFi Protocols, NFT Marketplaces, Digital Bank
|
||||
* Backtesting Trading Strategy
|
||||
* Accounting, Tax, Audit, HR Payroll
|
||||
* Research & Analysis: Media, Institution, Academic, VC, Financial
|
||||
* Oracles, Bots, Payments, E-commerce
|
||||
|
||||
🔥 New: [WebSocket API](https://docs.coingecko.com/websocket)
|
||||
|
||||
<a href="/websocket">
|
||||
<Frame>
|
||||
<img src="https://mintcdn.com/coingecko/VlaOc2UnIs8mj72v/images/wss-banner-1.png?fit=max&auto=format&n=VlaOc2UnIs8mj72v&q=85&s=bd74fb20a26084018272eb6b63010804" noZoom data-og-width="2400" width="2400" data-og-height="470" height="470" data-path="images/wss-banner-1.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/coingecko/VlaOc2UnIs8mj72v/images/wss-banner-1.png?w=280&fit=max&auto=format&n=VlaOc2UnIs8mj72v&q=85&s=bc17e03ee25137fbcc1eaac0733e6781 280w, https://mintcdn.com/coingecko/VlaOc2UnIs8mj72v/images/wss-banner-1.png?w=560&fit=max&auto=format&n=VlaOc2UnIs8mj72v&q=85&s=d8439f50c69e11ba595b6c07d97eb65c 560w, https://mintcdn.com/coingecko/VlaOc2UnIs8mj72v/images/wss-banner-1.png?w=840&fit=max&auto=format&n=VlaOc2UnIs8mj72v&q=85&s=8c232633716268ced5b171e3e38acbf5 840w, https://mintcdn.com/coingecko/VlaOc2UnIs8mj72v/images/wss-banner-1.png?w=1100&fit=max&auto=format&n=VlaOc2UnIs8mj72v&q=85&s=3ac0be8afcc3e9fba5b4c4a961c5cda7 1100w, https://mintcdn.com/coingecko/VlaOc2UnIs8mj72v/images/wss-banner-1.png?w=1650&fit=max&auto=format&n=VlaOc2UnIs8mj72v&q=85&s=b8e71e426137d6f26642360aa8f1c347 1650w, https://mintcdn.com/coingecko/VlaOc2UnIs8mj72v/images/wss-banner-1.png?w=2500&fit=max&auto=format&n=VlaOc2UnIs8mj72v&q=85&s=eb7699818b518264b9c3c65c5ec5a633 2500w" />
|
||||
</Frame>
|
||||
</a>
|
||||
|
||||
With WebSocket, you can now stream ultra-low latency, real-time prices, trades, and OHLCV chart data. <br />
|
||||
Subscribe to our [paid API plan](https://www.coingecko.com/en/api/pricing) (Analyst plan & above) to access WebSocket and REST API data delivery methods.
|
||||
|
||||
<Columns cols={2}>
|
||||
<Card title="Setting Up Your API Key" icon="key" href="/docs/setting-up-your-api-key">
|
||||
Start by creating your CoinGecko API key
|
||||
</Card>
|
||||
|
||||
<Card title="Building with AI" icon="robot" href="/docs/building-with-ai">
|
||||
Bring CoinGecko data to your AI apps
|
||||
</Card>
|
||||
</Columns>
|
||||
|
||||
export const FooterFix = () => {
|
||||
React.useEffect(() => {
|
||||
const paginationElement = document.getElementById('pagination');
|
||||
if (paginationElement) paginationElement.remove();
|
||||
|
||||
const footerElement = document.getElementById('footer');
|
||||
if (footerElement) footerElement.style.marginTop = '-40px';
|
||||
|
||||
const feedbackToolbarClass = document.querySelector('.feedback-toolbar');
|
||||
if (feedbackToolbarClass) feedbackToolbarClass.style.paddingBottom = '0px';
|
||||
}, []);
|
||||
|
||||
---
|
||||
|
||||
## 📕 Overview
|
||||
|
||||
**URL:** llms-txt#📕-overview
|
||||
|
||||
The official CoinGecko MCP Server is now live, making CoinGecko data readily available to your AI models and applications. With the CoinGecko MCP, you can empower your agents to:
|
||||
|
||||
* **Access real-time market data**: Get aggregated prices, market cap, and trading volume for over 15k+ coins on CoinGecko, integrated across 1,000+ exchanges.
|
||||
* **Dive into onchain analytics**: Query onchain DEX price and liquidity data for more than 8M tokens across 200+ networks via GeckoTerminal.
|
||||
* **Discover market trends**: Instantly find trending coins, new token listings, top gainers/losers, and popular NFT collections.
|
||||
* **Retrieve rich metadata**: Pull essential details like project descriptions, logos, social links, contract addresses, security info, and more.
|
||||
* **Analyze historical performance**: Access historical price, market data, and OHLCV for any cryptocurrency.
|
||||
* **Explore crypto categories**: Effortlessly list coins within specific sectors like Meme, DeFi, Layer 1, AI agent, and more.
|
||||
|
||||
<Frame caption="MCP Demo with Claude Desktop">
|
||||
<img src="https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/8c45171-image.png?fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=a17e15d1b672940226da961086b986ed" data-og-width="2930" width="2930" data-og-height="1882" height="1882" data-path="images/reference/8c45171-image.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/8c45171-image.png?w=280&fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=c026d75329f72ee001fafea1c6d35659 280w, https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/8c45171-image.png?w=560&fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=e90eb94aa0cd98f9409042706e598703 560w, https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/8c45171-image.png?w=840&fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=fd02d8b78f1e6b325e29b59795d1f84f 840w, https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/8c45171-image.png?w=1100&fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=2ef4c5580ce4de3f5caae91b4c9be11d 1100w, https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/8c45171-image.png?w=1650&fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=c9efb0e238afbfe0a3d7bf54ede0c3c1 1650w, https://mintcdn.com/coingecko/b3Fla9Sm0TsVrJN4/images/reference/8c45171-image.png?w=2500&fit=max&auto=format&n=b3Fla9Sm0TsVrJN4&q=85&s=2b8f2e6b387cd3c9f9c229a31c1efe12 2500w" />
|
||||
</Frame>
|
||||
|
||||
---
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,183 @@
|
||||
# CoinGecko API
|
||||
|
||||
## Docs
|
||||
|
||||
- [Changelog](https://docs.coingecko.com/changelog.md): Product updates and announcements
|
||||
- [1. Get data by ID or Address](https://docs.coingecko.com/docs/1-get-data-by-id-or-address.md)
|
||||
- [10-mins Tutorial Guide](https://docs.coingecko.com/docs/10-mins-tutorial-guide.md): New to CoinGecko API? Fret not. Whether you're a programmer or someone with zero coding experience, we've got you covered!
|
||||
- [2. Get Historical Data](https://docs.coingecko.com/docs/2-get-historical-data.md)
|
||||
- [3. Get Exchanges & NFT Data](https://docs.coingecko.com/docs/3-get-exchanges-nft-data.md)
|
||||
- [4. Get On-chain Data](https://docs.coingecko.com/docs/4-get-on-chain-data.md)
|
||||
- [AI Prompts](https://docs.coingecko.com/docs/ai-prompts.md): CoinGecko API AI prompt library
|
||||
- [API Status](https://docs.coingecko.com/docs/api-status.md): CoinGecko's API status page provides information on the current status and incident history of CoinGecko API (Public & Pro)
|
||||
- [Best Practices](https://docs.coingecko.com/docs/best-practices.md): Wonder how to use different endpoints together? This is the perfect place for you
|
||||
- [Building with AI](https://docs.coingecko.com/docs/building-with-ai.md): Quick tips to empower your AI applications with CoinGecko API, and leverage our AI capabilities to help you build better and easier.
|
||||
- [Clients](https://docs.coingecko.com/docs/clients.md): Explore client resources, including official Swagger JSON and unofficial Python wrapper
|
||||
- [Common Errors & Rate Limit](https://docs.coingecko.com/docs/common-errors-rate-limit.md)
|
||||
- [Common Use Cases](https://docs.coingecko.com/docs/common-use-cases.md): Discover the common use cases of CoinGecko API by our users
|
||||
- [Endpoint Showcase](https://docs.coingecko.com/docs/endpoint-showcase.md): Discover how CoinGecko API is used at CoinGecko.com and GeckoTerminal.com
|
||||
- [CoinGecko MCP Server (Beta)](https://docs.coingecko.com/docs/mcp-server.md): MCP Server for Crypto Price & Market Data. MCP (Model Context Protocol) is an open standard that allows Large Language Model (LLM) and other AI agents to securely and intelligently interact with external data sources and tools.
|
||||
- [Python AI Prompts](https://docs.coingecko.com/docs/python-ai-prompts.md): A comprehensive AI prompt to guide coding assistants in correctly implementing the official CoinGecko Python SDK for reliable API integration.
|
||||
- [CoinGecko SDK (Beta)](https://docs.coingecko.com/docs/sdk.md): Official CoinGecko Typescript and Python SDKs — Crypto Price & Market Data API
|
||||
- [Setting Up Your API Key](https://docs.coingecko.com/docs/setting-up-your-api-key.md)
|
||||
- [Tutorials (Beginner-friendly)](https://docs.coingecko.com/docs/tutorials-beginner-friendly.md): Using CoinGecko API is super easy, even if you have no programming experience!
|
||||
- [TypeScript AI Prompts](https://docs.coingecko.com/docs/typescript-ai-prompts.md): A comprehensive AI prompt to guide coding assistants in correctly implementing the official CoinGecko TypeScript SDK.
|
||||
- [Useful Links](https://docs.coingecko.com/docs/useful-links.md): Some of the useful links to help you navigate while using the CoinGecko API
|
||||
- [Introduction](https://docs.coingecko.com/index.md)
|
||||
- [💼 API Usage](https://docs.coingecko.com/reference/api-usage.md): This endpoint allows you to **monitor your account's API usage, including rate limits, monthly total credits, remaining credits, and more**
|
||||
- [Asset Platforms List (ID Map)](https://docs.coingecko.com/reference/asset-platforms-list.md): This endpoint allows you to **query all the asset platforms on CoinGecko**
|
||||
- [Authentication (Pro API)](https://docs.coingecko.com/reference/authentication.md): Authentication method for CoinGecko Pro API (Paid plan subscribers with Pro-API keys)
|
||||
- [💼 Categories List](https://docs.coingecko.com/reference/categories-list.md): This endpoint allows you to **query all the supported categories on GeckoTerminal**
|
||||
- [Coins Categories List with Market Data](https://docs.coingecko.com/reference/coins-categories.md): This endpoint allows you to **query all the coins categories with market data (market cap, volume, ...) on CoinGecko**
|
||||
- [Coins Categories List (ID Map)](https://docs.coingecko.com/reference/coins-categories-list.md): This endpoint allows you to **query all the coins categories on CoinGecko**
|
||||
- [Coin Data by Token Address](https://docs.coingecko.com/reference/coins-contract-address.md): This endpoint allows you to **query all the metadata (image, websites, socials, description, contract address, etc.) and market data (price, ATH, exchange tickers, etc.) of a coin from the CoinGecko coin page based on an asset platform and a particular token contract address**
|
||||
- [Coin Data by ID](https://docs.coingecko.com/reference/coins-id.md): This endpoint allows you to **query all the metadata (image, websites, socials, description, contract address, etc.) and market data (price, ATH, exchange tickers, etc.) of a coin from the CoinGecko coin page based on a particular coin ID**
|
||||
- [👑 Circulating Supply Chart by ID](https://docs.coingecko.com/reference/coins-id-circulating-supply-chart.md): This endpoint allows you to **query historical circulating supply of a coin by number of days away from now based on provided coin ID**
|
||||
- [👑 Circulating Supply Chart within Time Range by ID](https://docs.coingecko.com/reference/coins-id-circulating-supply-chart-range.md): This endpoint allows you to **query historical circulating supply of a coin, within a range of timestamp based on the provided coin ID**
|
||||
- [Coin Historical Data by ID](https://docs.coingecko.com/reference/coins-id-history.md): This endpoint allows you to **query the historical data (price, market cap, 24hrs volume, ...) at a given date for a coin based on a particular coin ID**
|
||||
- [Coin Historical Chart Data by ID](https://docs.coingecko.com/reference/coins-id-market-chart.md): This endpoint allows you to **get the historical chart data of a coin including time in UNIX, price, market cap and 24hr volume based on particular coin ID**
|
||||
- [Coin Historical Chart Data within Time Range by ID](https://docs.coingecko.com/reference/coins-id-market-chart-range.md): This endpoint allows you to **get the historical chart data of a coin within certain time range in UNIX along with price, market cap and 24hr volume based on particular coin ID**
|
||||
- [Coin OHLC Chart by ID](https://docs.coingecko.com/reference/coins-id-ohlc.md): This endpoint allows you to **get the OHLC chart (Open, High, Low, Close) of a coin based on particular coin ID**
|
||||
- [💼 Coin OHLC Chart within Time Range by ID](https://docs.coingecko.com/reference/coins-id-ohlc-range.md): This endpoint allows you to **get the OHLC chart (Open, High, Low, Close) of a coin within a range of timestamp based on particular coin ID**
|
||||
- [Coin Tickers by ID](https://docs.coingecko.com/reference/coins-id-tickers.md): This endpoint allows you to **query the coin tickers on both centralized exchange (CEX) and decentralized exchange (DEX) based on a particular coin ID**
|
||||
- [👑 Total Supply Chart by ID](https://docs.coingecko.com/reference/coins-id-total-supply-chart.md): This endpoint allows you to **query historical total supply of a coin by number of days away from now based on provided coin ID**
|
||||
- [👑 Total Supply Chart within time range by ID](https://docs.coingecko.com/reference/coins-id-total-supply-chart-range.md): This endpoint allows you to **query historical total supply of a coin, within a range of timestamp based on the provided coin ID**
|
||||
- [Coins List (ID Map)](https://docs.coingecko.com/reference/coins-list.md): This endpoint allows you to **query all the supported coins on CoinGecko with coins ID, name and symbol**
|
||||
- [💼 Recently Added Coins](https://docs.coingecko.com/reference/coins-list-new.md): This endpoint allows you to **query the latest 200 coins that recently listed on CoinGecko**
|
||||
- [Coins List with Market Data](https://docs.coingecko.com/reference/coins-markets.md): This endpoint allows you to **query all the supported coins with price, market cap, volume and market related data**
|
||||
- [💼 Top Gainers & Losers](https://docs.coingecko.com/reference/coins-top-gainers-losers.md): This endpoint allows you to **query the top 30 coins with largest price gain and loss by a specific time duration**
|
||||
- [Crypto Treasury Holdings by Coin ID](https://docs.coingecko.com/reference/companies-public-treasury.md): This endpoint allows you **query public companies & governments' cryptocurrency holdings** by Coin ID
|
||||
- [Coin Historical Chart Data by Token Address](https://docs.coingecko.com/reference/contract-address-market-chart.md): This endpoint allows you to **get the historical chart data including time in UNIX, price, market cap and 24hr volume based on asset platform and particular token contract address**
|
||||
- [Coin Historical Chart Data within Time Range by Token Address](https://docs.coingecko.com/reference/contract-address-market-chart-range.md): This endpoint allows you to **get the historical chart data within certain time range in UNIX along with price, market cap and 24hr volume based on asset platform and particular token contract address**
|
||||
- [Crypto Global Market Data](https://docs.coingecko.com/reference/crypto-global.md): This endpoint allows you **query cryptocurrency global data including active cryptocurrencies, markets, total crypto market cap and etc**
|
||||
- [Derivatives Exchanges List with Data](https://docs.coingecko.com/reference/derivatives-exchanges.md): This endpoint allows you to **query all the derivatives exchanges with related data (ID, name, open interest, ...) on CoinGecko**
|
||||
- [Derivatives Exchange Data by ID](https://docs.coingecko.com/reference/derivatives-exchanges-id.md): This endpoint allows you to **query the derivatives exchange's related data (ID, name, open interest, ...) based on the exchanges' ID**
|
||||
- [Derivatives Exchanges List (ID Map)](https://docs.coingecko.com/reference/derivatives-exchanges-list.md): This endpoint allows you to **query all the derivatives exchanges with ID and name on CoinGecko**
|
||||
- [Derivatives Tickers List](https://docs.coingecko.com/reference/derivatives-tickers.md): This endpoint allows you to **query all the tickers from derivatives exchanges on CoinGecko**
|
||||
- [Supported Dexes List by Network (ID Map)](https://docs.coingecko.com/reference/dexes-list.md): This endpoint allows you to **query all the supported decentralized exchanges (DEXs) based on the provided network on GeckoTerminal**
|
||||
- [Endpoint Overview](https://docs.coingecko.com/reference/endpoint-overview.md)
|
||||
- [Entities List (ID Map)](https://docs.coingecko.com/reference/entities-list.md): This endpoint allows you to **query all the supported entities on CoinGecko with entities ID, name, symbol, and country**
|
||||
- [BTC-to-Currency Exchange Rates](https://docs.coingecko.com/reference/exchange-rates.md): This endpoint allows you to **query BTC exchange rates with other currencies**
|
||||
- [Exchanges List with data](https://docs.coingecko.com/reference/exchanges.md): This endpoint allows you to **query all the supported exchanges with exchanges' data (ID, name, country, ...) that have active trading volumes on CoinGecko**
|
||||
- [Exchange Data by ID](https://docs.coingecko.com/reference/exchanges-id.md): This endpoint allows you to **query exchange's data (name, year established, country, ...), exchange volume in BTC and top 100 tickers based on exchange's ID**
|
||||
- [Exchange Tickers by ID](https://docs.coingecko.com/reference/exchanges-id-tickers.md): This endpoint allows you to **query exchange's tickers based on exchange's ID**
|
||||
- [Exchange Volume Chart by ID](https://docs.coingecko.com/reference/exchanges-id-volume-chart.md): This endpoint allows you to **query the historical volume chart data with time in UNIX and trading volume data in BTC based on exchange's ID**
|
||||
- [💼 Exchange Volume Chart within Time Range by ID](https://docs.coingecko.com/reference/exchanges-id-volume-chart-range.md): This endpoint allows you to **query the historical volume chart data in BTC by specifying date range in UNIX based on exchange's ID**
|
||||
- [Exchanges List (ID Map)](https://docs.coingecko.com/reference/exchanges-list.md): This endpoint allows you to **query all the exchanges with ID and name**
|
||||
- [Global DeFi Market Data](https://docs.coingecko.com/reference/global-defi.md): This endpoint allows you **query top 100 cryptocurrency global decentralized finance (DeFi) data including DeFi market cap, trading volume**
|
||||
- [💼 Global Market Cap Chart Data](https://docs.coingecko.com/reference/global-market-cap-chart.md): This endpoint allows you to **query historical global market cap and volume data by number of days away from now**
|
||||
- [New Pools List](https://docs.coingecko.com/reference/latest-pools-list.md): This endpoint allows you to **query all the latest pools across all networks on GeckoTerminal**
|
||||
- [New Pools by Network](https://docs.coingecko.com/reference/latest-pools-network.md): This endpoint allows you to **query all the latest pools based on provided network**
|
||||
- [Supported Networks List (ID Map)](https://docs.coingecko.com/reference/networks-list.md): This endpoint allows you to **query all the supported networks on GeckoTerminal**
|
||||
- [NFTs Collection Data by Contract Address](https://docs.coingecko.com/reference/nfts-contract-address.md): This endpoint allows you to **query all the NFT data (name, floor price, 24hr volume ...) based on the NFT collection contract address and respective asset platform**
|
||||
- [💼 NFTs Collection Historical Chart Data by Contract Address](https://docs.coingecko.com/reference/nfts-contract-address-market-chart.md): This endpoint allows you **query historical market data of a NFT collection, including floor price, market cap, and 24hr volume, by number of days away from now based on the provided contract address**
|
||||
- [NFTs Collection Data by ID](https://docs.coingecko.com/reference/nfts-id.md): This endpoint allows you to **query all the NFT data (name, floor price, 24hr volume ...) based on the NFT collection ID**
|
||||
- [💼 NFTs Collection Historical Chart Data by ID](https://docs.coingecko.com/reference/nfts-id-market-chart.md): This endpoint allows you **query historical market data of a NFT collection, including floor price, market cap, and 24hr volume, by number of days away from now**
|
||||
- [💼 NFTs Collection Tickers by ID](https://docs.coingecko.com/reference/nfts-id-tickers.md): This endpoint allows you to **query the latest floor price and 24hr volume of a NFT collection, on each NFT marketplace, e.g. OpenSea and LooksRare**
|
||||
- [NFTs List (ID Map)](https://docs.coingecko.com/reference/nfts-list.md): This endpoint allows you to **query all supported NFTs with ID, contract address, name, asset platform ID and symbol on CoinGecko**
|
||||
- [💼 NFTs List with Market Data](https://docs.coingecko.com/reference/nfts-markets.md): This endpoint allows you to **query all the supported NFT collections with floor price, market cap, volume and market related data on CoinGecko**
|
||||
- [Token Price by Token Addresses](https://docs.coingecko.com/reference/onchain-simple-price.md): This endpoint allows you to **get token price based on the provided token contract address on a network**
|
||||
- [Check API server status](https://docs.coingecko.com/reference/ping-server.md): This endpoint allows you to **check the API server status**
|
||||
- [Specific Pool Data by Pool Address](https://docs.coingecko.com/reference/pool-address.md): This endpoint allows you to **query the specific pool based on the provided network and pool address**
|
||||
- [Pool OHLCV chart by Pool Address](https://docs.coingecko.com/reference/pool-ohlcv-contract-address.md): This endpoint allows you to **get the OHLCV chart (Open, High, Low, Close, Volume) of a pool based on the provided pool address on a network**
|
||||
- [Pool Tokens Info by Pool Address](https://docs.coingecko.com/reference/pool-token-info-contract-address.md): This endpoint allows you to **query pool metadata (base and quote token details, image, socials, websites, description, contract address, etc.) based on a provided pool contract address on a network**
|
||||
- [Past 24 Hour Trades by Pool Address](https://docs.coingecko.com/reference/pool-trades-contract-address.md): This endpoint allows you to **query the last 300 trades in the past 24 hours based on the provided pool address**
|
||||
- [Multiple Pools Data by Pool Addresses](https://docs.coingecko.com/reference/pools-addresses.md): This endpoint allows you to **query multiple pools based on the provided network and pool address**
|
||||
- [💼 Pools by Category ID](https://docs.coingecko.com/reference/pools-category.md): This endpoint allows you to **query all the pools based on the provided category ID**
|
||||
- [🔥 Megafilter for Pools](https://docs.coingecko.com/reference/pools-megafilter.md): This endpoint allows you to **query pools based on various filters across all networks on GeckoTerminal**
|
||||
- [Crypto Treasury Holdings by Entity ID](https://docs.coingecko.com/reference/public-treasury-entity.md): This endpoint allows you **query public companies & governments' cryptocurrency holdings** by Entity ID
|
||||
- [Search Queries](https://docs.coingecko.com/reference/search-data.md): This endpoint allows you to **search for coins, categories and markets listed on CoinGecko**
|
||||
- [Search Pools](https://docs.coingecko.com/reference/search-pools.md): This endpoint allows you to **search for pools on a network**
|
||||
- [Coin Price by IDs](https://docs.coingecko.com/reference/simple-price.md): This endpoint allows you to **query the prices of one or more coins by using their unique Coin API IDs**
|
||||
- [Supported Currencies List](https://docs.coingecko.com/reference/simple-supported-currencies.md): This endpoint allows you to **query all the supported currencies on CoinGecko**
|
||||
- [Coin Price by Token Addresses](https://docs.coingecko.com/reference/simple-token-price.md): This endpoint allows you to **query one or more token prices using their token contract addresses**
|
||||
- [Token Data by Token Address](https://docs.coingecko.com/reference/token-data-contract-address.md): This endpoint allows you to **query specific token data based on the provided token contract address on a network**
|
||||
- [💼 Historical Token Holders Chart by Token Address](https://docs.coingecko.com/reference/token-holders-chart-token-address.md): This endpoint allows you to **get the historical token holders chart based on the provided token contract address on a network**
|
||||
- [Token Info by Token Address](https://docs.coingecko.com/reference/token-info-contract-address.md): This endpoint allows you to **query token metadata (name, symbol, CoinGecko ID, image, socials, websites, description, etc.) based on a provided token contract address on a network**
|
||||
- [Token Lists by Asset Platform ID](https://docs.coingecko.com/reference/token-lists.md): This endpoint allows you to **get full list of tokens of a blockchain network (asset platform) that is supported by [Ethereum token list standard](https://tokenlists.org/)**
|
||||
- [💼 Token OHLCV chart by Token Address](https://docs.coingecko.com/reference/token-ohlcv-token-address.md): This endpoint allows you to **get the OHLCV chart (Open, High, Low, Close, Volume) of a token based on the provided token address on a network**
|
||||
- [💼 Past 24 Hour Trades by Token Address](https://docs.coingecko.com/reference/token-trades-contract-address.md): This endpoint allows you to **query the last 300 trades in the past 24 hours, across all pools, based on the provided token contract address on a network**
|
||||
- [Tokens Data by Token Addresses](https://docs.coingecko.com/reference/tokens-data-contract-addresses.md): This endpoint allows you to **query multiple tokens data based on the provided token contract addresses on a network**
|
||||
- [Most Recently Updated Tokens List](https://docs.coingecko.com/reference/tokens-info-recent-updated.md): This endpoint allows you to **query 100 most recently updated tokens info of a specific network or across all networks on GeckoTerminal**
|
||||
- [Top Pools by Token Address](https://docs.coingecko.com/reference/top-pools-contract-address.md): This endpoint allows you to **query top pools based on the provided token contract address on a network**
|
||||
- [Top Pools by Dex](https://docs.coingecko.com/reference/top-pools-dex.md): This endpoint allows you to **query all the top pools based on the provided network and decentralized exchange (DEX)**
|
||||
- [Top Pools by Network](https://docs.coingecko.com/reference/top-pools-network.md): This endpoint allows you to **query all the top pools based on the provided network**
|
||||
- [💼 Top Token Holders by Token Address](https://docs.coingecko.com/reference/top-token-holders-token-address.md): This endpoint allows you to **query top token holders based on the provided token contract address on a network**
|
||||
- [Trending Pools List](https://docs.coingecko.com/reference/trending-pools-list.md): This endpoint allows you to **query all the trending pools across all networks on GeckoTerminal**
|
||||
- [Trending Pools by Network](https://docs.coingecko.com/reference/trending-pools-network.md): This endpoint allows you to **query the trending pools based on the provided network**
|
||||
- [Trending Search List](https://docs.coingecko.com/reference/trending-search.md): This endpoint allows you **query trending search coins, NFTs and categories on CoinGecko in the last 24 hours**
|
||||
- [💼 Trending Search Pools](https://docs.coingecko.com/reference/trending-search-pools.md): This endpoint allows you to **query all the trending search pools across all networks on GeckoTerminal**
|
||||
- [Asset Platforms List (ID Map)](https://docs.coingecko.com/v3.0.1/reference/asset-platforms-list.md): This endpoint allows you to **query all the asset platforms on CoinGecko**
|
||||
- [Authentication (Public/Demo)](https://docs.coingecko.com/v3.0.1/reference/authentication.md): Authentication method for CoinGecko Public API (Demo plan users)
|
||||
- [Coins Categories List with Market Data](https://docs.coingecko.com/v3.0.1/reference/coins-categories.md): This endpoint allows you to **query all the coins categories with market data (market cap, volume, ...) on CoinGecko**
|
||||
- [Coins Categories List (ID Map)](https://docs.coingecko.com/v3.0.1/reference/coins-categories-list.md): This endpoint allows you to **query all the coins categories on CoinGecko**
|
||||
- [Coin Data by Token Address](https://docs.coingecko.com/v3.0.1/reference/coins-contract-address.md): This endpoint allows you to **query all the metadata (image, websites, socials, description, contract address, etc.) and market data (price, ATH, exchange tickers, etc.) of a coin from the CoinGecko coin page based on an asset platform and a particular token contract address**
|
||||
- [Coin Data by ID](https://docs.coingecko.com/v3.0.1/reference/coins-id.md): This endpoint allows you to **query all the metadata (image, websites, socials, description, contract address, etc.) and market data (price, ATH, exchange tickers, etc.) of a coin from the CoinGecko coin page based on a particular coin ID**
|
||||
- [Coin Historical Data by ID](https://docs.coingecko.com/v3.0.1/reference/coins-id-history.md): This endpoint allows you to **query the historical data (price, market cap, 24hrs volume, ...) at a given date for a coin based on a particular coin ID**
|
||||
- [Coin Historical Chart Data by ID](https://docs.coingecko.com/v3.0.1/reference/coins-id-market-chart.md): This endpoint allows you to **get the historical chart data of a coin including time in UNIX, price, market cap and 24hr volume based on particular coin ID**
|
||||
- [Coin Historical Chart Data within Time Range by ID](https://docs.coingecko.com/v3.0.1/reference/coins-id-market-chart-range.md): This endpoint allows you to **get the historical chart data of a coin within certain time range in UNIX along with price, market cap and 24hr volume based on particular coin ID**
|
||||
- [Coin OHLC Chart by ID](https://docs.coingecko.com/v3.0.1/reference/coins-id-ohlc.md): This endpoint allows you to **get the OHLC chart (Open, High, Low, Close) of a coin based on particular coin ID**
|
||||
- [Coin Tickers by ID](https://docs.coingecko.com/v3.0.1/reference/coins-id-tickers.md): This endpoint allows you to **query the coin tickers on both centralized exchange (CEX) and decentralized exchange (DEX) based on a particular coin ID**
|
||||
- [Coins List (ID Map)](https://docs.coingecko.com/v3.0.1/reference/coins-list.md): This endpoint allows you to **query all the supported coins on CoinGecko with coins ID, name and symbol**
|
||||
- [Coins List with Market Data](https://docs.coingecko.com/v3.0.1/reference/coins-markets.md): This endpoint allows you to **query all the supported coins with price, market cap, volume and market related data**
|
||||
- [Crypto Treasury Holdings by Coin ID](https://docs.coingecko.com/v3.0.1/reference/companies-public-treasury.md): This endpoint allows you **query public companies & governments' cryptocurrency holdings** by Coin ID
|
||||
- [Coin Historical Chart Data by Token Address](https://docs.coingecko.com/v3.0.1/reference/contract-address-market-chart.md): This endpoint allows you to **get the historical chart data including time in UNIX, price, market cap and 24hr volume based on asset platform and particular token contract address**
|
||||
- [Coin Historical Chart Data within Time Range by Token Address](https://docs.coingecko.com/v3.0.1/reference/contract-address-market-chart-range.md): This endpoint allows you to **get the historical chart data within certain time range in UNIX along with price, market cap and 24hr volume based on asset platform and particular token contract address**
|
||||
- [Crypto Global Market Data](https://docs.coingecko.com/v3.0.1/reference/crypto-global.md): This endpoint allows you **query cryptocurrency global data including active cryptocurrencies, markets, total crypto market cap and etc**
|
||||
- [Derivatives Exchanges List with Data](https://docs.coingecko.com/v3.0.1/reference/derivatives-exchanges.md): This endpoint allows you to **query all the derivatives exchanges with related data (ID, name, open interest, ...) on CoinGecko**
|
||||
- [Derivatives Exchange Data by ID](https://docs.coingecko.com/v3.0.1/reference/derivatives-exchanges-id.md): This endpoint allows you to **query the derivatives exchange's related data (ID, name, open interest, ...) based on the exchanges' ID**
|
||||
- [Derivatives Exchanges List (ID Map)](https://docs.coingecko.com/v3.0.1/reference/derivatives-exchanges-list.md): This endpoint allows you to **query all the derivatives exchanges with ID and name on CoinGecko**
|
||||
- [Derivatives Tickers List](https://docs.coingecko.com/v3.0.1/reference/derivatives-tickers.md): This endpoint allows you to **query all the tickers from derivatives exchanges on CoinGecko**
|
||||
- [Supported Dexes List by Network (ID Map)](https://docs.coingecko.com/v3.0.1/reference/dexes-list.md): This endpoint allows you to **query all the supported decentralized exchanges (DEXs) based on the provided network on GeckoTerminal**
|
||||
- [Endpoint Overview](https://docs.coingecko.com/v3.0.1/reference/endpoint-overview.md)
|
||||
- [Entities List (ID Map)](https://docs.coingecko.com/v3.0.1/reference/entities-list.md): This endpoint allows you to **query all the supported entities on CoinGecko with entities ID, name, symbol, and country**
|
||||
- [BTC-to-Currency Exchange Rates](https://docs.coingecko.com/v3.0.1/reference/exchange-rates.md): This endpoint allows you to **query BTC exchange rates with other currencies**
|
||||
- [Exchanges List with data](https://docs.coingecko.com/v3.0.1/reference/exchanges.md): This endpoint allows you to **query all the supported exchanges with exchanges' data (ID, name, country, ...) that have active trading volumes on CoinGecko**
|
||||
- [Exchange Data by ID](https://docs.coingecko.com/v3.0.1/reference/exchanges-id.md): This endpoint allows you to **query exchange's data (name, year established, country, ...), exchange volume in BTC and top 100 tickers based on exchange's ID**
|
||||
- [Exchange Tickers by ID](https://docs.coingecko.com/v3.0.1/reference/exchanges-id-tickers.md): This endpoint allows you to **query exchange's tickers based on exchange's ID**
|
||||
- [Exchange Volume Chart by ID](https://docs.coingecko.com/v3.0.1/reference/exchanges-id-volume-chart.md): This endpoint allows you to **query the historical volume chart data with time in UNIX and trading volume data in BTC based on exchange's ID**
|
||||
- [Exchanges List (ID Map)](https://docs.coingecko.com/v3.0.1/reference/exchanges-list.md): This endpoint allows you to **query all the exchanges with ID and name**
|
||||
- [Global DeFi Market Data](https://docs.coingecko.com/v3.0.1/reference/global-defi.md): This endpoint allows you **query top 100 cryptocurrency global decentralized finance (DeFi) data including DeFi market cap, trading volume**
|
||||
- [New Pools List](https://docs.coingecko.com/v3.0.1/reference/latest-pools-list.md): This endpoint allows you to **query all the latest pools across all networks on GeckoTerminal**
|
||||
- [New Pools by Network](https://docs.coingecko.com/v3.0.1/reference/latest-pools-network.md): This endpoint allows you to **query all the latest pools based on provided network**
|
||||
- [Supported Networks List (ID Map)](https://docs.coingecko.com/v3.0.1/reference/networks-list.md): This endpoint allows you to **query all the supported networks on GeckoTerminal**
|
||||
- [NFTs Collection Data by Contract Address](https://docs.coingecko.com/v3.0.1/reference/nfts-contract-address.md): This endpoint allows you to **query all the NFT data (name, floor price, 24hr volume ...) based on the NFT collection contract address and respective asset platform**
|
||||
- [NFTs Collection Data by ID](https://docs.coingecko.com/v3.0.1/reference/nfts-id.md): This endpoint allows you to **query all the NFT data (name, floor price, 24hr volume ...) based on the NFT collection ID**
|
||||
- [NFTs List (ID Map)](https://docs.coingecko.com/v3.0.1/reference/nfts-list.md): This endpoint allows you to **query all supported NFTs with ID, contract address, name, asset platform ID and symbol on CoinGecko**
|
||||
- [Token Price by Token Addresses](https://docs.coingecko.com/v3.0.1/reference/onchain-simple-price.md): This endpoint allows you to **get token price based on the provided token contract address on a network**
|
||||
- [Check API server status](https://docs.coingecko.com/v3.0.1/reference/ping-server.md): This endpoint allows you to **check the API server status**
|
||||
- [Specific Pool Data by Pool Address](https://docs.coingecko.com/v3.0.1/reference/pool-address.md): This endpoint allows you to **query the specific pool based on the provided network and pool address**
|
||||
- [Pool OHLCV chart by Pool Address](https://docs.coingecko.com/v3.0.1/reference/pool-ohlcv-contract-address.md): This endpoint allows you to **get the OHLCV chart (Open, High, Low, Close, Volume) of a pool based on the provided pool address on a network**
|
||||
- [Pool Tokens Info by Pool Address](https://docs.coingecko.com/v3.0.1/reference/pool-token-info-contract-address.md): This endpoint allows you to **query pool metadata (base and quote token details, image, socials, websites, description, contract address, etc.) based on a provided pool contract address on a network**
|
||||
- [Past 24 Hour Trades by Pool Address](https://docs.coingecko.com/v3.0.1/reference/pool-trades-contract-address.md): This endpoint allows you to **query the last 300 trades in the past 24 hours based on the provided pool address**
|
||||
- [Multiple Pools Data by Pool Addresses](https://docs.coingecko.com/v3.0.1/reference/pools-addresses.md): This endpoint allows you to **query multiple pools based on the provided network and pool address**
|
||||
- [Crypto Treasury Holdings by Entity ID](https://docs.coingecko.com/v3.0.1/reference/public-treasury-entity.md): This endpoint allows you **query public companies & governments' cryptocurrency holdings** by Entity ID
|
||||
- [Search Queries](https://docs.coingecko.com/v3.0.1/reference/search-data.md): This endpoint allows you to **search for coins, categories and markets listed on CoinGecko**
|
||||
- [Search Pools](https://docs.coingecko.com/v3.0.1/reference/search-pools.md): This endpoint allows you to **search for pools on a network**
|
||||
- [Coin Price by IDs](https://docs.coingecko.com/v3.0.1/reference/simple-price.md): This endpoint allows you to **query the prices of one or more coins by using their unique Coin API IDs**
|
||||
- [Supported Currencies List](https://docs.coingecko.com/v3.0.1/reference/simple-supported-currencies.md): This endpoint allows you to **query all the supported currencies on CoinGecko**
|
||||
- [Coin Price by Token Addresses](https://docs.coingecko.com/v3.0.1/reference/simple-token-price.md): This endpoint allows you to **query one or more token prices using their token contract addresses**
|
||||
- [Token Data by Token Address](https://docs.coingecko.com/v3.0.1/reference/token-data-contract-address.md): This endpoint allows you to **query specific token data based on the provided token contract address on a network**
|
||||
- [Token Info by Token Address](https://docs.coingecko.com/v3.0.1/reference/token-info-contract-address.md): This endpoint allows you to **query token metadata (name, symbol, CoinGecko ID, image, socials, websites, description, etc.) based on a provided token contract address on a network**
|
||||
- [Token Lists by Asset Platform ID](https://docs.coingecko.com/v3.0.1/reference/token-lists.md): This endpoint allows you to **get full list of tokens of a blockchain network (asset platform) that is supported by [Ethereum token list standard](https://tokenlists.org/)**
|
||||
- [Tokens Data by Token Addresses](https://docs.coingecko.com/v3.0.1/reference/tokens-data-contract-addresses.md): This endpoint allows you to **query multiple tokens data based on the provided token contract addresses on a network**
|
||||
- [Most Recently Updated Tokens List](https://docs.coingecko.com/v3.0.1/reference/tokens-info-recent-updated.md): This endpoint allows you to **query 100 most recently updated tokens info of a specific network or across all networks on GeckoTerminal**
|
||||
- [Top Pools by Token Address](https://docs.coingecko.com/v3.0.1/reference/top-pools-contract-address.md): This endpoint allows you to **query top pools based on the provided token contract address on a network**
|
||||
- [Top Pools by Dex](https://docs.coingecko.com/v3.0.1/reference/top-pools-dex.md): This endpoint allows you to **query all the top pools based on the provided network and decentralized exchange (DEX)**
|
||||
- [Top Pools by Network](https://docs.coingecko.com/v3.0.1/reference/top-pools-network.md): This endpoint allows you to **query all the top pools based on the provided network**
|
||||
- [Trending Pools List](https://docs.coingecko.com/v3.0.1/reference/trending-pools-list.md): This endpoint allows you to **query all the trending pools across all networks on GeckoTerminal**
|
||||
- [Trending Pools by Network](https://docs.coingecko.com/v3.0.1/reference/trending-pools-network.md): This endpoint allows you to **query the trending pools based on the provided network**
|
||||
- [Trending Search List](https://docs.coingecko.com/v3.0.1/reference/trending-search.md): This endpoint allows you **query trending search coins, NFTs and categories on CoinGecko in the last 24 hours**
|
||||
- [CGSimplePrice](https://docs.coingecko.com/websocket/cgsimpleprice.md): Subscribe to receive real-time price updates for tokens, as seen on CoinGecko.com
|
||||
- [WebSocket (Beta)](https://docs.coingecko.com/websocket/index.md): CoinGecko API: Stream Real-Time Crypto Data with WebSockets
|
||||
- [OnchainSimpleTokenPrice](https://docs.coingecko.com/websocket/onchainsimpletokenprice.md): Subscribe to receive real-time price updates for tokens, as seen on GeckoTerminal.com
|
||||
- [OnchainTrade](https://docs.coingecko.com/websocket/wss-onchain-trade.md): Subscribe to receive real-time transaction (trade/swap) updates for pools, as seen on GeckoTerminal.com
|
||||
- [OnchainOHLCV](https://docs.coingecko.com/websocket/wssonchainohlcv.md): Subscribe to receive real-time OHLCV updates for pools, as seen on GeckoTerminal.com
|
||||
|
||||
|
||||
## Optional
|
||||
|
||||
- [CoinGecko API](https://www.coingecko.com/en/api)
|
||||
- [Case Studies](https://www.coingecko.com/en/api/case-studies)
|
||||
- [Newsletter](https://newsletter.coingecko.com/landing/api_updates_subscribe)
|
||||
- [Feedback](https://docs.google.com/forms/d/e/1FAIpQLSeb7pnl_YaT17IWR5qnZrlmqmZ0xdYaT0JEyVz717Ergd5ptw/viewform)
|
||||
@@ -0,0 +1,59 @@
|
||||
# Coingecko - Market Data
|
||||
|
||||
**Pages:** 3
|
||||
|
||||
---
|
||||
|
||||
## 💼 NFTs Collection Historical Chart Data by ID
|
||||
|
||||
**URL:** llms-txt#💼-nfts-collection-historical-chart-data-by-id
|
||||
|
||||
Source: https://docs.coingecko.com/reference/nfts-id-market-chart
|
||||
|
||||
reference/api-reference/coingecko-pro.json get /nfts/{id}/market_chart
|
||||
This endpoint allows you **query historical market data of a NFT collection, including floor price, market cap, and 24hr volume, by number of days away from now**
|
||||
|
||||
* Data Granularity (auto):
|
||||
* 1-14 days from now = **5-minutely** data
|
||||
* 15 days & above from now = **daily** data (00:00 UTC)
|
||||
* Cache/Update Frequency: every 5 minutes
|
||||
* The last completed UTC day (00:00) is available 5 minutes after midnight on the next UTC day (00:05).
|
||||
* Exclusive for Paid Plan Subscribers (Analyst, Lite, Pro and Enterprise).
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## 💼 NFTs Collection Historical Chart Data by Contract Address
|
||||
|
||||
**URL:** llms-txt#💼-nfts-collection-historical-chart-data-by-contract-address
|
||||
|
||||
Source: https://docs.coingecko.com/reference/nfts-contract-address-market-chart
|
||||
|
||||
reference/api-reference/coingecko-pro.json get /nfts/{asset_platform_id}/contract/{contract_address}/market_chart
|
||||
This endpoint allows you **query historical market data of a NFT collection, including floor price, market cap, and 24hr volume, by number of days away from now based on the provided contract address**
|
||||
|
||||
* This endpoint doesn't support Solana NFT and Art Blocks, please use [/nfts/\{id}/market\_chart](/reference/nfts-id-market-chart) endpoint instead.
|
||||
* Data Granularity (auto):
|
||||
* 1-14 days from now = **5-minutely** data
|
||||
* 15 days & above from now = **daily** data (00:00 UTC)
|
||||
* Cache/Update Frequency: every 5 minutes
|
||||
* The last completed UTC day (00:00) is available 5 minutes after midnight on the next UTC day (00:05).
|
||||
* Exclusive for Paid Plan Subscribers (Analyst, Lite, Pro and Enterprise).
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## 💼 NFTs Collection Tickers by ID
|
||||
|
||||
**URL:** llms-txt#💼-nfts-collection-tickers-by-id
|
||||
|
||||
Source: https://docs.coingecko.com/reference/nfts-id-tickers
|
||||
|
||||
reference/api-reference/coingecko-pro.json get /nfts/{id}/tickers
|
||||
This endpoint allows you to **query the latest floor price and 24hr volume of a NFT collection, on each NFT marketplace, e.g. OpenSea and LooksRare**
|
||||
|
||||
* Cache/Update Frequency: every 30 seconds.
|
||||
* Exclusive for Paid Plan Subscribers (Analyst, Lite, Pro and Enterprise).
|
||||
</Note>
|
||||
|
||||
---
|
||||
@@ -0,0 +1,38 @@
|
||||
# Coingecko - Nfts
|
||||
|
||||
**Pages:** 2
|
||||
|
||||
---
|
||||
|
||||
## NFTs Collection Data by ID
|
||||
|
||||
**URL:** llms-txt#nfts-collection-data-by-id
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/nfts-id
|
||||
|
||||
v3.0.1/reference/api-reference/coingecko-demo.json get /nfts/{id}
|
||||
This endpoint allows you to **query all the NFT data (name, floor price, 24hr volume ...) based on the NFT collection ID**
|
||||
|
||||
* Cache / Update Frequency: every 60 seconds for all the API plans.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## NFTs List (ID Map)
|
||||
|
||||
**URL:** llms-txt#nfts-list-(id-map)
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/nfts-list
|
||||
|
||||
v3.0.1/reference/api-reference/coingecko-demo.json get /nfts/list
|
||||
This endpoint allows you to **query all supported NFTs with ID, contract address, name, asset platform ID and symbol on CoinGecko**
|
||||
|
||||
* You may use this endpoint to query the list of NFTs for other endpoints that contain params like `id` (NFT collection's id) as well as `asset_platform_id` and `contract_address`.
|
||||
* You may include values such as `per_page` and `page` to specify how many results you would like to show in the responses per page and which page of responses you would like to show.
|
||||
</Tip>
|
||||
|
||||
* The responses are paginated to 100 items.
|
||||
* Cache / Update Frequency: every 5 minutes for all the API plans.
|
||||
</Note>
|
||||
|
||||
---
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,52 @@
|
||||
# Coingecko - Pricing
|
||||
|
||||
**Pages:** 1
|
||||
|
||||
---
|
||||
|
||||
## Tutorials (Beginner-friendly)
|
||||
|
||||
**URL:** llms-txt#tutorials-(beginner-friendly)
|
||||
|
||||
**Contents:**
|
||||
- 🔤 No Code
|
||||
- 💻 Low Code
|
||||
- 👨💻 Code
|
||||
|
||||
Source: https://docs.coingecko.com/docs/tutorials-beginner-friendly
|
||||
|
||||
Using CoinGecko API is super easy, even if you have no programming experience!
|
||||
|
||||
* [Import Crypto Prices in Google Sheets](https://www.coingecko.com/learn/import-crypto-prices-google-sheets)
|
||||
|
||||
<a href="https://www.coingecko.com/learn/import-crypto-prices-google-sheets" target="_blank" rel="noopener noreferrer">
|
||||
<Frame>
|
||||
<img src="https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/906cac9-image.png?fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=c96bbea598140dba0164bbe3e4f61760" noZoom data-og-width="950" width="950" data-og-height="475" height="475" data-path="images/docs/906cac9-image.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/906cac9-image.png?w=280&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=d13a6c4da6429b209dae28775142ebe5 280w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/906cac9-image.png?w=560&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=b748519107cdd0675124d4d05f2da490 560w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/906cac9-image.png?w=840&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=0da19082bce7186cb4df2b8c67757994 840w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/906cac9-image.png?w=1100&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=33f43f5a4672be22b501a9c2c157e9ab 1100w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/906cac9-image.png?w=1650&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=fda02e234c3e0dcccef137eb1d0156cc 1650w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/906cac9-image.png?w=2500&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=dd24d20dd9bb7ae493d77aff4ec9b116 2500w" />
|
||||
</Frame>
|
||||
</a>
|
||||
|
||||
* [Import Crypto Prices in Microsoft Excel](https://www.coingecko.com/learn/import-crypto-prices-excel)
|
||||
|
||||
<a href="https://www.coingecko.com/learn/import-crypto-prices-excel" target="_blank" rel="noopener noreferrer">
|
||||
<Frame>
|
||||
<img src="https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/3ee7dca-image.png?fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=461979ff4f88f526da4d96325c619a55" noZoom data-og-width="1472" width="1472" data-og-height="704" height="704" data-path="images/docs/3ee7dca-image.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/3ee7dca-image.png?w=280&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=8a81f02bb6c2f787523cf1975ab6b56b 280w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/3ee7dca-image.png?w=560&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=0fedcd8efc2090812749d817ae172ffb 560w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/3ee7dca-image.png?w=840&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=0a6e2faa6f8aea908c5dbc92cd9f60fe 840w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/3ee7dca-image.png?w=1100&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=30b96b3f0d6a76a46758d91a20366ff0 1100w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/3ee7dca-image.png?w=1650&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=75654d488e16b4309623cc91391ed614 1650w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/3ee7dca-image.png?w=2500&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=f8d8aa22a51b94adc04decc40ba41f78 2500w" />
|
||||
</Frame>
|
||||
</a>
|
||||
|
||||
* [Create Portfolio Tracker in Microsoft Excel](https://www.coingecko.com/learn/crypto-portfolio-tracker-google-sheets)
|
||||
|
||||
<a href="https://www.coingecko.com/learn/crypto-portfolio-tracker-google-sheets" target="_blank" rel="noopener noreferrer">
|
||||
<Frame>
|
||||
<img src="https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/f4d47e2-image.png?fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=0820b04fd5f2d945e8618d88733a35a9" noZoom data-og-width="1200" width="1200" data-og-height="600" height="600" data-path="images/docs/f4d47e2-image.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/f4d47e2-image.png?w=280&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=ec9dc9ecacf4dea880bb9283043d54a5 280w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/f4d47e2-image.png?w=560&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=d8061f7df985a8e013b4f20b506ffcd1 560w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/f4d47e2-image.png?w=840&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=71545611aa35f6686853ff932713ec81 840w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/f4d47e2-image.png?w=1100&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=c563a701e58781f49d7db9020de3fa5c 1100w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/f4d47e2-image.png?w=1650&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=8ef6ecb51f3e8ecf5c0fe1d991bfc2e5 1650w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/f4d47e2-image.png?w=2500&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=74ab69e420239526560da774b35d35a4 2500w" />
|
||||
</Frame>
|
||||
</a>
|
||||
|
||||
* [Fetch Crypto Data Using Python](https://www.coingecko.com/learn/python-query-coingecko-api)
|
||||
|
||||
<a href="https://www.coingecko.com/learn/python-query-coingecko-api" target="_blank" rel="noopener noreferrer">
|
||||
<Frame>
|
||||
<img src="https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/bf15f91-image.png?fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=595e24814ec97ede65a775347cee4bca" noZoom data-og-width="950" width="950" data-og-height="473" height="473" data-path="images/docs/bf15f91-image.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/bf15f91-image.png?w=280&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=4bf00666cc1d6121a705b48ae386a7a9 280w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/bf15f91-image.png?w=560&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=4a27c38c5a4a49b15c1081922fa526f0 560w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/bf15f91-image.png?w=840&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=da86d2d15d228dfa49e4c4ac7214df31 840w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/bf15f91-image.png?w=1100&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=d8547008839925194e0ac89bf1436127 1100w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/bf15f91-image.png?w=1650&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=ee7fc9d6444ca624f93fd0f78afc893c 1650w, https://mintcdn.com/coingecko/M02rMX2XJMwBGpCe/images/docs/bf15f91-image.png?w=2500&fit=max&auto=format&n=M02rMX2XJMwBGpCe&q=85&s=98f982d6ba198a370c7ac0a089ef673b 2500w" />
|
||||
</Frame>
|
||||
</a>
|
||||
|
||||
---
|
||||
@@ -0,0 +1,154 @@
|
||||
# Coingecko - Reference
|
||||
|
||||
**Pages:** 9
|
||||
|
||||
---
|
||||
|
||||
## 💼 API Usage
|
||||
|
||||
**URL:** llms-txt#💼-api-usage
|
||||
|
||||
Source: https://docs.coingecko.com/reference/api-usage
|
||||
|
||||
reference/api-reference/coingecko-pro.json get /key
|
||||
This endpoint allows you to **monitor your account's API usage, including rate limits, monthly total credits, remaining credits, and more**
|
||||
|
||||
For a more comprehensive overview of your API usage, please log in to [https://www.coingecko.com/en/developers/dashboard](https://www.coingecko.com/en/developers/dashboard).
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## Supported Networks List (ID Map)
|
||||
|
||||
**URL:** llms-txt#supported-networks-list-(id-map)
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/networks-list
|
||||
|
||||
v3.0.1/reference/api-reference/onchain-demo.json get /networks
|
||||
This endpoint allows you to **query all the supported networks on GeckoTerminal**
|
||||
|
||||
* You may use this endpoint to query the list of networks with network ID for other endpoints that contain params like `network`.
|
||||
* You may include values such as `page` to specify which page of responses you would like to show.
|
||||
</Tip>
|
||||
|
||||
---
|
||||
|
||||
## Check API server status
|
||||
|
||||
**URL:** llms-txt#check-api-server-status
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/ping-server
|
||||
|
||||
v3.0.1/reference/api-reference/coingecko-demo.json get /ping
|
||||
This endpoint allows you to **check the API server status**
|
||||
|
||||
* You can also go to [status.coingecko.com](https://status.coingecko.com/) to check the API server status and further maintenance notices.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## Supported Currencies List
|
||||
|
||||
**URL:** llms-txt#supported-currencies-list
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/simple-supported-currencies
|
||||
|
||||
v3.0.1/reference/api-reference/coingecko-demo.json get /simple/supported_vs_currencies
|
||||
This endpoint allows you to **query all the supported currencies on CoinGecko**
|
||||
|
||||
* You may use this endpoint to query the list of currencies for other endpoints that contain params like `vs_currencies`.
|
||||
</Tip>
|
||||
|
||||
* Cache/Update Frequency: every 60 seconds for Public API.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## Asset Platforms List (ID Map)
|
||||
|
||||
**URL:** llms-txt#asset-platforms-list-(id-map)
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/asset-platforms-list
|
||||
|
||||
v3.0.1/reference/api-reference/coingecko-demo.json get /asset_platforms
|
||||
This endpoint allows you to **query all the asset platforms on CoinGecko**
|
||||
|
||||
* You may use this endpoint to query the list of asset platforms for other endpoints that contain params like `id` or`ids`(asset platforms).
|
||||
* You may include NFT at the `filter` params to get the list of NFT-support asset platforms on CoinGecko.
|
||||
</Tip>
|
||||
|
||||
---
|
||||
|
||||
## Past 24 Hour Trades by Pool Address
|
||||
|
||||
**URL:** llms-txt#past-24-hour-trades-by-pool-address
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/pool-trades-contract-address
|
||||
|
||||
v3.0.1/reference/api-reference/onchain-demo.json get /networks/{network}/pools/{pool_address}/trades
|
||||
This endpoint allows you to **query the last 300 trades in the past 24 hours based on the provided pool address**
|
||||
|
||||
* Cache/Update Frequency: every 60 seconds.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## Entities List (ID Map)
|
||||
|
||||
**URL:** llms-txt#entities-list-(id-map)
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/entities-list
|
||||
|
||||
v3.0.1/reference/api-reference/coingecko-demo.json get /entities/list
|
||||
This endpoint allows you to **query all the supported entities on CoinGecko with entities ID, name, symbol, and country**
|
||||
|
||||
* Cache / Update Frequency: every 5 minutes for all the API plans.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## Top Pools by Network
|
||||
|
||||
**URL:** llms-txt#top-pools-by-network
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/top-pools-network
|
||||
|
||||
v3.0.1/reference/api-reference/onchain-demo.json get /networks/{network}/pools
|
||||
This endpoint allows you to **query all the top pools based on the provided network**
|
||||
|
||||
* You may include values such as `page` to specify which page of responses you would like to show.
|
||||
* For more flexibility in retrieving an exact list of pools that match your specific needs, consider using the [/pools/megafilter](https://docs.coingecko.com/reference/pools-megafilter) endpoint (available for [Paid Plan](https://www.coingecko.com/en/api/pricing) subscribers \[Analyst plan or above].)
|
||||
</Tip>
|
||||
|
||||
* If the token's market cap is not verified by the team, the API response will return `null` for its market cap value, even though it has a displayed value on GeckoTerminal, which might not be accurate as it often matches the Fully Diluted Valuation (FDV).
|
||||
* Attributes specified in the `include` param will be returned under the top-level "included" key.
|
||||
* This endpoint returns up to 20 pools per page. Use the `page` param to navigate more results.
|
||||
* `page`: Pagination beyond 10 pages is available for [Paid Plan](https://www.coingecko.com/en/api/pricing) subscribers (Analyst plan or above).
|
||||
* Cache/Update frequency: every 60 seconds.
|
||||
* GeckoTerminal equivalent page (example): [https://www.geckoterminal.com/solana/pools?sort=-24h\_transactions](https://www.geckoterminal.com/solana/pools?sort=-24h_transactions)
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## Top Pools by Dex
|
||||
|
||||
**URL:** llms-txt#top-pools-by-dex
|
||||
|
||||
Source: https://docs.coingecko.com/v3.0.1/reference/top-pools-dex
|
||||
|
||||
v3.0.1/reference/api-reference/onchain-demo.json get /networks/{network}/dexes/{dex}/pools
|
||||
This endpoint allows you to **query all the top pools based on the provided network and decentralized exchange (DEX)**
|
||||
|
||||
* You may include values such as `page` to specify which page of responses you would like to show.
|
||||
* For more flexibility in retrieving an exact list of pools that match your specific needs, consider using the [/pools/megafilter](https://docs.coingecko.com/reference/pools-megafilter) endpoint (available for [Paid Plan](https://www.coingecko.com/en/api/pricing) subscribers \[Analyst plan or above].)
|
||||
</Tip>
|
||||
|
||||
* If the token's market cap is not verified by the team, the API response will return `null` for its market cap value, even though it has a displayed value on GeckoTerminal, which might not be accurate as it often matches the Fully Diluted Valuation (FDV).
|
||||
* Attributes specified in the `include` param will be returned under the top-level "included" key.
|
||||
* This endpoint returns up to 20 pools per page. Use the `page` param to navigate more results.
|
||||
* `page`: Pagination beyond 10 pages is available for [Paid Plan](https://www.coingecko.com/en/api/pricing) subscribers (Analyst plan or above).
|
||||
* Cache/Update frequency: every 60 seconds.
|
||||
* GeckoTerminal equivalent page (example): [https://www.geckoterminal.com/base/uniswap-v3-base/pools?sort=-24h\_transactions](https://www.geckoterminal.com/base/uniswap-v3-base/pools?sort=-24h_transactions)
|
||||
</Note>
|
||||
|
||||
---
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user