npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@credenceanalytics/credmktcli

v1.5.0

Published

Credence Marketplace CLI Tool

Downloads

106

Readme

credmkt-cli

Support for market place page where in any kind of feature like report/app/noderedflow can be published. User can visit market place download the Package and install.

Installation

Prerequisites

Online Mode

  • Run the following command to install.
    $ npm install -g @credenceanalytics/credmktcli@latest
  • Test installation by typing following command:
    $ credmktcli --help

Offline Mode

  • Extract credmkt-cli.zip.
    • Place the extracted credmkt-cli folder to somewhere safe on your disk.
  • Run npm link --force inside credmkt-cli/ folder.
  • Test installation by typing following command:
    $ credmktcli --help

Commands

credmktcli setup

Run this command in the credence/ folder.

This command creates a new directory named custom-packages/ in the credence/ folder and initializes configuration including:

  • Database connection details
  • Application user ID
  • Reporting WAR path
  • Node-RED API URL (default: http://127.0.0.1:8001)
  • App Builder API URL (default: http://127.0.0.1:3004)
  • API key (automatically retrieved from database)

Usage

$ credmktcli setup

Folder structure before running the command [dev environment]

credence/
  ├── visualizer-dashpages/
  ├── pages/
  ├── apps/
  └── microservices/

Folder structure after running the command [dev environment]

credence/
  ├── custom-packages/
  ├── visualizer-dashpages/
  ├── apps/
  ├── pages/
  └── microservices/

credmktcli package:init

Run this command in package repository must be a git repo.

This command helps in setting up a new package by creating a cred_package.json file in the specified directory. It prompts the user to enter various details about the package such as name, version, description, author and keywords and writes these details into a newly created cred_package.json file.

Usage

$ credmktcli package:init

Folder structure after running the command

<Package repo>/
  └── cred_package.json

credmktcli package:add

This command is used to add content to an existing package in a Git repository. It supports:

  • Visualizer dashboards (file-based)
  • Pagebuilder pages (file-based)
  • Node-RED flows (API-based, automatically exported)
  • App Builder apps (API-based, automatically exported)

This command checks if the current directory is a Git repository and contains a cred_package.json file. It then prompts the user to choose what type of content to add.

For Node-RED flows and App Builder apps, the command fetches available items from their respective APIs, lets you select which ones to add, and automatically exports the content.

This command is not for reports - reports must be added manually to the reports/ folder

Usage

$ credmktcli package:add

Folder structure before running the command

<Package repo>/
  └── cred_package.json

Folder structure after running the command

└── <Package repo>/
    ├── visualizer-dashboard/
    │   └── <Added dashboard>/
    │       └── files
    ├── pages/
    │   └── <Added pages>/
    │       └── files
    ├── jobcenternodered_flows/
    │   └── <Flow_Name>.json
    ├── appbuilder_apps/
    │   └── <app_id>.zip
    └── cred_package.json

credmktcli package:build

This command updates existing Node-RED flows in a package by fetching the latest versions from the Node-RED API. It's useful when flows have been modified in Node-RED and you want to update your package with the latest changes.

Current support: Node-RED flows only (App Builder apps will be supported in future versions)

Usage

$ credmktcli package:build

When to use this command

Use package:build when:

  • You've already added Node-RED flows to your package using package:add
  • The flows have been modified in Node-RED
  • You want to update the package with the latest flow definitions

Note: This command does NOT commit changes or bump version. After running package:build, use package:publish to create a new version.

How it works

  1. Validation: Checks if current directory is a git repository with cred_package.json
  2. Discovery: Reads all Node-RED flows listed in packageFolders.jobcenternodered_flows
  3. API Fetch: Connects to Node-RED API to get current flow definitions
  4. Matching: Matches package flows against API flows by ID
  5. Update: Exports latest flow definitions and overwrites JSON files in jobcenternodered_flows/ folder
  6. Summary: Displays which flows were updated and which were not found

Example output

$ credmktcli package:build

Building package content from APIs...

Found 3 Node-RED flow(s) in package
Fetching available flows from Node-RED API...
Updating 2 Node-RED flow(s)...

Build Summary:
──────────────────────────────────────────────────
✓ Updated 2 Node-RED flow(s) successfully
⚠ Warning: 1 flow(s) no longer exist in Node-RED:
  - "Old Flow" (ID: abc123)
──────────────────────────────────────────────────

Package content updated. Run 'credmktcli package:publish' to create new version.

Folder structure

Before running the command:

<Package repo>/
  ├── jobcenternodered_flows/
  │   ├── Flow_1.json          (outdated)
  │   ├── Flow_2.json          (outdated)
  │   └── Old_Flow.json        (will show warning - deleted from Node-RED)
  └── cred_package.json

After running the command:

<Package repo>/
  ├── jobcenternodered_flows/
  │   ├── Flow_1.json          (✓ updated)
  │   ├── Flow_2.json          (✓ updated)
  │   └── Old_Flow.json        (unchanged - not in Node-RED)
  └── cred_package.json

credmktcli package:publish

This command is used to update the version of a package, commit and push changes to the Git repository, and create a ZIP archive of the package.

Usage

$ credmktcli package:publish

Folder structure

└── <Package repo>/
    ├── visualizer-dashboard/
    │   └── <Added dashboard>/
    │       └── files
    ├── pages/
    │   └── <Added pages>/
    │       └── files
    ├── jobcenternodered_flows/
    │   └── <Flow>.json
    ├── appbuilder_apps/
    │   └── <app-id>.zip
    └── cred_package.json

credmktcli package:apply

This command is used to extract and install a package from a specified ZIP file. This command handles extracting the package, optionally overwriting existing directories, and setting up the package correctly.

Usage

$ credmktcli package:apply

Folder structure before running the command [production environment]

└── credence/
    ├── custom-packages/
    ├── visualizer-dashpages/
    ├── apps/
    ├── microservices/
    └── pages/

Folder structure after running the command [production environment]

credence/
  ├── custom-packages/
  │   └── <Installed Package>/
  │       ├── visualizer-dashboard/
  │       │   └── <different dashboards>
  │       ├── pages/
  │       │   └── <different pages>
  │       ├── jobcenternodered_flows/
  │       │   └── <flow files>
  │       ├── appbuilder_apps/
  │       │   └── <app files>
  │       └── cred_package.json
  ├── visualizer-dashpages/
  │   └── dash/
  │       └── <different dashboards>
  ├── pages/
  │   └── <different pages>
  ├── apps/
  └── microservices/

Note: Node-RED flows and App Builder apps are installed via their respective APIs, not copied to file system directories.

credmktcli package:update

This command applies multiple packages in version order from the updates/packages/ folder. It discovers all package ZIP files in the updates/packages/ subfolder, sorts them by semantic version, and applies them sequentially with comprehensive error handling and recovery.

Run this command in the credence/ folder.

Usage

$ credmktcli package:update

Required folder structure

credence/
  └── updates/
      └── packages/
          ├── mypackage-1.0.0.zip
          ├── mypackage-1.1.0.zip
          ├── anotherpackage-2.0.0.zip
          └── anotherpackage-2.1.0.zip

Package naming convention

All package ZIP files must follow the naming pattern: <package-name>-<version>.zip

Examples of valid names:

  • dashboard-reports-1.0.0.zip
  • user-analytics-2.1.3.zip
  • custom-widgets-1.5.0.zip

How it works

  1. Discovery: Scans updates/packages/ folder for ZIP files
  2. Validation: Validates package names against naming convention
  3. Sorting: Groups packages by name and sorts by semantic version (oldest to newest)
  4. Confirmation: Shows the application order and asks for user confirmation
  5. Sequential Application: Applies packages one by one with failure recovery
  6. Reporting: Provides detailed summary with success/failure counts

Error handling

  • Failed packages create .failed files with error details
  • Processing continues even if individual packages fail
  • Final summary shows all results

Folder structure before running the command [production environment]

└── credence/
    ├── custom-packages/
    ├── updates/
    │   └── packages/
    │       ├── package-a-1.0.0.zip
    │       ├── package-a-1.1.0.zip
    │       └── package-b-2.0.0.zip
    ├── visualizer-dashpages/
    ├── apps/
    ├── microservices/
    └── pages/

Folder structure after running the command [production environment]

credence/
  ├── custom-packages/
  │   ├── package-a-1.1.0/
  │   │   ├── visualizer-dashboard/
  │   │   │   └── <dashboards>
  │   │   ├── pages/
  │   │   │   └── <pages>
  │   │   ├── jobcenternodered_flows/
  │   │   │   └── <flows>
  │   │   ├── appbuilder_apps/
  │   │   │   └── <apps>
  │   │   └── cred_package.json
  │   └── package-b-2.0.0/
  │       ├── reports/
  │       │   └── <reports>
  │       └── cred_package.json
  ├── updates/
  │   └── packages/
  │       ├── package-a-1.0.0.zip
  │       ├── package-a-1.1.0.zip
  │       ├── package-b-2.0.0.zip
  │       └── package-a-1.0.0.failed (if failed)
  ├── visualizer-dashpages/
  │   └── dash/
  │       └── <applied dashboards>
  ├── pages/
  │   └── <applied pages>
  ├── apps/
  └── microservices/

How to add and publish report package

Run credmktcli setup (one time only) command

Run credmktcli package:init command

First export your report using Export button from Report Manager view.

Extract zip and copy/paste .rptdesign and .json file in you package git repository inside reports/ folder.

Package git repository structure:

.
└── <Package git repository>/
    ├── .git/
    ├── reports/
    │   ├── <some report>.rptdesign
    │   └── <some report>.json
    └── cred_package.json

Run credmktcli package:publish command to push changes. It will also create -.zip file

Use this zip in credmktcli package:apply command

How to add Node-RED flows to package

Prerequisites

  • credmktcli setup command completed (one time only)
  • Node-RED API URL configured in setup
  • Node-RED instance running and accessible

Steps

  1. Run credmktcli package:init command in your package git repository

  2. Run credmktcli package:add command

  3. Select "Node Red Flow" from the menu

  4. The command will fetch all available flows from Node-RED and display them

  5. Select the flow(s) you want to add from the list

  6. The flow content will be automatically exported to the jobcenternodered_flows/ folder

  7. The cred_package.json file will be updated with flow metadata:

    {
      "packageFolders": {
        "jobcenternodered_flows": [
          {"id": "flow-id", "name": "Flow Name"}
        ]
      }
    }
  8. Run credmktcli package:publish command to push changes and create the ZIP file

Package git repository structure:

.
└── <Package git repository>/
    ├── .git/
    ├── jobcenternodered_flows/
    │   ├── Flow_1.json
    │   └── Flow_2.json
    └── cred_package.json

Installation behavior

When installing a package with Node-RED flows using package:apply:

  • The installer fetches all existing flows from Node-RED
  • Matches flows by name (not ID)
  • If no match found: Creates a new flow
  • If 1 match found: Prompts for confirmation before updating
  • If multiple matches found: Exits with error (requires unique flow names)

How to add App Builder apps to package

Prerequisites

  • credmktcli setup command completed (one time only)
  • App Builder API URL configured in setup
  • App Builder instance running and accessible

Steps

  1. Run credmktcli package:init command in your package git repository

  2. Run credmktcli package:add command

  3. Select "Appbuilder App" from the menu

  4. The command will fetch all available apps from App Builder and display them

  5. Select the app(s) you want to add from the list

  6. The app content will be automatically exported as ZIP files to the appbuilder_apps/ folder

  7. The cred_package.json file will be updated with app metadata:

    {
      "packageFolders": {
        "appbuilder_apps": [
          {"id": "app-id", "name": "App Name"}
        ]
      }
    }
  8. Run credmktcli package:publish command to push changes and create the ZIP file

Package git repository structure:

.
└── <Package git repository>/
    ├── .git/
    ├── appbuilder_apps/
    │   ├── app-id-1.zip
    │   └── app-id-2.zip
    └── cred_package.json

How to update an existing package

Once you have published a package (e.g., mypackage-1.0.0.zip), you may need to update it with new content or modifications.

Steps to update and publish a new version:

  1. Navigate to your package git repository

    cd <Package git repository>
  2. Make your changes:

    • To add new content: Run credmktcli package:add and select the type of content to add
      • Visualizer dashboards
      • Pagebuilder pages
      • Node-RED flows (fetched from API)
      • App Builder apps (fetched from API)
    • To update existing content:
      • For Node-RED flows: Run credmktcli package:build to automatically update all flows from Node-RED API
      • For App Builder apps: Run credmktcli package:add again and select the same item (you'll be prompted to overwrite)
      • For reports: Manually replace files in the reports/ folder
      • For dashboards/pages: Manually update files in their respective folders
  3. Publish the updated package:

    credmktcli package:publish
  4. When prompted, choose version bump type:

    • patch (1.0.0 → 1.0.1) - for bug fixes
    • minor (1.0.0 → 1.1.0) - for new features
    • major (1.0.0 → 2.0.0) - for breaking changes
  5. The command will:

    • Update version in cred_package.json
    • Commit changes to git
    • Push to remote repository
    • Create new ZIP file: <package-name>-<new-version>.zip

Example workflow:

Example 1: Adding new content

# Start with existing package repository
cd my-dashboard-package

# Add a new Node-RED flow
credmktcli package:add
# Select "Node Red Flow" → choose flow → automatically exported

# Publish new version
credmktcli package:publish
# Choose "minor" → creates my-dashboard-package-1.1.0.zip

Example 2: Updating existing Node-RED flows

# Navigate to package repository
cd my-dashboard-package

# Update all Node-RED flows from API (fetches latest versions)
credmktcli package:build

# Publish updated version
credmktcli package:publish
# Choose "patch" → creates my-dashboard-package-1.1.1.zip

Version management:

The marketplace tracks installed package versions in the database. When applying updates:

  • You can install a higher version (upgrade)
  • If you try to install a lower version (downgrade), you'll receive a warning
  • Use package:update command to apply multiple versions sequentially