feat: store project id and type on --save-as
Author: margaretjguCreated Sep 14, 2026Updated Sep 14, 2026
Labelsenhancementcloud
--save-as writes elasticsearch and kibana blocks only (src/cloud/credentials.ts buildProjectContext). The Cloud block and the project id are dropped. Later reset-credentials, patch, or delete need --id from memory or from the create JSON.
On --save-as:
- Keep the active
cloudblock on the new context (or copy it from--use-context) - Store
project_id,project_type(search / observability / security), andregion_idon the context elastic status --jsonandelastic config context list --jsonshow those fields
reset-credentials --save-as <same-name> should resolve --id from the context when omitted.
Acceptance: create with --save-as demo, then elastic --use-context demo cloud serverless projects observability get works without --id. Context YAML has cloud plus project metadata. Tests cover create and reset.
Source: elastic/cli