open-index/open-npm huggingface dataset:
npm package: @osirisjson/cli
Description: OSIRIS JSON Toolbox - Command Line Interface for validation and other utilities
Author: Tia Zanella - https://github.com/skhell
Latest version: 0.1.0

# @osirisjson/cli

Command-line interface for validating [OSIRIS JSON](https://osirisjson.org) documents.

Part of the [osiris-toolbox](https://github.com/osirisjson/osiris-toolbox) monorepo.

## Installation

```bash
npm install -g @osirisjson/cli
```

## Usage

```bash
# Validate a single file
osirisjson validate topology.json

# Validate all JSON files in a directory
osirisjson validate ./exports/

# Validate from stdin
cat doc.json | osirisjson validate -

# Strict profile with JSON output
osirisjson validate --profile strict --format json topology.json
```

## Flags

| Flag                  | Description                                      | Default    |
|-----------------------|--------------------------------------------------|------------|
| `--profile <level>`   | Validation profile: `basic`, `default`, `strict` | `default`  |
| `--format <fmt>`      | Output format: `text`, `json`, `ndjson`          | `text`     |
| `--schema <key>`      | Override schema version to validate against      | auto-detect|
| `--color`             | Force color output                               | auto       |
| `--verbose`           | Show passing documents in output                 | off        |
| `--help`              | Show help                                        |            |
| `--version`           | Show version                                     |            |

## Exit codes

| Code | Meaning                                      |
|------|----------------------------------------------|
| `0`  | Success - all documents valid                |
| `1`  | Validation error - one or more documents invalid |
| `2`  | Operational error - bad arguments, file not found, etc. |

## Documentation

Full documentation at [osirisjson.org/en/docs/validate/validate](https://osirisjson.org/en/docs/validate/validate).

## Requirements

- Node.js >= 20.0.0

## License

[Apache-2.0](../../LICENSE)
npm package: @osirisjson/core
Description: OSIRIS JSON Toolbox - core validation engine
Author: Tia Zanella - https://github.com/skhell
Latest version: 0.1.0

# @osirisjson/core

Validation engine for [OSIRIS JSON](https://osirisjson.org) documents.

Part of the [osiris-toolbox](https://github.com/osirisjson/osiris-toolbox) monorepo.

## Installation

```bash
npm install @osirisjson/core
```

## Usage

```ts
import { validate } from '@osirisjson/core';

const diagnostics = validate(document);
// or with options
const diagnostics = validate(document, { profile: 'strict' });

if (diagnostics.length === 0) {
  console.log('Document is valid');
} else {
  for (const d of diagnostics) {
    console.log(`[${d.severity}] ${d.code} - ${d.message}`);
  }
}
```

## Validation profiles

| Profile   | Stages run          | Description                          |
|-----------|---------------------|--------------------------------------|
| `basic`   | Structural only     | Schema conformance check             |
| `default` | Structural + Semantic | Adds referential integrity checks  |
| `strict`  | All three stages    | Adds domain-specific rule checks     |

The default profile is `default`.

## API

### `validate(document, options?): Diagnostic[]`

Validates an OSIRIS JSON document and returns an array of diagnostics.
Returns an empty array if the document is valid.

**Options:**

| Option    | Type                | Default     | Description                        |
|-----------|---------------------|-------------|------------------------------------|
| `profile` | `ValidationProfile` | `'default'` | Validation strictness level        |

### `lookupCode(code): CodeEntry | undefined`

Look up a diagnostic code by its identifier (e.g. `'V-DOC-001'`).

### `getRegistry(): Map<string, CodeEntry>`

Returns the full diagnostic code registry.

## Requirements

- Node.js >= 20.0.0

## License

[Apache-2.0](../../LICENSE)