elastic-package CLI
When to use
Use this skill when tasks include:
- validating package structure and formatting
- building a package artifact
- running pipeline or system tests
- managing local Elastic test stack lifecycle
- installing or checking package status in Kibana
When not to use
Do not use this skill as the primary guide for:
- ECS field design decisions (use an ECS-focused skill)
- ingest processor design and parsing strategy (use an ingest-pipeline-focused skill)
- package layout architecture (use a package-structure-focused skill)
Prerequisites
elastic-package is installed and available in PATH
- container runtime is available (Docker or Podman)
- you run commands from a package directory (or pass
-C <package-dir>)
Core workflows
1) Validate and build loop
Run this sequence for routine local verification:
elastic-package format
elastic-package lint
elastic-package check
elastic-package build
Notes:
check runs lint and build together and fails fast by default.
- use
format --fail-fast when you want read-only verification without rewriting files.
2) Pipeline test loop (fast iteration)
Use Elasticsearch-only stack for quicker feedback:
elastic-package stack up -d --services=elasticsearch
elastic-package test pipeline
elastic-package test pipeline --generate
Then review generated expected files before keeping changes.
3) System test loop (end-to-end)
Use this when you need full ingest behavior with service provisioning:
elastic-package stack up -d
elastic-package service up
elastic-package test system
Use --data-streams <name> to scope tests and reduce run time.
Practical command examples
# format package files
elastic-package format
# lint against package spec and templates
elastic-package lint
# combined validation workflow
elastic-package check
# build package artifact
elastic-package build
# start only Elasticsearch for pipeline tests
elastic-package stack up -d --services=elasticsearch
# run pipeline tests
elastic-package test pipeline
# regenerate expected pipeline outputs
elastic-package test pipeline --generate
# run end-to-end system tests
elastic-package test system
Key flags cheat sheet
- global:
-C, --change-directory, -v, --verbose
- stack:
-d, --daemon, -s, --services, --version, -p, --profile
- pipeline tests:
-d, --data-streams, -g, --generate, -m, --fail-on-missing
- system tests:
--setup, --tear-down, --no-provision, --variant
Quick command map
- validate/build:
format, lint, check, build
- stack lifecycle:
stack up, stack status, stack down
- testing:
test pipeline, test system, test static, test asset, test policy, test script
- package lifecycle:
create, install, status, uninstall
- support:
service up, profiles, benchmark
References
- Failure diagnosis and fixes:
references/troubleshooting.md
1---
2name: elastic-package-cli
3description: "Use when developing or validating Elastic integrations with elastic-package commands such as build, check, lint, format, test, stack, service, install, profiles, and benchmark."
4license: Apache-2.0
5metadata:
6 source: https://skillmd.com/skills/elastic/elastic-package-cli
7 author: elastic
8 version: "1.0"
9---
10
11# elastic-package CLI
12
13
14## When to use
15
16Use this skill when tasks include:
17- validating package structure and formatting
18- building a package artifact
19- running pipeline or system tests
20- managing local Elastic test stack lifecycle
21- installing or checking package status in Kibana
22
23## When not to use
24
25Do not use this skill as the primary guide for:
26- ECS field design decisions (use an ECS-focused skill)
27- ingest processor design and parsing strategy (use an ingest-pipeline-focused skill)
28- package layout architecture (use a package-structure-focused skill)
29
30## Prerequisites
31
32- `elastic-package` is installed and available in `PATH`
33- container runtime is available (Docker or Podman)
34- you run commands from a package directory (or pass `-C <package-dir>`)
35
36## Core workflows
37
38### 1) Validate and build loop
39
40Run this sequence for routine local verification:
41
42```bash
43elastic-package format
44elastic-package lint
45elastic-package check
46elastic-package build
47```
48
49Notes:
50- `check` runs lint and build together and fails fast by default.
51- use `format --fail-fast` when you want read-only verification without rewriting files.
52
53### 2) Pipeline test loop (fast iteration)
54
55Use Elasticsearch-only stack for quicker feedback:
56
57```bash
58elastic-package stack up -d --services=elasticsearch
59elastic-package test pipeline
60elastic-package test pipeline --generate
61```
62
63Then review generated expected files before keeping changes.
64
65### 3) System test loop (end-to-end)
66
67Use this when you need full ingest behavior with service provisioning:
68
69```bash
70elastic-package stack up -d
71elastic-package service up
72elastic-package test system
73```
74
75Use `--data-streams <name>` to scope tests and reduce run time.
76
77## Practical command examples
78
79```bash
80# format package files
81elastic-package format
82
83# lint against package spec and templates
84elastic-package lint
85
86# combined validation workflow
87elastic-package check
88
89# build package artifact
90elastic-package build
91
92# start only Elasticsearch for pipeline tests
93elastic-package stack up -d --services=elasticsearch
94
95# run pipeline tests
96elastic-package test pipeline
97
98# regenerate expected pipeline outputs
99elastic-package test pipeline --generate
100
101# run end-to-end system tests
102elastic-package test system
103```
104
105## Key flags cheat sheet
106
107- global: `-C, --change-directory`, `-v, --verbose`
108- stack: `-d, --daemon`, `-s, --services`, `--version`, `-p, --profile`
109- pipeline tests: `-d, --data-streams`, `-g, --generate`, `-m, --fail-on-missing`
110- system tests: `--setup`, `--tear-down`, `--no-provision`, `--variant`
111
112## Quick command map
113
114- validate/build: `format`, `lint`, `check`, `build`
115- stack lifecycle: `stack up`, `stack status`, `stack down`
116- testing: `test pipeline`, `test system`, `test static`, `test asset`, `test policy`, `test script`
117- package lifecycle: `create`, `install`, `status`, `uninstall`
118- support: `service up`, `profiles`, `benchmark`
119
120## References
121
122- Failure diagnosis and fixes: `references/troubleshooting.md`
123