Token导航 LogoToken导航TokenDH.com
研究检索敏感数据clawhub未标认证来源可访问clear审计通过

gitcode-apigitcode API 搜索

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

2,995

周安装

120

GitHub Stars

1

下载量

970
OpenClaw

安装说明

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

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:gitcode-api(gitcode API 搜索)
来源仓库:https://github.com/trenza1ore/gitcode-api
安装命令:
openclaw skills install gitcode-api
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

ClawHubOpenClaw
openclaw skills install gitcode-api

简介

通过同步/异步客户端、存储库帮助程序和 CLI 脚本,提供对 GitCode REST API 的 Python SDK 访问,用于管理存储库、拉取、用户和搜索。

SKILL.md

name
gitcode-api
description
|
metadata
version
1.1.0

GitCode API SDK

Use the published Python package:

pip install -U gitcode-api

Authentication defaults to the GITCODE_ACCESS_TOKEN environment variable, or pass api_key=... explicitly. If either value is encrypted, pass decrypt=... so the client can decode it before authenticating.

Confirm with user before installation or setup environment variable

Consult user for confirmation before installation:

  • like all python packages, installing gitcode-api may introduce change to global environment.
  • when user ask for additional information, you may guide them to:

- the project's pypi page: https://pypi.org/project/gitcode-api/ - documentation: https://gitcode-api.readthedocs.io/ - source repository: https://github.com/Trenza1ore/GitCode-API

  • ask user to provide the GITCODE_ACCESS_TOKEN environment variable, preferably encrypted:

- environment variable may be read by untrusted software as that is not unscoped. - a decrypt argument can be passed into GitCode clients' constructor to decrypt an encrypted api_key value or encrypted GITCODE_ACCESS_TOKEN at runtime.

Client shape

This SDK is structured similarly to OpenAI's Python clients:

  • Start from a top-level client object: GitCode(...) or AsyncGitCode(...).
  • Call resource groups off the client, such as client.repos, client.pulls, client.users, and client.search.
  • Invoke methods on those resource groups, such as client.repos.get() or await client.pulls.list().
  • Each resource group exposes methods (public callable names in stable SDK order via a segment-based sorting) and method_signature(name) (a cached inspect.signature string for one callable) for runtime introspection; see the "Resource introspection" section in references/api-reference.md.
  • Prefer with GitCode(...) as client: or async with AsyncGitCode(...) as client: so the SDK closes the underlying httpx client automatically, including a custom http_client.

Unlike OpenAI's typed request/response shapes, this SDK focuses on GitCode REST resources and returns lightweight response objects with attribute access.

Quick start

Sync:

from gitcode_api import GitCode

with GitCode(
    api_key="your-token",
    owner="SushiNinja",
    repo="GitCode-API",
) as client:
    repo = client.repos.get()
    pulls = client.pulls.list(state="open", per_page=5)
    print(repo.full_name)
    for pull in pulls:
        print(pull.number, pull.title)

Async:

import asyncio
from gitcode_api import AsyncGitCode

async def main() -> None:
    async with AsyncGitCode(
        api_key="your-token",
        owner="SushiNinja",
        repo="GitCode-API",
    ) as client:
        branches = await client.branches.list(per_page=5)
        for branch in branches:
            print(branch.name)

asyncio.run(main())

Encrypted token:

from gitcode_api import GitCode
from trusted_library import decryption_method

with GitCode(
    api_key="encrypted-token",
    owner="SushiNinja",
    repo="GitCode-API",
    decrypt=decryption_method,
) as client:
    repo = client.repos.get()
    pulls = client.pulls.list(state="open", per_page=5)
    print(repo.full_name)
    for pull in pulls:
        print(pull.number, pull.title)

Repository-scoped defaults

If owner= and repo= are set on the client, repository resources can omit them per call. If not, pass owner= and repo= on repository-scoped methods.

Common resource groups

  • client.repos and client.contents
  • client.branches and client.commits
  • client.issues and client.pulls
  • client.labels, client.milestones, and client.members
  • client.releases, client.tags, and client.webhooks
  • client.users, client.orgs, client.search, and client.oauth

Common tasks

  • Repository info and file content:

client.repos.get(), client.contents.get(), client.contents.create(), client.contents.update()

  • Branches, commits, and diffs:

client.branches.list(), client.commits.list(), client.commits.compare()

  • Issues and pull requests:

client.issues.list(), client.issues.create(), client.pulls.list(), client.pulls.create(), client.pulls.merge()

  • Account and discovery:

client.users.me(), client.orgs.list_authenticated(), client.search.repositories()

  • OAuth:

client.oauth.build_authorize_url(), client.oauth.exchange_token()

For the broader method inventory, use references/api-reference.md

Response objects

Responses are lightweight objects, not plain dicts.

Typical usage:

pull = client.pulls.get(number=42)
print(pull.title)
print(pull.get("source_branch"))
payload = pull.to_dict()

Utility scripts

Bundled helpers:

  • scripts/check_env.py verifies Python, package import, and token setup.
  • scripts/gitcode_api_cli.py is a legacy example CLI (deprecated; it warns on use). Prefer the package's experimental built-in CLI (gitcode-api or python -m gitcode_api); see https://gitcode-api.readthedocs.io/en/latest/sdk/cli.html. For production, keep tokens out of argv and use env vars or your own wrapper.

Additional resources

FAQ


Q: In company network, access to GitCode failed with SSL errors mentioning "self-signed certificate". A: Typically, a custom CA bundle needs to be set, user may pass in a custom httpx client with verify set to the certificate path, this is similar to REQUESTS_CA_BUNDLE environment variable for requests library.

from gitcode_api import GitCode
from httpx import Client

with GitCode(
    owner="SushiNinja",
    repo="GitCode-API",
    http_client=Client(verify="path/to/my/certificate.crt"),
) as client:
    repo = client.repos.get()
    pulls = client.pulls.list(state="open", per_page=5)
    ...

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

OpenClaw

97.28%
按下载量换算944

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

来源信息

继续浏览同类 Skills