| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
First substantial commit of oed-cli, the openEuler Infra command line. A single binary that auto-discovers its entire command surface from the gateway's OpenAPI Discovery Service and dispatches calls through the production gateway at https://apig.osinfra.cn. User-facing surface - Reserved commands: info, services, schema, cache, --version - Dynamic dispatch: oed -- - Per-parameter flag derivation from the OpenAPI schema (kebab-case with raw-name fallback, integer / number auto-coercion) - APIG "API_" prefix auto-stripping on operationIds — user-facing names drop it, the raw form stays as a lookup alias - WAF-safe browser headers baked into the HTTP client so calls pass the gateway's CloudWAF without manual curl-fu - 10-minute local cache (XDG / %LOCALAPPDATA%) for both the discovery feed and per-service OpenAPI specs; force-refresh via oed cache refresh - Deterministic exit codes: 0 success / 1 user / 2 network / 3 upstream / 4 not-found — clean stdout/stderr split so | jq is always safe Runtime routing - All calls go through https://apig.osinfra.cn. The spec's x-apigateway-backend.httpEndpoints.address is parsed only for method / scheme and never trusted as the host, because real specs (e.g. cve-sa-backend) point to *.test.osinfra.cn staging hosts that CloudWAF blocks. Test suite - 41 fully offline tests covering dynamic dispatch, per-param flag coercion, the API_ alias, and every exit-code path. Discovery is monkeypatched so pytest never touches the network. Developer / agent scaffolding - CLAUDE.md — entry point for AI coding agents, with directory map, dev loop, agent red-lines, and self-check checklist - .claude/skills/oed-cli/SKILL.md — Agent skill for using oed, plus a DEVELOPING section for modifying it - .claude/settings.json + .claude/hooks/post-edit-check.py — PostToolUse hook that runs ruff + pytest after every .py edit - .pypirc.template + docs/pypi-release.md — twine-based local PyPI release runbook (no CI) Documentation - README.md — install, Quickstart (cve-sa-backend canonical example), command contract, cache sync, troubleshooting - docs/cli-design.md — design rationale, module map, roadmap - docs/local-testing.md — every per-param flag demo + smoke tests against the live gateway Co-Authored-By: MiniMax-M3 | 2 个月前 |