You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cloud serverless projects search create does not expose body fields (name, region_id) as flags #328
elastic cloud serverless projects search create --help exposes only generic flags (--input-file, --wait, --save-as, --credentials-file, --config-file, --force, --dry-run). The required body fields name and region_id are not available as flags, so creating a project requires writing a JSON file just to set two scalars.
Reproducer
$ elastic cloud serverless projects search create --help
Usage: elastic cloud serverless projects search create [options]
Create an Elasticsearch project
Options:
--input-file <path> path to a JSON file to use as command input
--dry-run validate all inputs and exit without performing any action
--wait Wait for the project to reach "initialized" phase before returning
--save-as <name> store returned credentials in the OS keychain and upsert a context of this name
--credentials-file <path> write credentials to a standalone YAML config fragment at this path (0600)
--config-file <path> override the config file written by --save-as
--force overwrite an existing context (--save-as) or file (--credentials-file)
-h, --help display help for command
This matches what sister CLIs (gcloud, aws) do, and what users likely expect given the rest of the CLI surface already does this elsewhere (e.g. es indices create --index <name>).
This likely applies to other create endpoints too, including cloud serverless projects observability create and cloud serverless projects security create.
After exploring this, I think the right fix is upstream in elastic/elastic-client-generator-js, not in this repo.
The generator currently emits cloud API definitions with no body field at all, so buildCommandSchema in src/cloud/register.ts has nothing to register as flags. The same gap affects every POST/PUT/PATCH cloud endpoint, not just these three create commands — deployments create, deployment-templates create, traffic-filters create, organization invitations, etc. all hit the same wall.
A hand-maintained overlay in this repo (I prototyped one in #351) would fix three endpoints but leaves the rest broken, and AGENTS.md "Lessons Learned" #4 explicitly cautions against this kind of special-casing in generic builders. One change in the generator that maps the OpenAPI request body to body: z.object({...}) solves every endpoint at once with no drift between codegen and overlay.
Closed #351. Next step is a PR upstream against elastic/elastic-client-generator-js so this and the analogous gaps on the other cloud endpoints all close together.
Activity
MattDevy commentedon May 19, 2026
After exploring this, I think the right fix is upstream in
elastic/elastic-client-generator-js, not in this repo.The generator currently emits cloud API definitions with no
bodyfield at all, sobuildCommandSchemainsrc/cloud/register.tshas nothing to register as flags. The same gap affects every POST/PUT/PATCH cloud endpoint, not just these three create commands — deployments create, deployment-templates create, traffic-filters create, organization invitations, etc. all hit the same wall.A hand-maintained overlay in this repo (I prototyped one in #351) would fix three endpoints but leaves the rest broken, and AGENTS.md "Lessons Learned" #4 explicitly cautions against this kind of special-casing in generic builders. One change in the generator that maps the OpenAPI request body to
body: z.object({...})solves every endpoint at once with no drift between codegen and overlay.Closed #351. Next step is a PR upstream against
elastic/elastic-client-generator-jsso this and the analogous gaps on the other cloud endpoints all close together.