grape-cli 0.3.4__tar.gz → 0.3.5b1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/PKG-INFO +1 -1
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/grape_cli/__init__.py +1 -1
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/grape_cli/client.py +14 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/grape_cli/data/examples.json +4 -0
- grape_cli-0.3.5b1/grape_cli/data/openapi.json +1 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/grape_cli/update_check.py +68 -14
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/grape_cli.egg-info/PKG-INFO +1 -1
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/test/test_client.py +30 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/test/test_update_check.py +140 -1
- grape_cli-0.3.4/grape_cli/data/openapi.json +0 -1
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/LICENSE +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/README.md +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/grape_cli/__main__.py +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/grape_cli/cli.py +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/grape_cli/commands/__init__.py +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/grape_cli/commands/doctor.py +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/grape_cli/commands/git.py +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/grape_cli/config.py +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/grape_cli/contracts.py +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/grape_cli/data/token-scope.json +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/grape_cli/registry.py +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/grape_cli.egg-info/SOURCES.txt +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/grape_cli.egg-info/dependency_links.txt +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/grape_cli.egg-info/entry_points.txt +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/grape_cli.egg-info/requires.txt +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/grape_cli.egg-info/top_level.txt +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/pyproject.toml +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/setup.cfg +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/test/test_cli.py +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/test/test_config.py +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/test/test_contracts.py +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/test/test_doctor.py +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/test/test_dry_run.py +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/test/test_git.py +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/test/test_json_file.py +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/test/test_prefix_overlap.py +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/test/test_pulls_files_pagination.py +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/test/test_registry.py +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/test/test_release_note.py +0 -0
- {grape_cli-0.3.4 → grape_cli-0.3.5b1}/test/test_version.py +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""grape CLI 独立包(Issue-45 M4)。"""
|
|
2
|
-
__version__ = "0.3.
|
|
2
|
+
__version__ = "0.3.5b1"
|
|
@@ -172,6 +172,12 @@ class ApiClient:
|
|
|
172
172
|
def __init__(self, base_url: str = "", token: str = "", channel: str = "bearer",
|
|
173
173
|
timeout: int = 0, *, require_token: bool = True):
|
|
174
174
|
self.base_url, self.token = config.resolve(base_url, token)
|
|
175
|
+
# P2-15:base_url 来源(default / env / config.json)——ConnectError 时区分
|
|
176
|
+
# "没配地址"与"配了但服务挂",default 时给生产地址引导。
|
|
177
|
+
try:
|
|
178
|
+
_, self.base_url_source, _ = config.resolve_with_source(base_url, token)
|
|
179
|
+
except Exception:
|
|
180
|
+
self.base_url_source = ""
|
|
175
181
|
self.channel = channel # bearer / PRIVATE-TOKEN / access_token
|
|
176
182
|
self.timeout = int(timeout or 0) or config.cli_timeout()
|
|
177
183
|
# 契约拉取(/static/openapi.json)为公开端点,不需要 token
|
|
@@ -246,6 +252,14 @@ class ApiClient:
|
|
|
246
252
|
trust_env=trust,
|
|
247
253
|
)
|
|
248
254
|
except httpx.ConnectError as e:
|
|
255
|
+
# P2-15(CodeArts E2E 报告):默认 localhost:8000 连不上时,用户看到的
|
|
256
|
+
# 只是 Connection refused——分不清"服务挂了"还是"没配地址"。base 来自
|
|
257
|
+
# 默认回落时补显式引导;显式配置的地址保持原提示(不越界猜测用户意图)。
|
|
258
|
+
if getattr(self, "base_url_source", "") == "default (http://localhost:8000)":
|
|
259
|
+
raise CliError(
|
|
260
|
+
f"服务地址未配置(当前用默认 {self.base_url},连接失败:{e})。"
|
|
261
|
+
f"生产环境请 export GRAPE_BASE_URL=https://www.grapedev.cn,"
|
|
262
|
+
f"或写入 ~/.grape/config.json 的 base_url;本地开发确认服务已启动")
|
|
249
263
|
raise CliError(f"base_url unreachable: {self.base_url} ({e})")
|
|
250
264
|
except httpx.TimeoutException as e:
|
|
251
265
|
raise CliError(
|
|
@@ -74,6 +74,10 @@
|
|
|
74
74
|
"chat_conversations": "--json-out",
|
|
75
75
|
"chat_messages": "--conversation_id <id> --json-out",
|
|
76
76
|
"repos_member": "--json-out",
|
|
77
|
+
"repos_create_targets": "--provider gitlab --json-out",
|
|
78
|
+
"repos_connection_get": "--provider gitlab --json-out",
|
|
79
|
+
"repos_connection_put": "--provider gitlab --json '{\"token\":\"<instance-pat>\",\"login\":\"<account>\"}'",
|
|
80
|
+
"repos_connection_delete": "--provider gitlab",
|
|
77
81
|
"repos_managed": "--json-out",
|
|
78
82
|
"repos_deploy_url": "--owner o --repo r --json-out",
|
|
79
83
|
"knowledge_list": "--json-out",
|