Content model migration CLI/API

I’m starting a new repo in prismic and would like to know if there is a way for me to create the model from code.

I have worked with contentful before and used contentful-migration-cli.

Is there a similar tool in prismic land?

I would like to get help with this question https://stackoverflow.com/questions/62283917

1 Like

Hello @fidel,

Welcome to the community!

We have a feature called Themes that allows you to launch a new project and create a new Prismic repository that is automatically filled with your defined Custom Types, is this. what you’re looking for?

Take a look and read more about it here:

Hi @Phil

I think that is part of the feature I’m looking for.
I think this is closer to what I’m trying to find: https://github.com/prismicio/prismic-cli/issues/11

So as I understand it now, I have custom_types folder with JSON files per type.

The only way for me to go from

{"Foo": {"bar": {...}}} --> {"Foo": {"bar": {...}, "baz": {...}}}

Is to copy-paste the JSON and update it on the UI in app.prismic.io

I’m looking to define the custom types with a typescript object and the ability to update them ie add/change fields

prismic update --env=dev // this would read and update any change on custom_types folder to the prismic dev env(not sure if prismic has emvironments)

Hey Fidel,

At the moment this is as you’ve seen, only possible on the Slice Level with Slice Machine projects. The only way to update your full custom type is to copy and paste the JSON like you’ve described.

I would also love to see this made available on the custom type level, so I’ll add another tick to the feature request tracker. Although for the moment this isn’t something that we are working on.

If/When we decide to implement this we’ll update you here and in the GitHub issue you referenced.

Also, yes Prismic has environments :slight_smile:

Thanks.

This issue has been closed due to inactivity.