Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
Makefile @elastic/ecosystem
internal/install/stack_version.go @elastic/ecosystem
internal/stack/versions.go @elastic/ecosystem

# LLM based functionality owned by integration-experience
internal/llmagent/ @elastic/integration-experience
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ new_package

# default output directory for dump commands
package-dump

.cursor/

batch_results/
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is batch_results?

121 changes: 120 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ This command combines query capabilities with command execution, allowing you to
The command uses the same query flags as the 'find' command to select packages, then executes the specified subcommand for each matched package.

Allowed subcommands:
build, check, changelog, clean, format, install, lint, test, uninstall
build, check, changelog, clean, format, install, lint, test, uninstall, update

### `elastic-package format`

Expand Down Expand Up @@ -702,6 +702,30 @@ Use this command to uninstall the package in Kibana.

The command uses Kibana API to uninstall the package in Kibana. The package must be exposed via the Package Registry.

### `elastic-package update`

_Context: package_

Use this command to update package resources.

The command can help update existing resources in a package. Currently only documentation is supported.

### `elastic-package update documentation`

_Context: package_

Use this command to update package documentation using an AI agent or to get manual instructions for update.

The AI agent analyzes your package structure, data streams, and configuration, and generates a new documentation file based on the template and the package context.

For packages with multiple documentation files, use the --doc-file flag to specify the file to update (defaults to README.md).

If no LLM provider is configured, this command will print instructions for updating the documentation manually.

Configuration options for LLM providers (environment variables or profile config):
- LLM_PROVIDER / llm.provider: Provider name (only Gemini provider currently supported).
- Gemini: GOOGLE_API_KEY / llm.gemini.api_key, GEMINI_MODEL / llm.gemini.model, GEMINI_THINKING_BUDGET / llm.gemini.thinking_budget.

### `elastic-package version`

_Context: global_
Expand Down Expand Up @@ -796,6 +820,97 @@ The following settings are available per profile:
* `stack.fleet_auto_install_task_interval` sets the interval for the Fleet auto-install content packages task.
Supported in Kibana 9.2 and later. Defaults to "10m".

### AI-powered Documentation Configuration
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider moving this section to a file under docs/howto.


The `elastic-package update documentation` command can generate or update package documentation using an LLM. For detailed usage, flags, and configuration (including LLM provider setup), run:

```bash
elastic-package update documentation --help
```

**⚠️ IMPORTANT PRIVACY NOTICE:**
When using AI-powered documentation generation, **file content from your local file system within the package directory may be sent to the configured LLM provider**. This includes manifest files, configuration files, field definitions, and other package content. The generated documentation **must be reviewed for accuracy and correctness** before being finalized, as LLMs may occasionally produce incorrect or hallucinated information.

#### Service knowledge base (service_info.md)

To give the AI authoritative information about your integration, add a knowledge base file at **`docs/knowledge_base/service_info.md`** in your package. The generator treats this as the primary source and uses it to produce more accurate, vendor-specific documentation. By using this file, you will be better able to control the content of the generated documentation, and reduce the risk of hallucinations or incorrect information. When the documentation is updated in the future, you can rely on this file to ensure the documentation is accurate, and reduce the risk of unintentionally semantic changes being made along with your intended changes.

- **Structure:** Use the structure template below. The section names in the knowledge base file are for organizing content for the LLM; they do not dictate the structure of the generated README.
- **Content:** Use specific, complete sentences. Include vendor documentation URLs and any known limitations or edge cases. Keep the file updated as the service or integration changes. The semantic information in the knowledge base file is used as information in the documentation. The style and format of the knowledge base file is not copied into the output.
- **Effect:** The agent reads this file first, prioritizes it over other sources, and uses it to fill the corresponding parts of the generated docs. The format of `service_info.md` is not copied into the output.

##### Optional template reference

The following is an optional reference for structuring `service_info.md`. Section titles are only to categorize information for the LLM; they do not control the format of the generated README.

