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

digitaltwin-cli

v0.3.1

Published

CLI tools for Digital Twin projects - generate components, manage projects

Readme

digitaltwin-cli

CLI tools for Digital Twin projects - generate components, manage projects with ease.

Quick Start

Installation

npm install -g digitaltwin-cli

Usage in a Digital Twin project

In projects created with create-digitaltwin, use the included dt.js wrapper:

# Generate a new collector
node dt make:collector WeatherCollector --description "Collects weather data"

# Generate a new handler with POST method
node dt make:handler ApiHandler --method post --description "Handles API requests"

# Generate a new harvester
node dt make:harvester DataProcessor --source weather-collector --description "Processes weather data"

# Generate a new assets manager
node dt make:assets-manager ImageManager --content-type "image/jpeg"

Or use the CLI directly if installed globally:

dt make:collector WeatherCollector --description "Collects weather data"

Commands

make:collector <name>

Generate a new collector component that collects data from external sources.

Options:

  • -d, --description <desc> - Description of the collector
  • -s, --schedule <schedule> - Cron schedule (default: every 5 minutes)
  • -t, --tags <tags> - Comma-separated tags
  • --endpoint <endpoint> - Custom endpoint name
  • --dry-run - Show what would be generated
  • --force - Overwrite existing files

Example:

dt make:collector WeatherCollector \
  --description "Collects weather data from OpenWeather API" \
  --schedule "0 */10 * * * *" \
  --tags "weather,api,external"

make:handler <name>

Generate a new handler component that provides HTTP endpoints.

Options:

  • -d, --description <desc> - Description of the handler
  • -t, --tags <tags> - Comma-separated tags
  • --endpoint <endpoint> - Custom endpoint name
  • -m, --method <method> - HTTP method (get, post, put, delete)
  • --dry-run - Show what would be generated
  • --force - Overwrite existing files

Example:

dt make:handler UserHandler \
  --description "Manages user operations" \
  --method post \
  --tags "users,api"

make:harvester <name>

Generate a new harvester component that processes collected data.

Options:

  • -d, --description <desc> - Description of the harvester
  • -t, --tags <tags> - Comma-separated tags
  • --endpoint <endpoint> - Custom endpoint name
  • --source <source> - Source collector to harvest from (required)
  • --dependencies <deps> - Comma-separated list of dependency components
  • --source-range <range> - Source range (number or time like "1h", "30m")
  • --trigger-mode <mode> - Trigger mode: on-source or scheduled
  • --dry-run - Show what would be generated
  • --force - Overwrite existing files

Example:

dt make:harvester WeatherProcessor \
  --source weather-collector \
  --description "Processes and analyzes weather data" \
  --source-range "1h"

make:assets-manager <name>

Generate a new assets manager component for handling file uploads and management.

Options:

  • -d, --description <desc> - Description of the assets manager
  • -t, --tags <tags> - Comma-separated tags
  • --endpoint <endpoint> - Custom endpoint name
  • --content-type <type> - MIME type for assets (default: application/octet-stream)
  • --dry-run - Show what would be generated
  • --force - Overwrite existing files

Example:

dt make:assets-manager ImageManager \
  --content-type "image/jpeg" \
  --description "Manages JPEG image uploads"

Generated Files

All components are generated in src/components/ with the following naming convention:

  • Collectors: {name}_collector.ts
  • Handlers: {name}_handler.ts
  • Harvesters: {name}_harvester.ts
  • Assets Managers: {name}_assets_manager.ts

Project Structure

digitaltwin-cli works with projects created using create-digitaltwin. The CLI automatically:

  • Detects if you're in a Digital Twin project
  • Validates project structure
  • Generates TypeScript files with proper imports
  • Provides helpful reminders about adding components to your engine configuration

When you create a project with create-digitaltwin, a dt.js wrapper is automatically generated that calls digitaltwin-cli, making component generation seamless:

# In projects created with create-digitaltwin
node dt make:collector MyCollector

Development

# Clone the repository
git clone https://github.com/your-repo/digitaltwin-cli.git
cd digitaltwin-cli

# Install dependencies
npm install

# Build the CLI
npm run build

# Test locally
npm link

Related Projects

License

MIT © Hoffmann Axel

This project have been inspired by AdonisJS Ace CLI