Skip to content

Commit 5bcb768

Browse files
committed
docs: clean up a few mistakes
1 parent 795556c commit 5bcb768

13 files changed

Lines changed: 67 additions & 60 deletions

File tree

.claude/skills/gitcode-api/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ with GitCode(
112112

113113
## Repository-scoped defaults
114114

115-
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.
115+
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.
116116

117117
## Common resource groups
118118

.claude/skills/gitcode-api/references/workflow-patterns.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
pip install -U gitcode-api
99
```
1010

11-
2. Export a token if you do not want to pass `api_key=` explicitly:
11+
2. Export a token if you do not want to pass `api_key` explicitly:
1212

1313
```bash
1414
export GITCODE_ACCESS_TOKEN="your-token"
1515
```
1616

17-
If the token is encrypted, pass `decrypt=` on the client so it can decode an
18-
encrypted `api_key=` value or encrypted `GITCODE_ACCESS_TOKEN` at runtime.
17+
If the token is encrypted, pass `decrypt` on the client so it can decode an
18+
encrypted `api_key` value or encrypted `GITCODE_ACCESS_TOKEN` at runtime.
1919

2020
3. Decide whether your task is repository-scoped.
2121

22-
- Repository-scoped: set `owner=` and `repo=` on the client for convenience.
22+
- Repository-scoped: set `owner` and `repo` on the client for convenience.
2323
- Account-wide: use `users`, `orgs`, `search`, or `oauth` without repository defaults.
2424

25-
4. Prefer context managers so the underlying `httpx` client closes cleanly, including a supplied `http_client=`.
25+
4. Prefer context managers so the underlying `httpx` client closes cleanly, including a supplied `http_client`.
2626
5. If you need a runnable baseline, start from `examples/README.md` and the scripts in `examples/`.
2727

2828
## Pick the best reference
@@ -78,7 +78,7 @@ with GitCode(owner="SushiNinja", repo="GitCode-API") as client:
7878
## Common decision rules
7979

8080
- Need repository metadata, branches, commits, contents, issues, or pull requests:
81-
create the client with `owner=` and `repo=` up front.
81+
create the client with `owner` and `repo` up front.
8282
- Need current-user, organization, search, or OAuth actions:
8383
start with `GitCode()` or `AsyncGitCode()` and only add repo context if a later call needs it.
8484
- Need a quick demo or smoke test:
@@ -178,8 +178,8 @@ Symptom:
178178

179179
Fix:
180180

181-
- set `owner=` and `repo=` on the client, or
182-
- pass `owner=` and `repo=` to the specific call
181+
- set `owner` and `repo` on the client, or
182+
- pass `owner` and `repo` to the specific call
183183

184184
### HTTP errors
185185

@@ -205,7 +205,7 @@ Fix:
205205

206206
- prefer `with GitCode(...) as client:`
207207
- prefer `async with AsyncGitCode(...) as client:`
208-
- remember that closing the SDK client also closes a supplied `http_client=`
208+
- remember that closing the SDK client also closes a supplied `http_client`
209209

210210
## CLI helpers
211211

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Follow the existing style before introducing new abstractions.
7070
- Return typed `APIObject` subclasses or lists of them via `_model(...)` / `_models(...)` where possible.
7171
- Use `raw=True` only for endpoints that intentionally return bytes.
7272
- Prefer context managers in examples: `with GitCode(...) as client:` and `async with AsyncGitCode(...) as client:`.
73-
- Keep authentication behavior centered on `api_key=`, `GITCODE_ACCESS_TOKEN`, and optional `decrypt=`.
73+
- Keep authentication behavior centered on `api_key`, `GITCODE_ACCESS_TOKEN`, and optional `decrypt`.
7474
- Do not add network calls to unit tests; use `httpx.MockTransport`.
7575
- Keep `gitcode_api` passing `make lint` when changing public types or resource surfaces.
7676
- For `gitcode_api.llm`, preserve lazy loading via `llm/__getattr__` rather than importing FastMCP or heavy helpers at package import time.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Changes since `1.2.15`…`1.2.16`.
119119

120120
### Feature
121121

122-
- **Default CA Bundle:** When the internal `GitCode` client builds its own `httpx` client (you do not pass `http_client=`), verification uses the path from `GITCODE_CA_BUNDLE` if set, otherwise `REQUESTS_CA_BUNDLE` if set (same convention as many Python HTTP stacks), otherwise the default CA bundle is used. Applies to both `GitCode` and `AsyncGitCode`.
122+
- **Default CA Bundle:** When the internal `GitCode` client builds its own `httpx` client (you do not pass `http_client`), verification uses the path from `GITCODE_CA_BUNDLE` if set, otherwise `REQUESTS_CA_BUNDLE` if set (same convention as many Python HTTP stacks), otherwise the default CA bundle is used. Applies to both `GitCode` and `AsyncGitCode`.
123123

124124
---
125125

README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
# GitCode-API
2-
3-
[![PyPI - Version](https://img.shields.io/pypi/v/gitcode-api?link=https%3A%2F%2Fpypi.org%2Fproject%2Fgitcode-api%2F&uuid=96abf98469db4ee7bc12ded4646e76d9)](https://pypi.org/project/gitcode-api) [![PyPI Downloads](https://static.pepy.tech/personalized-badge/gitcode-api?period=total&units=INTERNATIONAL_SYSTEM&left_color=GRAY&right_color=RED&left_text=downloads&uuid=96abf98469db4ee7bc12ded4646e76d9)](https://pepy.tech/projects/gitcode-api)
4-
[![Install in Cursor](https://img.shields.io/badge/Install_in-Cursor-000000?logoColor=white)](https://cursor.com/en/install-mcp?name=GitCode%20API&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyItLWZyb20iLCJnaXRjb2RlLWFwaVttY3BdIiwiZ2l0Y29kZS1hcGkiLCJzZXJ2ZSJdLCJlbnYiOnsiR0lUQ09ERV9BQ0NFU1NfVE9LRU4iOiIke2lucHV0OmdpdGNvZGVfYWNjZXNzX3Rva2VufSJ9LCJpbnB1dHMiOlt7ImlkIjoiZ2l0Y29kZV9hY2Nlc3NfdG9rZW4iLCJ0eXBlIjoicHJvbXB0U3RyaW5nIiwiZGVzY3JpcHRpb24iOiJFbnRlciBHSVRDT0RFX0FDQ0VTU19UT0tFTiIsInBhc3N3b3JkIjp0cnVlfV19) [![Install in VS Code](https://img.shields.io/badge/Install_in-VS_Code-0098FF?logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect/mcp/install?name=GitCode%20API&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22--from%22%2C%22gitcode-api%5Bmcp%5D%22%2C%22gitcode-api%22%2C%22serve%22%5D%2C%22env%22%3A%7B%22GITCODE_ACCESS_TOKEN%22%3A%22%24%7Binput%3Agitcode_access_token%7D%22%7D%2C%22inputs%22%3A%5B%7B%22id%22%3A%22gitcode_access_token%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22Enter%20GITCODE_ACCESS_TOKEN%22%2C%22password%22%3Atrue%7D%5D%7D)
5-
[![GitHub Badge](https://img.shields.io/badge/github-repo-blue?logo=github&link=https%3A%2F%2Fgithub.com%2FTrenza1ore%2FGitCode-API)](https://github.com/Trenza1ore/GitCode-API) [![GitCode Badge](https://img.shields.io/badge/gitcode-repo-brown?logo=gitcode&link=https%3A%2F%2Fgitcode.com%2FSushiNinja%2FGitCode-API)](https://gitcode.com/SushiNinja/GitCode-API) [![CI Badge](https://github.com/Trenza1ore/GitCode-API/actions/workflows/check-code.yml/badge.svg?uuid=96abf98469db4ee7bc12ded4646e76d9)](https://github.com/Trenza1ore/GitCode-API/actions/workflows/check-code.yml/)
1+
# GitCode-API [![GitCode Badge](https://img.shields.io/badge/gitcode-brown?logo=gitcode&link=https%3A%2F%2Fgitcode.com%2FSushiNinja%2FGitCode-API)](https://gitcode.com/SushiNinja/GitCode-API) [![GitHub Badge](https://img.shields.io/badge/github-black?logo=github&link=https%3A%2F%2Fgithub.com%2FTrenza1ore%2FGitCode-API)](https://github.com/Trenza1ore/GitCode-API) [![CI Badge](https://github.com/Trenza1ore/GitCode-API/actions/workflows/check-code.yml/badge.svg?uuid=96abf98469db4ee7bc12ded4646e76d9)](https://github.com/Trenza1ore/GitCode-API/actions/workflows/check-code.yml/)
2+
[![PyPI - Version](https://img.shields.io/pypi/v/gitcode-api?link=https%3A%2F%2Fpypi.org%2Fproject%2Fgitcode-api%2F&uuid=96abf98469db4ee7bc12ded4646e76d9)](https://pypi.org/project/gitcode-api) [![PyPI Downloads](https://static.pepy.tech/personalized-badge/gitcode-api?period=total&units=INTERNATIONAL_SYSTEM&left_color=GRAY&right_color=BLUE&left_text=PyPI%20Downloads&uuid=96abf98469db4ee7bc12ded4646e76d9)](https://pepy.tech/projects/gitcode-api) ![MCP Bundle Downloads](https://img.shields.io/github/downloads/Trenza1ore/GitCode-API/total?style=flat&color=blue&logo=modelcontextprotocol&label=MCP%20Bundle%20Downloads)
63

74
[![Docs](https://img.shields.io/badge/%E6%96%87%E6%A1%A3-Docs-cyan?style=for-the-badge&logo=readthedocs&link=https%3A%2F%2Fgitcode-api.readthedocs.io%2Fen%2Flatest%2Findex.html)](https://gitcode-api.readthedocs.io) [![中文README](https://img.shields.io/badge/%E4%B8%AD%E6%96%87-README-brown?style=for-the-badge&logo=googledocs&link=README.zh.md)](README.zh.md)
85

9-
`gitcode-api` is a community-maintained Python SDK for the GitCode REST API. It provides easy-to-use synchronous and asynchronous clients, repository-scoped helpers, and lightweight response models so you can work with GitCode from Python without hand-writing raw HTTP requests. The `gitcode_api.llm` module adds an OpenAI-style function tool, an MCP service, and an [openJiuwen](https://openjiuwen.com) tool integration so agents can reuse the same resource-oriented API.
6+
`gitcode-api` is a community-maintained Python SDK for the GitCode REST API. It provides easy-to-use synchronous and asynchronous clients, helpers methods grouped by resource groups, and type-hinted response models so you can work with GitCode from Python without hand-writing raw HTTP requests. The `gitcode_api.llm` module adds an OpenAI-style function tool, an MCP service, and an [openJiuwen](https://openjiuwen.com) tool integration so agents can reuse the same resource-oriented API.
107

118
## Why This Project
129

1310
- Community project for developers who want a practical GitCode Python library.
1411
- Sync and async clients with a consistent API surface.
1512
- Convenient methods not offered by REST API directly: such as fetching Issue and PR templates.
1613
- Resource groups such as `client.repos`, `client.pulls`, and `client.users`.
17-
- Repository defaults via `owner=` and `repo=` on the client.
14+
- Repository defaults via `owner` and `repo` on the client.
1815
- Sphinx docs plus a mirrored GitCode REST API reference in `docs/`.
1916
- Provides MCP server, OpenAI tool, and [openJiuwen](https://openjiuwen.com) tool for LLM agent usage.
2017
- Provide MCP service that directly installs to your IDE of choice, such as Cursor and VS Code!
@@ -40,14 +37,14 @@ For detailed setup (including installing to services like Claude Code / Codex):
4037

4138
## Authentication
4239

43-
Pass `api_key=` directly, or set `GITCODE_ACCESS_TOKEN` in your environment:
40+
Pass `api_key` directly, or set `GITCODE_ACCESS_TOKEN` in your environment:
4441

4542
```bash
4643
export GITCODE_ACCESS_TOKEN="your-token"
4744
```
4845

49-
If your token is stored in encrypted form, pass `decrypt=` to decode either an
50-
encrypted `api_key=` value or an encrypted `GITCODE_ACCESS_TOKEN` value before
46+
If your token is stored in encrypted form, pass `decrypt` to decode either an
47+
encrypted `api_key` value or an encrypted `GITCODE_ACCESS_TOKEN` value before
5148
the client uses it.
5249

5350
```python
@@ -134,7 +131,7 @@ meta = as_dict(repo) # dict
134131

135132
### Context managers
136133

137-
`GitCode` and `AsyncGitCode` (and the lower-level `SyncAPIClient` / `AsyncAPIClient`) support `with` / `async with`. Leaving the block calls `close()` / `await close()` on the underlying client automatically, including a custom `http_client=` you passed in. `close()` also clears the LRU cache used by each resource group's `method_signature(...)` helper (see the [Available Resources](#available-resources) section).
134+
`GitCode` and `AsyncGitCode` (and the lower-level `SyncAPIClient` / `AsyncAPIClient`) support `with` / `async with`. Leaving the block calls `close()` / `await close()` on the underlying client automatically, including a custom `http_client` you passed in. `close()` also clears the LRU cache used by each resource group's `method_signature(...)` helper (see the [Available Resources](#available-resources) section).
138135

139136
```python
140137
from gitcode_api import GitCode
@@ -291,7 +288,7 @@ while True:
291288
pip install 'gitcode-api[mcp]'
292289
```
293290

294-
- **`create_mcp_server`** — builds a `FastMCP` instance with `gitcode_api_tool` already registered; optional `name=`, `tool=`, and extra keyword arguments are forwarded to `FastMCP(...)`.
291+
- **`create_mcp_server`** — builds a `FastMCP` instance with `gitcode_api_tool` already registered; optional `name`, `tool`, and extra keyword arguments are forwarded to `FastMCP(...)`.
295292
- **`GitCodeMCP`** — thin wrapper that constructs that server and registers the tool; unknown attributes are delegated to the underlying `FastMCP` object (for example transport helpers exposed by your FastMCP version).
296293
- **`create_mcp_gitcode_api_tool`** — returns the standalone async callable used as the tool body (for custom wiring).
297294
- **`register_mcp_gitcode_api_tool`** — attaches that callable to an existing FastMCP-compatible object (`mcp.tool(...)` or `mcp.add_tool(...)`).
@@ -305,7 +302,7 @@ mcp = create_mcp_server(name="GitCode API", owner="SushiNinja", repo="GitCode-AP
305302

306303
The same server is available from the CLI as `gitcode-api serve` (see the [CLI](#cli) section).
307304

308-
To share auth or clients across tools, build `GitCodeLLMTool` once (`from gitcode_api.llm._tool import GitCodeLLMTool`) and pass it as `tool=` into `GitCodeMCP`, `create_mcp_server`, `register_mcp_gitcode_api_tool`, or `create_mcp_gitcode_api_tool`.
305+
To share auth or clients across tools, build `GitCodeLLMTool` once (`from gitcode_api.llm._tool import GitCodeLLMTool`) and pass it as `tool` into `GitCodeMCP`, `create_mcp_server`, `register_mcp_gitcode_api_tool`, or `create_mcp_gitcode_api_tool`.
309306

310307
### openJiuwen (`LocalFunction`)
311308

@@ -323,7 +320,7 @@ jiuwen_tool = create_openjiuwen_gitcode_api_tool(owner="SushiNinja", repo="GitCo
323320
# await jiuwen_tool.invoke({"op_type": "repos", "action": "get", "params": {}})
324321
```
325322

326-
Optional `name=` and `description=` override the default tool card. Constructor options otherwise mirror `GitCode` / `AsyncGitCode` (`client=`, `async_client=`, `api_key=`, `owner=`, `repo=`, `base_url=`, `timeout=`, `decrypt=`).
323+
Optional `name` and `description` override the default tool card. Constructor options otherwise mirror `GitCode` / `AsyncGitCode` (`client`, `async_client`, `api_key`, `owner`, `repo`, `base_url`, `timeout`, `decrypt`).
327324

328325
**Claude Desktop (MCPB):** published GitHub Releases include a `gitcode-<version>.mcpb` bundle for one-click installation as a Claude Desktop extension; see Anthropic’s guide, [Build a desktop extension with MCPB](https://claude.com/docs/connectors/building/mcpb). From a checkout you can run `make mcpb` (requires the [`@anthropic-ai/mcpb`](https://www.npmjs.com/package/@anthropic-ai/mcpb) CLI on your `PATH`).
329326

@@ -394,7 +391,7 @@ with GitCode(
394391
395392
Use `httpx.AsyncClient(verify=...)` with `AsyncGitCode` for async code.
396393

397-
The OpenAI tool (`GitCodeOpenAITool`), MCP helpers, and `create_openjiuwen_gitcode_api_tool` accept the same `client=` / `async_client=` arguments (OpenAI and MCP also accept a shared `GitCodeLLMTool` via `tool=`). Build `GitCode` / `AsyncGitCode` with your custom `http_client` once and pass it through so LLM tool calls reuse the same TLS settings.
394+
The OpenAI tool (`GitCodeOpenAITool`), MCP helpers, and `create_openjiuwen_gitcode_api_tool` accept the same `client` / `async_client` arguments (OpenAI and MCP also accept a shared `GitCodeLLMTool` via `tool`). Build `GitCode` / `AsyncGitCode` with your custom `http_client` once and pass it through so LLM tool calls reuse the same TLS settings.
398395

399396
## Project Status
400397

0 commit comments

Comments
 (0)