Support the full v1 API through the generated API client
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- openapi, typescript
Rechercherichtung
Begin with the proposed api operations, api describe, and api call entry points, then inspect the generated client's vendored OpenAPI spec and @hackmd/api/raw. Confirm the API client version includes /raw and the registry before implementing. Done means existing commands still work and the new API entry handles the listed request, response, and error cases against a local server.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Why
The CLI has useful notes and folders commands, but adding a dedicated command for every v1 endpoint would duplicate the API client and leave coverage gaps.
Design
Keep all existing commands and add one generic api entry:
api operationsandapi describe <OperationId>read the installed API client registry offline. They do not claim that a connected EE server supports every operation.api call <OperationId>delegates to@hackmd/api/raw, using the existing token and endpoint settings. Accept explicit--path,--query,--header, JSON--body, and multipart--fileoptions.- Print the response body by default;
--includealso shows status and headers. Handle empty responses, 207, NDJSON, and HTTP errors. Do not automatically retry writes.
This follows the GitHub CLI gh api design: dedicated commands for common workflows, plus a generic API entry for broader coverage. We borrow the interface idea, but delegate requests to the API client rather than adding another HTTP transport.
Generate the operation registry from the API client's vendored OpenAPI spec. Do not download a spec at CLI runtime or add another HTTP transport.
Example
# GitHub CLI: a focused command and a generic API entry
gh issue list --repo OWNER/REPO
gh api repos/OWNER/REPO/issues --include
# HackMD CLI: the same two-layer idea
hackmd-cli notes --noteId=abc
hackmd-cli api describe GetNote
hackmd-cli api call GetNote --path noteId=abc --include
Before release
This depends on the HackMD OpenAPI update and the API client PR. Publish a new API client version with /raw and the registry, then pin it in the CLI.
Reference
hmd is another reference for operation discovery and generic HackMD API commands. It reads OpenAPI at runtime; our CLI instead uses the installed API client's generated registry and raw operations.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 176
- Forks
- 13
- Ø Merge
- 6 Std. 3 Min.
- Gemergte PRs (30 T.)
- 3
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus hackmdio/hackmd-cli
-
Config commandEvtl. vergeben @devKobe24 hat das vor 22 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
hackmdio/hackmd-cli#45 · 2 Kommentare ·
-
login problemOffen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
hackmdio/hackmd-cli#108 · 1 Kommentar ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
hackmdio/hackmd-cli#105 · 1 Reaktion ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 52/100
hackmdio/hackmd-cli#89 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
hackmdio/hackmd-cli#87 ·
Alle Issues in hackmdio/hackmd-cli
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
cameri/nostream#811 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug p3 triaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug javascript P2-medium python release:v3.1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
adrirubio/claude-deck#546 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: desktop area: website priority: P2 type: feature
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
appandflow/stim#3411 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
needs triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
rjsf-team/react-jsonschema-form#5485 ·
Maintainer antworten meist innerhalb von 2 Tagen