Skip to content

Bug: prisma version --json should suppress all non-json output #27005

@dcdq

Description

@dcdq

Bug description

Related issue with an implemented fix: #25478

Severity

🔹 Minor: Unexpected behavior, but does not block development

Reproduction

As in referenced issue.

Expected vs. Actual Behavior

Expected:

prisma version --json

{
  "prisma": "6.6.0",
  "@prisma/client": "6.6.0",
  <snip>
}

Actual:

prisma version --json

Prisma schema loaded from schema.prisma
{
  "prisma": "6.6.0",
  "@prisma/client": "6.6.0",
  <snip>
}

Frequency

Consistently reproducible

Does this occur in development or production?

Both development and production

Is this a regression?

I have not tested if this is a regression, currently writing a starship custom command to render the prisma version in prompt and facing this issue. The assumption based on the referenced issue is that this was always broken as the --json flag does not seem to be respected as its name should imply.

Workaround

Undesirable conditional operations on command output, culminating in a well-formed call to jq

Prisma Schema & Queries

generator client {
  provider = "prisma-client-js"
  output   = "./_generated"
}

datasource db {
  provider = "sqlite"
  url      = "file:./dev.db"
}

model User {
  id    Int    @id @default(autoincrement())
  name  String
  email String @unique
}

Prisma Config

no prisma.config.ts

Logs & Debug Info

// Debug logs here

Environment & Setup

  • OS: nixos
  • Database: sqlite
  • Node.js version: 22.14.0

Prisma Version

Prisma schema loaded from schema.prisma
prisma                  : 6.6.0
@prisma/client          : 6.6.0
Computed binaryTarget   : linux-nixos
Operating System        : linux
Architecture            : x64
Node.js                 : v22.14.0
TypeScript              : unknown
Query Engine (Node-API) : libquery-engine 0000000000000000000000000000000000000000 (at ../../../../../../nix/store/hk28hsc1rp67jysirx2aj46zjbnx5k7a-prisma-engines-6.6.0/lib/libquery_engine.node, resolved by PRISMA_QUERY_ENGINE_LIBRARY)
Schema Engine           : schema-engine-cli 0000000000000000000000000000000000000000 (at ../../../../../../nix/store/hk28hsc1rp67jysirx2aj46zjbnx5k7a-prisma-engines-6.6.0/bin/schema-engine, resolved by PRISMA_SCHEMA_ENGINE_BINARY)
Schema Wasm             : @prisma/prisma-schema-wasm 6.6.0-53.f676762280b54cd07c770017ed3711ddde35f37a
Default Engines Hash    : f676762280b54cd07c770017ed3711ddde35f37a
Studio                  : 0.511.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug/2-confirmedBug has been reproduced and confirmed.kind/bugA reported bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions