> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cubby.pro/llms.txt
> Use this file to discover all available pages before exploring further.

# cubby check

> Validate project before deploying

# cubby check

Run pre-deploy validations to catch issues before deploying. This command runs the same checks that happen during `cubby deploy`, but locally.

## Usage

```bash theme={null}
cubby check
```

## What It Checks

1. **cubby.yaml exists** - Ensures this is a Cubby project
2. **package.json valid** - JSON is parseable, has `build` script
3. **Next.js config** - Checks for `output: "standalone"` (required for Docker)
4. **Prisma schema** - Validates schema if Prisma is used
5. **Build test** - Runs `npm run build` to catch compile errors

## Output

### All Checks Pass

```
Running pre-deploy checks...

✔ cubby.yaml found
✔ package.json valid
✔ Next.js standalone output configured
✔ Prisma schema valid
✔ Build successful

All checks passed! Ready to deploy.
```

### Check Failures

```
Running pre-deploy checks...

✔ cubby.yaml found
✔ package.json valid
✖ next.config missing output: "standalone" -- required for Docker builds
✔ Prisma schema valid
✖ Build failed

Type 'Item' is not assignable to type 'string'.
  app/page.tsx:15:7

Pre-deploy checks failed. Fix the issues above before deploying.
```

## When to Use

Run `cubby check` before deploying to:

* Catch build errors locally (faster feedback)
* Validate configuration before uploading
* Debug deployment failures

```bash theme={null}
# Validate first
cubby check

# Then deploy
cubby deploy
```

## Check Details

### cubby.yaml

Every Cubby app needs a `cubby.yaml` file. If missing:

```bash theme={null}
cubby init .
```

### package.json

Must have a `build` script:

```json theme={null}
{
  "scripts": {
    "build": "next build"
  }
}
```

### Next.js Standalone

Your `next.config.ts` must include:

```typescript theme={null}
const nextConfig = {
  output: 'standalone',
}

export default nextConfig
```

This is required for Docker deployment.

### Prisma Validation

If your project uses Prisma, the schema is validated:

```bash theme={null}
npx prisma validate
```

Common errors:

* Invalid relation syntax
* Missing required fields
* Type mismatches

### Build Test

The full build is run:

```bash theme={null}
npm run build
```

This catches TypeScript errors, import issues, and other compile-time problems.

## Environment Variables

If your project uses Prisma, `cubby check` provides a dummy `DATABASE_URL` for validation. This allows the build to succeed without a real database connection.

## Exit Codes

| Code | Meaning                   |
| ---- | ------------------------- |
| 0    | All checks passed         |
| 1    | One or more checks failed |

## Related Commands

* [`cubby deploy`](/cli-reference/deploy) - Deploy after checks pass
* [`cubby dev`](/cli-reference/dev) - Test locally before checking
