360 Secure SkillHub
360 安全技能中心

Greptile

这是基于Greptile的代码库智能管理工具,需配置Greptile及GitHub/GitLab令牌使用。核心功能包括索引指定代码库分支、查看索引状态、AI式查询代码逻辑(附源码,可选增强分析)、关键词搜索代码片段。适用于架构分析、特定逻辑查询、PR审查等场景,通过命令行参数触发,输出结构化状态或带源码的结果。

iahmadzain
iahmadzain
热度 62.72
最近更新 2026-05-18 12:02:54
分类:开发依赖:代码执行 / 第三方 API应用场景:DevOps / 代码审查 / API 集成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add greptile
Metadata
name
greptile
description
Query, search, and manage repositories indexed by Greptile (AI codebase intelligence). Use when asking questions about a codebase, searching for code patterns, indexing repos for Greptile review, or checking Greptile index status. Requires GREPTILE_TOKEN and a GitHub/GitLab token.
metadata
{"openclaw":{"emoji":"🦎","publisher":"@iahmadzain","requires":{"env":["GREPTILE_TOKEN","GITHUB_TOKEN"],"bins":["curl","jq","gh"]}}}

Greptile Skill

Query and manage Greptile-indexed repositories via the REST API.

Setup

Required environment variables:

  • GREPTILE_TOKEN — Greptile API token (from https://app.greptile.com)
  • GITHUB_TOKEN — GitHub PAT with repo access (alternatively set GREPTILE_GITHUB_TOKEN, or authenticate via gh auth login — the script falls back to gh auth token)

Commands

All commands use scripts/greptile.sh (resolve path relative to this skill directory).

Index a repository

scripts/greptile.sh index owner/repo [branch] [--remote github|gitlab] [--no-reload] [--no-notify]

Default branch: main. Use --no-reload to skip re-indexing if already processed.

Check index status

scripts/greptile.sh status owner/repo [branch] [--remote github|gitlab]

Returns: status (completed/processing/failed), filesProcessed, numFiles.

Query a codebase (AI answer + sources)

scripts/greptile.sh query owner/repo [branch] "How does auth work?" [--genius] [--remote github|gitlab]
  • --genius — slower but smarter analysis (good for PR reviews, architecture questions)
  • Returns: AI-generated answer + source file references with line numbers

Search a codebase (sources only, no AI answer)

scripts/greptile.sh search owner/repo [branch] "payment processing" [--remote github|gitlab]

Returns: ranked list of relevant files, functions, and snippets with line numbers.

Tips

  • Always index a repo before querying/searching it. Check status to confirm indexing is complete.
  • Use query --genius for complex questions (architecture, PR review context, cross-file analysis).
  • Use search when you just need file locations without an AI explanation.
  • For GitLab repos, pass --remote gitlab.
  • Pipe output through jq for formatting: scripts/greptile.sh query ... | jq .
  • Multi-repo queries: not supported by the wrapper; use the API directly with multiple repositories in the body.