Improve `posit connect api ...` ux
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- openapi, python
- Lĩnh vực
- api, cli, documentation
Hướng nghiên cứu
Bắt đầu bằng cách lần theo lệnh hiện có posit connect api và pipeline request RSConnectExecutor/RSConnectClient của nó, sau đó kiểm tra skills/posit-cli/SKILL.md. Xem xét danh mục OpenAPI và hành vi của các flag dùng chung trước khi quyết định phạm vi triển khai. Công việc được xem là hoàn tất khi tìm kiếm offline và các mô tả JSON hoạt động, api call tái sử dụng hành vi request raw với việc định tuyến tham số chính xác, các raw path vẫn được hỗ trợ, và các test được ghi trong tài liệu cùng các cập nhật skill đã hoàn tất.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
posit connect api <path> already provides authenticated, gh api-style raw requests. Improve it with on-demand OpenAPI metadata so people and coding agents can discover and use Connect endpoints correctly without loading the entire API specification into their context.
Proposed experience
posit connect api search content
posit connect api describe getContent
posit connect api describe getContent --json
posit connect api call getContent -F guid=... --jq ".title"
The exact discovery command names are open to refinement. The important workflow is: search for an operation, retrieve concise machine-readable instructions, then execute it through the existing authenticated transport. Raw path calls must remain available as an escape hatch.
describe --json should return only the context needed to make a correct request:
- operation ID, method, and path
- short purpose and relevant deprecation/experimental status
- required and optional path/query parameters
- accepted request media types and request-body schema
- response schema and media types
- pagination style
- one concise example
api call compatibility
posit connect api call <operationId> must be another entry point into the existing posit connect api request pipeline, not a separate or reduced client. It should infer the documented method and path from the operation catalog, substitute documented path parameters, and then accept the existing command arguments and flags wherever they apply.
This includes:
-X/--method-f/--raw-fieldand-F/--field-H/--header--input-q/--jq-i/--include--paginateand future--slurp-n/--name,-s/--server, and-k/--api-key--no-tls-verifyand-c/--cacert- future shared output/transport options such as
--output,--silent, and--verbose
Avoid duplicating Click option declarations or request-building behavior. Extract and reuse shared option decorators, request models, or execution functions so raw-path and operation-ID calls remain behaviorally consistent. OpenAPI metadata may provide defaults and hints, but explicit user flags retain their normal meaning and precedence.
Examples:
posit connect api call getContent -F guid=CONTENT_GUID --jq ".title"
posit connect api call getContents -f limit=20 --paginate --jq ".results[] | .name"
posit connect api call updateContent -F guid=CONTENT_GUID -f title="New title" -H "X-Correlation-ID: 123"
posit connect api call getContent -F guid=CONTENT_GUID -s https://connect.example.com -k "$CONNECT_API_KEY"
The implementation must distinguish path parameters from query parameters and request-body fields using the operation metadata. If a field name is ambiguous, require an explicit syntax rather than silently routing it incorrectly.
OpenAPI strategy
- Generate a compact, data-only operation catalog from a pinned Connect OpenAPI specification at build time.
- Use the catalog for search, descriptions, shell completion, request hints, path-parameter substitution, and agent context.
- Keep request execution schema-independent so unknown, experimental, newer, and server-specific endpoints continue to work through
posit connect api <path>. - Do not generate or maintain a second HTTP client; reuse the existing
RSConnectExecutor/RSConnectClientauthentication and OAuth refresh behavior. - Consider optional per-server runtime refresh later, with ETag/Last-Modified caching, atomic replacement, stale-cache fallback, size limits, and no credentials in the cache. Do not make help or raw requests depend on network access.
- Treat schemas as guidance and optional validation, not a mandatory gate.
Concise agent skill
Update the existing skills/posit-cli/SKILL.md as part of this work. The skill should remain concise and use progressive disclosure rather than embedding the endpoint catalog or full schemas.
It should teach this workflow:
Before calling an unfamiliar endpoint, run
posit connect api search. Then runposit connect api describe <operationId> --json. Useposit connect api call <operationId>with the normalposit connect apiflags. Fall back toposit connect api <path>when the operation is absent from the bundled catalog.
The skill should include:
- when to use raw-path calls versus operation-ID calls
- the search, describe, call, and raw fallback workflow
- a compact explanation that
api callaccepts the existing request, output, authentication, and TLS flags - one read example, one write example, and one pagination example
- guidance to inspect
describe --jsoninstead of guessing parameter placement or payload shape - guidance not to load or paste the complete OpenAPI document into context
- a reminder that explicit CLI help is the source of truth for flags
Do not duplicate all endpoint descriptions in AGENTS.md, the skill, or a global prompt. Keep durable instructions small and retrieve operation details only when needed.
Common endpoint guidance
The skill should also include a compact quick reference for the most frequently useful Connect API areas. Keep this curated rather than exhaustive: roughly 8-12 entries, each with the endpoint or operation name, its common purpose, and one important usage note.
At minimum, cover:
v1/userfor confirming authentication and inspecting the current userv1/contentandv1/content/{guid}for finding, inspecting, creating, and updating contentv1/content/{guid}/permissionsfor reviewing and managing content accessv1/usersandv1/groupsfor administrative identity lookup and paginationv1/audit_logsfor operational and security investigation- content jobs for status, logs, and troubleshooting
- schedules for listing and managing scheduled execution
- content environment variables, with explicit guidance about sensitive values
- server information/settings for version and capability checks
For each area, provide basic direction such as whether it is normally a read or write operation, whether administrator permissions are commonly required, whether pagination applies, and whether a higher-level posit connect command should be preferred. For example, routine deployment should point agents toward posit connect deploy rather than teaching them to manually reproduce the bundle/build/deploy sequence through raw API calls.
Use these entries as orientation and examples, not as a substitute for api describe --json. The skill must tell agents to inspect live command help and operation metadata before writes, deletes, permission changes, or requests involving secrets.
Raw command improvements
Harden the existing command where needed to cover the OpenAPI surface:
- Preserve binary request and response bodies; read
--inputas bytes and support byte-safe output/downloads. - Avoid monkey-patching rsconnect
_tweak_response; request raw responses and decode locally. - Match
gh apisemantics when combining--inputand fields: body from input, fields in the query string. - Preserve repeated query parameters.
- Add nested/array field syntax or clearly direct complex requests to
--input. - Define pagination output explicitly and consider
--slurp; avoid silently discarding paging metadata. - Detect repeated cursors/URLs, preserve original query parameters, and validate next-page targets.
- Consider
--output,--silent, and credential-redacted--verbosesupport.
Acceptance criteria
- Users and agents can search operations without reading the full OpenAPI document.
describe --jsonprovides sufficient context to construct a correct request for documented JSON endpoints.api call <operationId>reuses the existing request pipeline and supports the applicable existingposit connect apiflags and arguments.- Operation metadata correctly distinguishes and routes path, query, and body values.
- Discovery works offline from bundled metadata.
- Existing
posit connect api <path>behavior remains supported for endpoints absent from the catalog. - The bundled agent skill documents the concise search/describe/call/raw workflow and a curated high-value endpoint quick reference without embedding the full endpoint catalog.
- Generated metadata is deterministic and its source spec/version/hash are recorded.
- Tests cover metadata generation, lookup, concise JSON output, unknown operations, deprecated/experimental operations, representative path/query/body schemas, shared flag behavior on
api call, and raw fallback behavior.
Non-goals
- Generating a full typed Python client.
- Dynamically registering all OpenAPI operations as permanent top-level Click commands.
- Rejecting raw requests because an endpoint or payload is absent from the bundled specification.
- Embedding the full OpenAPI specification or every endpoint description in agent instructions.
- Ngôn ngữ chính
- Python
- Star
- 3
- Fork
- 0
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của posit-dev/posit-cli
-
Add `posit connect version`Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Add dependabotĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
-
Add CIĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Tất cả issue của posit-dev/posit-cli
Issue tương tự
-
changelog investigate
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
ramnes/notion-sdk-py#409 ·
-
good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
lindicaphxag-tech/kaggle#28 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
BSData/horus-heresy-3rd-edition#3211 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày