Skip to content

sf plugins command fails when you add the --json flag #3051

@ImJohnMDaniel

Description

@ImJohnMDaniel

Summary

sf plugins command fails when you add the --json flag

Steps To Reproduce

From a Salesforce DX enabled project, execute the following command:

    sf plugins --json

Expected result

JSON display of all plugins configured in the system

Actual result

$ sf plugins --json          
    TypeError: Converting circular structure to JSON
        --> starting at object with constructor 'Array'
        |     index 0 -> object with constructor 'Plugin'
        |     property 'options' -> object with constructor 'Object'
        |     property 'parent' -> object with constructor 'Plugin'
        --- property 'children' closes the circle

System Information

Issue is observed on MacOS/zsh, Windows/GIT Bash, Windows/Command Prompt

{
  "architecture": "darwin-x64",
  "cliVersion": "@salesforce/cli/2.62.3",
  "nodeVersion": "node-v20.17.0",
  "osVersion": "Darwin 24.0.0",
  "rootPath": "/Users/john/.local/share/sf/client/2.62.3-faaafdd",
  "shell": "zsh",
  "pluginVersions": [
    "@dx-cli-toolbox/sf-toolbox-aep-utils 0.7.5 (user) published 224 days ago (Thu Feb 29 2024)",
    "@dx-cli-toolbox/sfdx-toolbox-package-utils 0.8.4 (user) published 644 days ago (Thu Jan 05 2023)",
    "@dx-cli-toolbox/sfdx-toolbox-utils 0.1.2 (user) published 906 days ago (Mon Apr 18 2022)",
    "@mshanemc/plugin-streaming 1.1.7 (user) published 1468 days ago (Fri Oct 02 2020)",
    "@mshanemc/sfdx-sosl 1.1.0 (user) published 1462 days ago (Thu Oct 08 2020)",
    "@oclif/plugin-autocomplete 3.2.5 (core)",
    "@oclif/plugin-commands 4.1.1 (core)",
    "@oclif/plugin-help 6.2.14 (core)",
    "@oclif/plugin-not-found 3.2.22 (core)",
    "@oclif/plugin-plugins 5.4.14 (core)",
    "@oclif/plugin-search 1.2.10 (core)",
    "@oclif/plugin-update 4.6.0 (core)",
    "@oclif/plugin-version 2.2.14 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.18 (core)",
    "@oclif/plugin-which 3.2.15 (core)",
    "@salesforce/cli 2.62.3 (core)",
    "apex 3.5.0 (core)",
    "api 1.3.0 (core)",
    "auth 3.6.65 (core)",
    "community 3.2.33 (user) published 12 days ago (Sat Sep 28 2024)",
    "data 3.6.8 (core)",
    "deploy-retrieve 3.12.17 (core)",
    "dev 2.4.2 (user) published 44 days ago (Mon Aug 26 2024)",
    "functions 1.23.0 (user) published 219 days ago (Tue Mar 05 2024)",
    "info 3.4.9 (core)",
    "limits 3.3.32 (core)",
    "marketplace 1.2.26 (core)",
    "org 4.6.0 (core)",
    "packaging 2.8.11 (core)",
    "schema 3.3.34 (core)",
    "settings 2.3.23 (core)",
    "sobject 1.4.40 (core)",
    "source 3.5.21 (core)",
    "telemetry 3.6.15 (core)",
    "templates 56.3.21 (core)",
    "trust 3.7.32 (core)",
    "user 3.5.32 (core)",
    "sfdmu 4.36.3 (user) published 21 days ago (Thu Sep 19 2024)",
    "shane-sfdx-plugins 4.43.0 (user) published 1438 days ago (Mon Nov 02 2020)"
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue or pull request that identifies or fixes a bugvalidatedVersion information for this issue has been validated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions