elastic / elastic/cli

feat: store project id and type on --save-as

Open
#650 0 comments 0 reactions 0 assignees View on GitHub
cloud enhancement
Dominant language
TypeScript
Stars
41
Forks
24
Avg merge
1d 3h
Merged PRs (30d)
56

Description

`--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 `cloud` block on the new context (or copy it from `--use-context`)
- Store `project_id`, `project_type` (search / observability / security), and `region_id` on the context
- `elastic status --json` and `elastic config context list --json` show those fields

`reset-credentials --save-as ` 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.