# prisma-client-cli

> Generates a CLI from your Prisma schema that allows you to query, seed, and export data

Latest version **0.1.1** (published 2022-12-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install prisma-client-cli
pnpm add prisma-client-cli
yarn add prisma-client-cli
bun add prisma-client-cli
```

Provides the command `prisma-client-cli`.

## Health

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

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2022-12-03 |
| First published | 2022-12-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14.0 |
| Dependencies | 3 |
| Unpacked size | 31.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kishan Gajera |
| Maintainers | kgajera |
| Keywords | prisma, generator, cli |

## Links

- npm: https://www.npmjs.com/package/prisma-client-cli
- Repository: https://github.com/kgajera/prisma-client-cli
- Homepage: https://github.com/kgajera/prisma-client-cli#readme
- Issues: https://github.com/kgajera/prisma-client-cli/issues
- npm.io page: https://npm.io/package/prisma-client-cli

## Dependencies (3)

- [ejs](https://npm.io/package/ejs.md) ^3.1.8
- [@prisma/internals](https://npm.io/package/@prisma/internals.md) ^4.7.0
- [@prisma/generator-helper](https://npm.io/package/@prisma/generator-helper.md) 4.7.0

## Recent versions

- 0.1.1 (latest) — 2022-12-03
- 0.1.0 — 2022-12-03

## README

# Prisma Client CLI

[![npm](https://img.shields.io/npm/v/prisma-client-cli)](https://www.npmjs.com/package/prisma-client-cli)
[![CI](https://github.com/kgajera/prisma-client-cli/actions/workflows/CI.yml/badge.svg)](https://github.com/kgajera/prisma-client-cli/actions/workflows/CI.yml)

A Prisma [generator](https://www.prisma.io/docs/concepts/components/prisma-schema/generators) that generates a command-line interface from your Prisma schema using [oclif](https://oclif.io). Use the CLI to run queries, seed records, or export your query results to a CSV file.

View the [example project](/example) to see it in action.

## Getting Started

1. Install the generator and oclif:

   ```
   npm install prisma-client-cli @oclif/core --save-dev
   ```

1. Add the generator to your Prisma schema:

   ```prisma
   generator cli {
     provider = "prisma-client-cli"
   }
   ```

1. Run Prisma's [`generate`](https://www.prisma.io/docs/reference/api-reference/command-reference#generate) command to generate the CLI in the `./prisma/cli/` directory:

   ```
   npx prisma generate
   ```

1. Add the following configuration for oclif to your `package.json`:
   ```json
   "oclif": {
     "commands": "./prisma/cli/commands",
     "topicSeparator": " "
   }
   ```
   For more information about oclif's configuration, refer to their [documentation](https://oclif.io).

## CLI Usage

Run `./prisma/cli/bin/run --help` to view available commands for your generated CLI.

### Exporting to CSV

Use the `--_csv` flag to output the query results as comma-separated values.

## Disable Generator

You can prevent the CLI from being generated by setting the following environment variable:

```
PRISMA_CLIENT_CLI=false
```

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