How to use CLI to export/import layouts

Expected behavior

Use the forest-cli tool to export and or import customizations from one project to another? Find detailed and meaningful documentation for usage of the forest-cli tool, i.e. the complete set of commands and what they are each used for. The online documentation does not currently match the help output but the help output is not enough to figure out how to use the tool.

Actual behavior

Install forest-cli. Navigate to a project directory.

  1. try “forest init”. Error message:
    This project does not support branches yet. Please migrate your environments from your Project settings first.

No idea what this means or how to do it.

  1. Read forest-cli “schema” command help: “Apply the current schema of your repository to the specified environment.”
    What is the current schema? What is the specified environment and how do you specify it?

  2. Test “forest schema: apply”. Response indicates that it is “Sending “./.forestadmin-schema.json”…”. How and where is it sending it?

Failure Logs

  1. forest init
    ✓ Selecting your project
    :heavy_multiplication_x: Analyzing your setup

This project does not support branches yet. Please migrate your environments from your Project settings first.

  1. Apply the current schema of your repository to the specified environment (using your “.forestadmin-schema.json” file).

  2. forest schema:apply
    Reading “./.forestadmin-schema.json”…
    Using the forest environment secret found in the environment variable “FOREST_ENV_SECRET”
    Sending “./.forestadmin-schema.json”…
    The schema is the same as before, nothing changed.

  3. try copying a “frestadmin-schema.json” file from an environment with layout changes applied to an environment using the same database but without any layout changes applied. Then setting environment variable to match target environment without layout changes. Then running “forest schema:apply” command. Same result: “The schema is the same as before, nothing changed.”

Hi @jesse-elve,

I am afraid that the Forest CLI does not expose such import/export layout feature.
I am not convinced it make sense to have the ability to do so from one project to another, as 2 projects have in theory very different configurations (environments, schemas, teams, users,…).

But I’d love to know more about your Forest Admin usage and learn more about your needs.

1 Like