```markdown
# Service Info

## Common use cases

/* Common use cases that this will facilitate */

## Data types collected

/* What types of data this integration can collect */

## Compatibility

/* Information on the vendor versions this integration is compatible with or has been tested against */

## Scaling and Performance

/* Vendor-specific information on what performance can be expected, how to set up scaling, etc. */

# Set Up Instructions

## Vendor prerequisites

/* Add any vendor specific prerequisites, e.g. "an API key with permission to access <X, Y, Z> is required" */

## Elastic prerequisites

/* If there are any Elastic specific prerequisites, add them here

The stack version and agentless support is not needed, as this can be taken from the manifest */

## Vendor set up steps

/* List the specific steps that are needed in the vendor system to send data to Elastic.

If multiple input types are supported, add instructions for each in a subsection */

## Kibana set up steps

/* List the specific steps that are needed in Kibana to add and configure the integration to begin ingesting data */

# Validation Steps

/* List the steps that are needed to validate the integration is working, after ingestion has started.

This may include steps on the vendor system to trigger data flow, and steps on how to check the data is correct in Kibana dashboards or alerts. */

# Troubleshooting

/* Add lists of "*Issue* / *Solutions*" for troubleshooting knowledge base into the most appropriate section below */

## Common Configuration Issues

/* For generic problems such as "service failed to start" or "no data collected" */

## Ingestion Errors

/* For problems that involve "error.message" being set on ingested data */

## API Authentication Errors

/* For API authentication failures, credential errors, and similar */

# Documentation sites

/* List of URLs that contain info on the service (reference pages, set up help, API docs, etc.) */
```

## Useful environment variables

There are available some environment variables that could be used to change some of the
Expand Down Expand Up @@ -853,6 +968,10 @@ There are available some environment variables that could be used to change some
- `ELASTIC_PACKAGE_ESMETRICSTORE_PASSWORD`: Password for the user.
- `ELASTIC_PACKAGE_ESMETRICSTORE_CA_CERT`: Path to the CA certificate to connect to the Elastic stack services.

- To configure LLM providers for AI-powered documentation generation (`elastic-package update documentation`):
- `LLM_PROVIDER` / **llm.provider**: Provider name. Gemini is the default provider.
- Gemini: `GOOGLE_API_KEY` / **llm.gemini.api_key**, `GEMINI_MODEL` / **llm.gemini.model**, `GEMINI_THINKING_BUDGET` / **llm.gemini.thinking_budget**.


## Release process

Expand Down
1 change: 1 addition & 0 deletions cmd/foreach.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func getAllowedSubCommands() []string {
"lint",
"test",
"uninstall",
"update",
}
}

Expand Down
1 change: 1 addition & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var commands = []*cobraext.Command{
setupStatusCommand(),
setupTestCommand(),
setupUninstallCommand(),
setupUpdateCommand(),
setupVersionCommand(),
}

Expand Down
39 changes: 39 additions & 0 deletions cmd/update.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

package cmd

import (
"fmt"

"github.com/spf13/cobra"

"github.com/elastic/elastic-package/internal/cobraext"
"github.com/elastic/elastic-package/internal/install"
)

const updateLongDescription = `Use this command to update package resources.

The command can help update existing resources in a package. Currently only documentation is supported.`

func setupUpdateCommand() *cobraext.Command {
updateDocumentationCmd := &cobra.Command{
Use: "documentation",
Short: "Update package documentation",
Long: updateDocumentationLongDescription,
Args: cobra.NoArgs,
RunE: updateDocumentationCommandAction,
}
updateDocumentationCmd.Flags().String("doc-file", "", "specify which markdown file to update (e.g., README.md, vpc.md). Defaults to README.md")

cmd := &cobra.Command{
Use: "update",
Short: "Update package resources",
Long: updateLongDescription,
}
cmd.AddCommand(updateDocumentationCmd)
cmd.PersistentFlags().StringP(cobraext.ProfileFlagName, "p", "", fmt.Sprintf(cobraext.ProfileFlagDescription, install.ProfileNameEnvVar))

return cobraext.NewCommand(cmd, cobraext.ContextPackage)
}
Loading