There are many reasons why you may want to import a space to your filesystem:
- Archiving a snapshot of your space at a moment in time that you can spin to a new space
- Building space templates for specific codebases
To import a space to your filesystem:
-
Copy your space private key from account settings ( or generate one if you don’t have one already)
-
Install
@builder.io/cli
globally using npm:
npm install @builder.io/cli -g
- Use the cli to import your space from the command line, by passing the private key and your output directory in the next command
builder import -k [PRIVATE KEY] -o [OUTPUT DIRECTORY]
And now you’re done! You can take this space and commit it along your code if you’re building a starter template, or just save it for archiving purposes.
Then you can create a new space out of this template using:
builder create --key [ROOT ORG Private Key] --name [NEW SPACE NAME] --debug