---
title: "Start a project and add interfaces"
description: "Create main.yaml, add an interface with its local driver and a test, and check the machine and project."
section: "guides"
status: "Planned for 0.3"
spec: "fast-start"
canonical: "https://mainsdk.dev/docs/guides/start-a-project"
updated: "2026-10-28"
---

# Start a project and add interfaces

> Create main.yaml, add an interface with its local driver and a test, and check the machine and project.

Status: Planned for 0.3 · Canonical: https://mainsdk.dev/docs/guides/start-a-project · Updated: 2026-10-28

You will create a MainSDK project, add the interfaces you need one at a time, and check that the machine and the project are healthy. It takes about 10 minutes.

## You need

- Node 22.18 or later and a repository for your app.

## 1. Create the project

```bash
npx mainsdk init
```

This writes `main.yaml` with a project id and the local `auth`, `db` and `files` drivers, logging and a deny-by-default network (the default `indie` preset; `--preset minimal` writes only the four required keys), and adds `.mainsdk/` to `.gitignore`. Running it again in the same repository exits 2 unless you pass `--force` or `--new-id`.

## 2. Add an interface

```bash
npx mainsdk add auth
```

`add` works for `auth`, `db`, `files`, `network`, `log`, `ai` and `pay`. It sets the interface's local driver in `main.yaml`, writes one example test and runs `check`. It never weakens a key that is already set.

## 3. Check the machine and the project

```bash
npx mainsdk doctor
```

`doctor` checks the Node version, that `main.yaml` loads and that `.mainsdk/` is ignored. It prints one `problem` line for each failure and exits 1.

## 4. Find a command

```bash
npx mainsdk --help
```

`mainsdk --help` (or `mainsdk -h`, or `mainsdk` alone) prints every command by group; `mainsdk help <command>` prints the usage, flags, examples and exit codes of one.

## Check it worked

`npx mainsdk doctor` prints `mainsdk doctor: all good` and `npx mainsdk check` passes.

## If it fails

| Output | Fix |
| --- | --- |
| `Node ... is too old` | Install Node 22.18 or later |
| `No main.yaml` | Run `npx mainsdk init` |
| `.mainsdk/ is not in .gitignore` | Add `.mainsdk/` to `.gitignore` |

## Next

- [Declare what your app uses](https://mainsdk.dev/docs/guides/declare-what-your-app-uses)
- [CLI reference](https://mainsdk.dev/docs/reference/cli)
