pull
Pull all content types
Section titled “Pull all content types”ctkit pullFetches every content type from your Contentful space and generates a TypeScript schema file for each one in your schemas/ directory. Files are automatically formatted with Prettier if a configuration is detected in your project.
Pulled 5 content types: schemas/blogPost.ts schemas/author.ts schemas/category.ts schemas/settings.ts schemas/navigation.tsBy default, ctkit will not overwrite existing schema files. If a file already exists for a content type, it is skipped and a warning is shown.
Pull a specific content type
Section titled “Pull a specific content type”ctkit pull --content-type blogPostPulls only the specified content type instead of everything in the space. Useful when you want to add a single existing type to your local schemas without touching the rest.
Overwrite existing files
Section titled “Overwrite existing files”ctkit pull --forceOverwrites existing schema files instead of skipping them. Use this to reset a local schema to match exactly what’s in Contentful.
| Flag | Description |
|---|---|
--content-type <id> | Pull only the content type with this ID. |
--force | Overwrite existing schema files instead of skipping them. |
Generated file format
Section titled “Generated file format”Each pulled content type produces a TypeScript file using the ctkit schema API:
import { contentType, fields } from '@ctkit/core';
export const blogPost = contentType('blogPost', { name: 'Blog Post', description: 'A blog post with a title, body, and author.', displayField: 'title', fields: { title: fields.symbol({ name: 'Title', required: true, }), body: fields.richText({ name: 'Body', }), author: fields.link({ name: 'Author', linkType: 'Entry', validations: [{ linkContentType: ['author'] }], }), },});All field options, validations, and appearances are preserved in the generated schema so the file is a complete representation of the remote content type.
When to use pull
Section titled “When to use pull”pull is the recommended way to adopt ctkit on an existing Contentful space. Instead of rewriting your content model from scratch:
- Run
ctkit pullto generate schema files for your current content types. - Review the generated files — adjust naming or organization as needed.
- Run
ctkit checkto confirm local and remote are in sync. - From here on, use
generate+migrate(orpush) to manage changes in code.