Getting Started

Get a Postgres database running in under a minute.

1. Sign up

Create an account at basely.cc.

2. Get your API key

Copy your API key from the dashboard. Keep it secret — treat it like a password.

3. Install the CLI

npm install -g @basely-cli/cli

4. Connect

basely auth setup --url https://api.basely.cc --key <your-key>

5. Create a project

basely projects create myapp
→ Returns a Postgres connection string. Save it — shown once.

6. Run a migration

basely migration push myapp --name 001_init --file ./schema.sql

CLI Reference

All available commands.

Auth

basely auth setup --url <url> --key <key>

Projects

basely projects create [id]
basely projects list
basely projects delete <id>

Database

basely db execute <project> --sql "SELECT 1"
basely db schema <project>

Migrations

basely migration push <project> --name <name> --file <file>
basely migration list <project>

Type Generation

basely gen types <project> --out src/db.ts

MCP / AI Agents

basely ships an MCP server so AI tools like Claude and Cursor can manage databases directly — no copy-paste, no context switching.

Configuration

Add this to your claude_desktop_config.json or Cursor mcp.json:

{
  "mcpServers": {
    "basely": {
      "command": "npx",
      "args": ["-y", "@basely-cli/cli", "mcp"],
      "env": {
        "BASELY_API_URL": "https://api.basely.cc",
        "BASELY_API_KEY": "your-api-key"
      }
    }
  }
}

Available tools

create_project
delete_project
execute_sql
get_schema
apply_migration
list_migrations
gen_types

Example prompt

"Create a Postgres project called myapp, run this migration: CREATE TABLE users (id SERIAL PRIMARY KEY, email TEXT UNIQUE NOT NULL), then generate TypeScript types."

REST API

Base URL: https://api.basely.cc

Auth: pass your API key as Authorization: Bearer <key> for project routes. Account/key management routes accept a JWT from /auth/login.

MethodPathAuthDescription
POST/auth/signupCreate account
POST/auth/loginGet JWT
POST/auth/forgot-passwordSend reset email
POST/auth/reset-passwordReset with token
POST/auth/keysJWTCreate API key
GET/auth/keysJWTList API keys
DELETE/auth/keys/:idJWTRevoke key
GET/projectsAPI keyList projects
POST/projectsAPI keyCreate project
DELETE/projects/:idAPI keyDelete project
POST/projects/:id/queryAPI keyExecute SQL
GET/projects/:id/schemaAPI keyGet schema
POST/projects/:id/migrationsAPI keyApply migration
GET/projects/:id/migrationsAPI keyList migrations

Plans & Billing

Start for free. Upgrade when you need more projects.

Hobby

Free

1 project

Indie

$5/mo

3 projects

Builder

$15/mo

10 projects

Upgrade, downgrade, or cancel anytime from the dashboard. Billing is handled securely via Stripe. Downgrades take effect at the end of your billing period.