Getting started

In this chapter, you will install Contember CLI, start Contember API locally and learn how to create your first project.


Installing CLI

Contember CLI is a command line tool which contains many commands to simplify your workflow.

npm i -g @contember/cli

Creating workspace

Execute following command in a terminal:

npx contember workspace:create my-contember-workspace

It will create a directory named "my-contember-workspace" with a sample project and structure similar to this:

├── instances
│   └── default
│   ├── api
│   │   └── config.yaml
│   └── docker-compose.yaml
├── projects
│   └── sandbox
│   └── api
│   ├── acl
│   │   └── index.ts
│   ├── migrations
│   │   └── 2019-12-06-150625-init.json
│   ├── model
│   │ ├── Image.ts
│   │ ├── index.ts
│   │ └── Post.ts
│   └── index.ts
├── contember.workspace.yaml
├── package.json
└── tsconfig.json

Go to created workspace:

cd my-contember-workspace

And install NPM dependencies:

npm install

After this, you can start a Contember instance:

npx contember instance:up

In first run, you will be prompted for email and password. E-mail is for authentication purpose only and is stored only in your local database.

TIP: you can use non-ambiguous abbreviation for commands, for example you can run previous command using npx contember i:u

Now that your local Contember instance is running, explore an API overview or start defining schema of your spanking new project.