# @blueprint-pdf/cli

> Terminal-based utility for the blueprint-pdf package.

Latest version **1.0.5** (published 2023-04-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @blueprint-pdf/cli
pnpm add @blueprint-pdf/cli
yarn add @blueprint-pdf/cli
bun add @blueprint-pdf/cli
```

Provides the command `blueprint`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2023-04-12 |
| First published | 2023-04-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 13.1 KB |
| Known vulnerabilities | 0 (+12 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Robbie Symonds |
| Maintainers | desynced |

## Links

- npm: https://www.npmjs.com/package/@blueprint-pdf/cli
- Repository: https://github.com/robbiesymonds/Blueprint
- Homepage: https://github.com/robbiesymonds/Blueprint#readme
- Issues: https://github.com/robbiesymonds/Blueprint/issues
- npm.io page: https://npm.io/package/@blueprint-pdf/cli

## Dependencies (4)

- [ora](https://npm.io/package/ora.md) ^6.3.0
- [chalk](https://npm.io/package/chalk.md) ^5.2.0
- [jspdf](https://npm.io/package/jspdf.md) ^2.5.1
- [commander](https://npm.io/package/commander.md) ^10.0.0

## Recent versions

- 1.0.5 (latest) — 2023-04-12
- 1.0.4 — 2023-04-07
- 1.0.3 — 2023-04-07
- 1.0.1 — 2023-04-07

## README

# 🚧&nbsp; Blueprint  CLI

The Blueprint CLI is a command line interface for generating PDFs from schematic templates. It is built on top of the [Blueprint](https://github.com/robbiesymonds/Blueprint) library.


⚙️ *Looking for the Blueprint Library? [Find it here](https://www.npmjs.com/package/blueprint-pdf)!*


## 📦&nbsp; Installation

Blueprint CLI is available as an [npm package](https://www.npmjs.com/package/@blueprint-pdf/cli) for installation.

```sh
npm i -g @blueprint-pdf/cli
# or
yarn global add @blueprint-pdf/cli
```

## 🚀&nbsp; Usage

The CLI is a simplifed interface that allows you to interact with Blueprint without needing to spin up a client-side or server application. Simply define a template as shown below and pass it when calling the `generate` command.

### Specification
Schematics are defined using a `*.js` file that exports a single object. The object must contain a `schema` property that defines the Blueprint as specified by the [Blueprint library](https://github.com/robbiesymonds/Blueprint). You can also optionally define a `data` object inside of this file that will be used as the default data source for the template.

Data can also be passed via the `--data` option when calling the `generate` command. This can be either a JSON string or a path to a JSON file. For example:

**Schematic File:**
```ts
// Path: examples/schema.js

export default {
  schema: (data) => ({
    // ... BlueprintSchema
  });
  data: {
    // ... Record<string, any>
  },
};
```

**Using Inline Data:**
```sh
blueprint generate examples/schema.js --data '{ "name": "John Doe" }'
```

**Using a Data File:**
```sh
blueprint generate examples/schema.js --data examples/data.json
```

**Configuration Options:**
```sh
blueprint generate examples/schema.js --format A3 --orientation landscape
```

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