# tonto-package-manager

> A package manager for Tonto dependencies

Latest version **0.3.4** (published 2026-08-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install tonto-package-manager
pnpm add tonto-package-manager
yarn add tonto-package-manager
bun add tonto-package-manager
```

Provides the command `tpm`.

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.3.4 |
| Published | 2026-08-21 |
| First published | 2023-06-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=16 |
| Dependencies | 8 |
| Unpacked size | 40.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Matheus Lenke Coutinho |
| Maintainers | matheuslenke |
| Keywords | CLI, Package, Manager, Tonto, DSL |

## Links

- npm: https://www.npmjs.com/package/tonto-package-manager
- Repository: https://github.com/nemo-ufes/Tonto
- Homepage: https://github.com/nemo-ufes/Tonto#readme
- Issues: https://github.com/nemo-ufes/Tonto/issues
- npm.io page: https://npm.io/package/tonto-package-manager

## Dependencies (8)

- [ora](https://npm.io/package/ora.md) ^5.4.1
- [execa](https://npm.io/package/execa.md) ^5.1.1
- [figlet](https://npm.io/package/figlet.md) ^1.6.0
- [tonto-cli](https://npm.io/package/tonto-cli.md) ^0.4.13
- [@vscode/vsce](https://npm.io/package/@vscode/vsce.md) 3.3.2
- [concurrently](https://npm.io/package/concurrently.md) 3.5.1
- [@types/figlet](https://npm.io/package/@types/figlet.md) ^1.7.0
- [@inquirer/prompts](https://npm.io/package/@inquirer/prompts.md) ^7.8.6

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.3.4 (latest) — 2026-08-21
- 0.3.3 — 2026-07-09
- 0.3.2 — 2026-06-19
- 0.2.9 — 2023-06-14
- 0.2.8 — 2023-06-14
- 0.2.7 — 2023-06-14
- 0.2.6 — 2023-06-14
- 0.2.5 — 2023-06-12

## README

# Tonto Package Manager

`packages/tpm` contains the `tpm` command-line tool. TPM installs ontology dependencies declared in a Tonto project manifest (`tonto.json`) from Git repositories into the local `tonto_dependencies` folder.

Use TPM when a Tonto project depends on reusable ontology packages that live in another Git repository, a subdirectory of a repository, a branch, or a version tag.

## Dependency Flow

```mermaid
flowchart LR
    Manifest["tonto.json<br/>dependencies"] --> TPM["tpm install"]
    TPM --> Git["Git repository<br/>branch or tag"]
    Git --> Temp["temporary clone"]
    Temp --> Directory{"directory<br/>configured?"}
    Directory -->|yes| Subdir["copy selected project"]
    Directory -->|no| RepoRoot["copy repository root"]
    Subdir --> Output["tonto_dependencies/<dependency>"]
    RepoRoot --> Output
```

## Manifest Format

```json
{
  "projectName": "Aguiar2019ooco",
  "displayName": "Aguiar 2019 Object Oriented Example",
  "publisher": "Aguiar",
  "version": "1.0.0",
  "license": "MIT",
  "dependencies": {
    "SWO": {
      "url": "https://github.com/example/tonto-example-models.git",
      "directory": "SWO",
      "branch": "feature/test-tonto-reference"
    },
    "SPO": {
      "url": "https://github.com/example/tonto-example-models.git",
      "directory": "SPO",
      "version": "1.0.1"
    }
  },
  "outFolder": "generated"
}
```

Dependency fields:

| Field | Required | Meaning |
|---|---|---|
| `url` | Yes | Git repository URL. |
| `directory` | No | Subdirectory inside the repository that contains the dependency project. |
| `branch` | No | Branch to clone. |
| `version` | No | Git tag to clone. |

If neither `branch` nor `version` is defined, TPM clones the repository's default branch.

## Commands

Install dependencies for the current project:

```bash
tpm install
```

Install dependencies for another project directory:

```bash
tpm install --dir path/to/project
tpm i --dir path/to/project
```

Add a dependency to `tonto.json`:

```bash
tpm add . \
  --name SharedOntology \
  --url https://github.com/example/shared-ontology.git \
  --version 1.0.0 \
  --dir ontology-package
```

Show command help:

```bash
tpm help
tpm install help
tpm add help
```

## Development

From the repository root:

```bash
npm run build --workspace=tonto-package-manager
npm run test --workspace=tonto-package-manager
npm run watch --workspace=tonto-package-manager
```

The package exposes the `tpm` binary from `bin/cli.js` and imports the Tonto CLI package for manifest and project support.

## Troubleshooting

- Delete `tonto_dependencies` and run `tpm install` again if a dependency checkout becomes stale.
- Use `version` only when the referenced Git repository has a matching tag.
- Use `directory` when the dependency repository contains more than one Tonto project.
- Make sure Git is installed and available on `PATH`.

## License

Distributed under the MIT License. See the repository root [LICENSE](../../LICENSE) file for more information.

---
_Source: https://npm.io/package/tonto-package-manager · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
