sanity
Version:
Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches
36 lines (27 loc) • 1.07 kB
text/typescript
import {type CliCommandDefinition} from '@sanity/cli'
const description = 'Validates all schema types specified in a workspace.'
const helpText = `
Options
--workspace <name> The name of the workspace to use when validating all schema types.
--format <pretty|ndjson|json> The output format used to print schema errors and warnings.
--level <error|warning> The minimum level reported out. Defaults to warning.
Examples
sanity schema validate --workspace default
sanity schema validate > report.txt
sanity schema validate --level error
`
const validateDocumentsCommand: CliCommandDefinition = {
name: 'validate',
group: 'schema',
signature: '',
description,
helpText,
action: async (args, context) => {
const mod = await import('../../actions/schema/validateAction')
return mod.default(args, context)
},
} satisfies CliCommandDefinition
export default validateDocumentsCommand