> For the complete documentation index, see [llms.txt](https://docs.flxbl.io/flxbl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flxbl.io/flxbl/sfp/development/dependency-management/explain-dependencies.md).

# Explain Dependencies

The `sfp dependency:explain` command helps you understand the dependencies between packages in your project. It can analyze either a specific package's dependencies or all package dependencies in the project, showing both direct and transitive dependencies.

#### Usage

```bash
# Explain dependencies for all packages
sfp dependency:explain

# Explain dependencies for a specific package
sfp dependency:explain -p <package-name>
```

#### Flags

| Flag              | Description                                            | Required |
| ----------------- | ------------------------------------------------------ | -------- |
| `-p`, `--package` | Name of the package to analyze dependencies for        | No       |
| `--json`          | Format output as JSON                                  | No       |
| `--loglevel`      | Logging level (trace, debug, info, warn, error, fatal) | No       |

## Understanding the Output

When analyzing dependencies, the command provides information about:

* Direct dependencies: Dependencies explicitly declared in the package's configuration
* Transitive dependencies: Dependencies that are required by your direct dependencies
* For transitive dependencies, the command shows which packages contribute to requiring that dependency

#### JSON Output Structure

When using the `--json` flag, the command returns data in the following structure:

```json
{
  "packages": [
    {
      "name": "package-name",
      "dependencies": [
        {
          "name": "dependency-name",
          "version": "version-number",
          "type": "direct|transitive",
          "contributors": ["package-names"] // Only present for transitive dependencies
        }
      ]
    }
  ]
}
```

#### Examples

Analyze all package dependencies:

```bash
sfp dependency:explain
```

Analyze dependencies for a specific package:

```bash
sfp dependency:explain -p my-package
```

Get dependencies in JSON format:

```bash
sfp dependency:explain -p my-package --json
```

#### Notes

* The command requires a valid SFDX project configuration
* Dependencies are resolved based on the information in your `sfdx-project.json` file
* Transitive dependency resolution helps identify indirect dependencies that might not be immediately obvious from the project configuration


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flxbl.io/flxbl/sfp/development/dependency-management/explain-dependencies.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
