# @ldo/cli

> A Command Line Interface for Linked Data Objects

Latest version **1.0.0-alpha.53** (published 2026-11-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ldo/cli
pnpm add @ldo/cli
yarn add @ldo/cli
bun add @ldo/cli
```

Provides the command `ldo`.

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.0.0-alpha.53 |
| Published | 2026-11-16 |
| First published | 2023-10-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20.19.0 |
| Dependencies | 14 |
| Unpacked size | 59.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 73 |
| Author | Jackson Morgan |
| Maintainers | jaxoncreed |

## Links

- npm: https://www.npmjs.com/package/@ldo/cli
- Repository: https://github.com/o-development/ldo
- Homepage: https://github.com/o-development/ldo/tree/main/packages/cli#readme
- Issues: https://github.com/o-development/ldo/issues
- npm.io page: https://npm.io/package/@ldo/cli

## Dependencies (14)

- [ejs](https://npm.io/package/ejs.md) ^3.1.8
- [prompts](https://npm.io/package/prompts.md) ^2.4.2
- [@ldo/ldo](https://npm.io/package/@ldo/ldo.md) ^1.0.0-alpha.53
- [prettier](https://npm.io/package/prettier.md) ^3.0.3
- [ts-morph](https://npm.io/package/ts-morph.md) ^24.0.0
- [camelcase](https://npm.io/package/camelcase.md) ^9.0.0
- [commander](https://npm.io/package/commander.md) ^9.3.0
- [type-fest](https://npm.io/package/type-fest.md) ^2.19.0
- [loading-cli](https://npm.io/package/loading-cli.md) ^1.1.0
- [@shexjs/parser](https://npm.io/package/@shexjs/parser.md) ^1.0.0-alpha.24
- [rdf-namespaces](https://npm.io/package/rdf-namespaces.md) ^1.13.1
- [@jeswr/shacl2shex](https://npm.io/package/@jeswr/shacl2shex.md) ^1.1.0
- [rdf-dereference-store](https://npm.io/package/rdf-dereference-store.md) ^1.4.0
- [@ldo/schema-converter-shex](https://npm.io/package/@ldo/schema-converter-shex.md) ^1.0.0-alpha.53

## Recent versions

- 1.0.0-alpha.53 (latest) — 2026-11-16
- 1.0.0-alpha.51 — 2026-05-10
- 1.0.0-alpha.50 — 2026-05-09
- 1.0.0-alpha.48 — 2026-05-06
- 1.0.0-alpha.46 — 2026-03-19
- 1.0.0-alpha.45 — 2026-03-19
- 1.0.0-alpha.44 — 2026-03-18
- 1.0.0-alpha.43 — 2026-03-18
- 1.0.0-alpha.38 — 2026-03-10
- 1.0.0-alpha.36 — 2026-03-07
- 1.0.0-alpha.34 — 2026-03-07
- 1.0.0-alpha.32 — 2025-08-20
- 1.0.0-alpha.31 — 2025-08-20
- 1.0.0-alpha.30 — 2025-08-01
- 1.0.0-alpha.29 — 2025-07-22
- … 28 more at https://npm.io/package/@ldo/cli/versions

## README

# @ldo/cli

The `@ldo/cli` is a command line interface for initializing LDO and building ShapeTypes.

## Setup

### Automatic Setup

To setup LDO, `cd` into your typescript project and run `npx @ldo/cli init`.

```bash
cd my-typescript-project
npx @ldo/cli init
```

<details>
<summary>
Manual Setup
</summary>
The following is handled by the __automatic setup__:

Install the LDO dependencies.

```bash
npm install @ldo/ldo
npm install @ldo/cli --save-dev
```

Create a folder to store your ShEx shapes:

```bash
mkdir shapes
```

Create a script to build ShEx shapes and convert them into Linked Data Objects. You can put this script in `package.json`

```json
{
  ...
  scripts: {
    ...
    "build:ldo": "ldo build --input ./shapes --output ./ldo"
    ...
  }
  ...
}
```

</details>

## Generating a ShapeType

@ldo/cli generates shape types using the `*.shex` files in the "input" folder. If you followed the instructions above, run the following command:

```bash
npm run build:ldo
```

This will generate five files:

- `./_ldo/foafProfile.shapeTypes.ts` <-- This is the important file
- `./_ldo/foafProfile.typings.ts`
- `./_ldo/foafProfile.schema.ts`
- `./_ldo/foafProfile.context.ts`

## Creating a new project to distribure shapes

Sometimes, you might want to distribute shapes to others. The easiest way to do that is to deploy them to NPM. The LDO CLI has an easy-to-use command for generating a standalone project just for your shapes.

```bash
npx @ldo/cli create ./my-project
```

This script will generate a project with a place to put your shapes. Running `npm publish` will build the shapes and push to project to NPM for you.

## API Details

- [`init` command](https://ldo.js.org/latest/api/cli/init/)
- [`build` command](https://ldo.js.org/latest/api/cli/build/)
- [`create` command](https://ldo.js.org/latest/api/cli/create/)

## Sponsorship

This project was made possible by a grant from NGI Zero Entrust via nlnet. Learn more on the [NLnet project page](https://nlnet.nl/project/SolidUsableApps/).

[<img src="https://nlnet.nl/logo/banner.png" alt="nlnet foundation logo" width="300" />](https://nlnet.nl/)
[<img src="https://nlnet.nl/image/logos/NGI0Entrust_tag.svg" alt="NGI Zero Entrust Logo" width="300" />](https://nlnet.nl/)

## License

MIT

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