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 🙏

© 2026 – Pkg Stats / Ryan Hefner

tonto-cli

v0.4.3

Published

Tonto is a DSL for creating OntoUML models

Readme

 

Tonto CLI

Tonto Command Line Interface (CLI) is a tool that expands the use of Tonto models by enabling the transformation of Tonto projects into other formats and providing validation capabilities.

Functionalities

  1. Transformation to JSON: The generate command converts a Tonto model into a JSON file that adheres to the OntoUML JSON schema. This allows for interoperability with OntoUML tools and further processing.
    tonto-cli generate [directoryName]
  2. Import from JSON: The import command takes a JSON file conforming to the OntoUML JSON schema and generates a corresponding Tonto project. This facilitates the migration of existing OntoUML models to Tonto.
    tonto-cli import [jsonFileName]
  3. Transformation to OWL: The transform command converts a Tonto model into a gUFO-based OWL ontology using the Turtle syntax. This bridges the gap between conceptual models and formal ontologies used in the Semantic Web.
    tonto-cli transform [directoryName]
  4. Validation: The validate command sends the Tonto model to the ontouml-server API for validation. It returns any validation errors identified by the server, helping to ensure the model's correctness and adherence to OntoUML/UFO rules.
    tonto-cli validate [directoryName]

Installation and Usage

Tonto CLI is available as an NPM package. To install it globally, use the following command:

npm install -g tonto-cli

Once installed, you can use the tonto-cli command followed by the desired command and directory or file name to perform the corresponding action.

Additional Considerations

  • Node.js Requirement: Tonto CLI requires Node.js to be installed on your system.
  • Global Installation: Installing Tonto CLI globally allows you to use the tonto-cli command from any directory.

Language Elements

Tonto grammar allows you declare elements by using its keyword and the defined name for the element.

package example 

kind Person {
    name: String
    age: Integer
    gender: Gender
}

phase Child specializes Person

enum Gender {
    MALE
    FEMALE
    OTHER
}

relation Person [0..*] -- hasFriend -- [0..*] Person

Package Declarations

Tonto specifications are organized into packages, defined using the package keyword followed by the package name. Packages act as namespaces and are fundamental for modularity.

package myPackage

Class Declarations

Classes are declared using keywords corresponding to UFO types (e.g., kind, role, phase) followed by the class name. Specializations are indicated using the specializes keyword.

kind Person {
    name: string
    birthDate: date {const}
}

phase Child specializes Person

Datatype Declarations

Tonto supports built-in datatypes (number, string, boolean, date, time, datetime) and allows defining custom datatypes using the datatype keyword.

datatype Address {
    street: string
    number: int
}

Enumeration Declarations

Enumerations are declared using the enum keyword, listing possible literal values.

enum EyeColor { Blue, Green, Brown, Black }

Generalization Sets

Generalization sets define relationships between a general class and its specializations. They can be marked as disjoint and/or complete.

disjoint complete genset PersonAgeGroup where Child, Adult specializes Person

genset PersonAgeGroup {
    general Person
    specifics Child, Adult
}

Relations

Relations (associations) can be declared internally (within a class body) or externally. They are specified using relation stereotypes (e.g., @componentOf, @mediation) and cardinalities.

// Internal relation
kind University {
    @componentOf [1] <>-- [1..*] Department
}

// External relation
@mediation relation EmploymentContract [1..*] -- [1] Employee

⌨️ Getting Started

This is the instructions on setting up your project locally. To get a local copy up and running follow these simple example steps:

Prerequisites

This is all the tools you need installed to run the project and the versions that are preferred

  • nodejs - v16.9.1 or higher
  • npm - 7.21.1 or higher
  • Yarn - 1.22.18 (not mandatory, but recommended)

⚙️ Initializing

  • Run npm run langium:generate to generate TypeScript code from the grammar definition.
  • Run npm run build to compile all TypeScript code or npm run watch if you want the compiler to work automatically everytime you update your files
  • Press F5 to open a new window with your extension loaded.
  • Create a new file with a file name suffix matching your language.
  • Verify that syntax highlighting, validation, completion etc. are working as expected.

CLI Commands

  • Help command to list all available commands
   tonto-cli help
  • Generate JSON File from Tonto Project command::
   tonto-cli generate <dirName>
  • Generate Tonto Project from a JSON Filee
   tonto-cli import <fileName.json>
  • Validate Tonto Project with ontouml-js server APII
   tonto-cli validate <dirName>

🔐 License

Distributed under the MIT License. See LICENSE.txt for more information.

✉️ Contact

Matheus Lenke Coutinho - [email protected] - Linkedin - Github