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 operations and api 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 --file options.
- Print the response body by default;
--include also shows status and headers. Handle empty responses, 207, NDJSON, and HTTP errors. Do not automatically retry writes.
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.
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; the npm 2.7.0 release does not include /raw. Verify existing commands and the new API entry against a local server before release.
Why
The CLI has useful
notesandfolderscommands, 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
apientry: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.--includealso shows status and headers. Handle empty responses, 207, NDJSON, and HTTP errors. Do not automatically retry writes.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.
Before release
This depends on the HackMD OpenAPI update and the API client PR. Publish a new API client version with
/rawand the registry, then pin it in the CLI; the npm2.7.0release does not include/raw. Verify existing commands and the new API entry against a local server before release.