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
43 lines (33 loc) • 1.64 kB
text/typescript
import {type CliCommandDefinition} from '@sanity/cli'
const description = `Downloads and validates all document specified in a workspace`
const helpText = `
Options
-y, --yes Skips the first confirmation prompt.
--workspace <name> The name of the workspace to use when downloading and validating all documents.
--dataset <name> Override the dataset used. By default, this is derived from the given workspace.
--file <filepath> Provide a path to either an .ndjson file or a tarball containing an .ndjson file.
--format <pretty|ndjson|json> The output format used to print the found validation markers and report progress.
--level <error|warning|info> The minimum level reported out. Defaults to warning.
--max-custom-validation-concurrency <number> Specify how many custom validators can run concurrently. Defaults to 5.
Examples
sanity documents validate --workspace default
sanity documents validate --workspace default --dataset staging
sanity documents validate > report.txt
sanity documents validate --level info
`
const validateDocumentsCommand: CliCommandDefinition = {
name: 'validate',
group: 'documents',
signature: '',
description,
helpText,
action: async (args, context) => {
const mod = await import('../../actions/validation/validateAction')
return mod.default(args, context)
},
} satisfies CliCommandDefinition
export default validateDocumentsCommand