Pull-first Workflow
The pull-first workflow is for teams that already have content types in Contentful and want to start managing them with ctkit. Instead of recreating your content model by hand, ctkit generates TypeScript schema files from your existing space.
How it works
Section titled “How it works”pull → review generated schemas → adjust → continue with migration or push- Pull — ctkit reads your Contentful content types and generates schema files.
- Review — inspect the generated code, make adjustments.
- Continue — switch to the migration or push workflow for ongoing changes.
Step by step
Section titled “Step by step”1. Pull your content types
Section titled “1. Pull your content types”ctkit pullctkit connects to your Contentful space, reads every content type, and generates a .ts file for each one in your schemas/ directory:
✓ Pulled 5 content types schemas/blogPost.ts schemas/author.ts schemas/category.ts schemas/navigation.ts schemas/siteSettings.tsTo pull a specific content type:
ctkit pull --content-type blogPostTo overwrite existing local files:
ctkit pull --force2. Review the generated schemas
Section titled “2. Review the generated schemas”Open the generated files and verify they look correct. ctkit maps Contentful field types, validations, and settings into their schema equivalents as accurately as possible.
ctkit checkIf check reports everything is in sync, the generated schemas faithfully represent your remote content model.
3. Make adjustments
Section titled “3. Make adjustments”You may want to:
- Reorganize files — move schemas into subdirectories (e.g.,
schemas/blog/blogPost.ts). ctkit auto-discovers all.tsand.jsfiles regardless of nesting. - Add comments — annotate fields with context that only exists in your team’s heads.
- Clean up names — rename the exported variables for consistency.
- Review edge cases — complex field configurations, deeply nested validations, or unusual content type setups may need manual tweaking.
4. Continue with your preferred workflow
Section titled “4. Continue with your preferred workflow”From here, you have two options:
Migration workflow (recommended for teams):
# Make a schema change, then:ctkit generatectkit migratectkit checkPush workflow (for rapid iteration):
# Make a schema change, then:ctkit push- Run
checkafter pulling. If the output shows no differences, you know the pull was accurate. If there are diffs, review and adjust before continuing. - Commit the generated files. Once you’re happy with the schemas, commit them to source control. They’re now the source of truth for your content model.
- Pull is a one-time operation. You use it to bootstrap your local schemas. After that, you make changes locally and push or migrate them to Contentful — not the other way around.
- System content types are skipped. ctkit won’t pull its own internal content types (like
ctkit_migration_history).