@hagicode/cli 0.1.0-dev.31.1.bcd050b → 0.1.0-dev.32.1.c8f71ee

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.
package/README.md CHANGED
@@ -94,7 +94,7 @@ If none of the three is set, the command exits with code `2` and sends no backen
94
94
 
95
95
  Operation commands send requests without a credential by default. Pass `--token` (or set `HAGI_API_TOKEN`) only when your backend requires one.
96
96
 
97
- When the backend cannot be reached, the CLI names the base URL and exits with code `60`. A backend HTTP error is reported differently: it prints the HTTP status and the backend error message, and exits with a status-mapped code.
97
+ When the backend cannot be reached, the CLI names the base URL and exits with code `60`. A backend failure is reported differently: it prints the HTTP-equivalent status of the gRPC status and the backend error message, and exits with a status-mapped code.
98
98
 
99
99
  ```text
100
100
  $ hagi --base-url http://127.0.0.1:1 project list
@@ -585,9 +585,15 @@ The CLI resolves runtime settings centrally before every command. Explicit flags
585
585
  | `HAGI_API_TOKEN` | Bearer token attached as `Authorization: Bearer <token>`. |
586
586
  | `HAGI_API_LANG` | Shared `Accept-Language` header value. |
587
587
 
588
+ ## Backend Transport
589
+
590
+ The CLI talks to the backend over gRPC-Web only. It appends `/grpc` to the base URL (for example `http://127.0.0.1:35167/grpc`) and calls the `hagicode.*.v1` services; no REST route is used. gRPC-Web runs over HTTP/1.1, so it works against the plain-HTTP local backend and through reverse proxies. The bearer token, `Accept-Language` and the `X-Hagi-Client` marker travel as request headers. The backend therefore has to expose its `/grpc` endpoints.
591
+
592
+ gRPC status codes keep the exit codes below: `InvalidArgument` is `20`, `Unauthenticated` `21`, `PermissionDenied` `23`, `NotFound` `24`, `FailedPrecondition`, `AlreadyExists` and `Aborted` `29`, other client-side statuses `40`, and `Internal`, `Unavailable`, `DeadlineExceeded` and the rest `50`. The status line in error output (`status=404`) shows the HTTP-equivalent number.
593
+
588
594
  ## Exit Codes
589
595
 
590
- Stable non-zero exits used by the CLI:
596
+ Stable non-zero exits used by the CLI. The HTTP numbers are the equivalents of the gRPC status the backend answered with:
591
597
 
592
598
  | Exit code | Meaning |
593
599
  | --- | --- |