MantisDocs

Quickstart

Set an app up with one command, define a table, push it, and query it with types.

You need Node.js 22.18 or newer and a Mantis account. Run everything from your app's folder.

You need a Laravel 13 app on PHP 8.3 or newer, Composer, Node.js 22.18 or newer for the shipmantis command line, and a Mantis account. Run everything from the app's folder. Plain PHP without Laravel works too; see PHP and Laravel.

Set the app up

npx shipmantis@latest init

init prints a short code and opens the browser:

Your code: WDJB-MJHT
Approve it in the browser: https://app.shipmantis.com/terminal?code=WDJB-MJHT

Approve the code there while signed in to Mantis, and the terminal carries on. It asks which project to use, or what to call a new one (the folder's name by default), writes the files below, and ends with the next steps and a link to the project in the dashboard.

Pass --new <name> to create a project without the menu, or --project <slug> to use an existing one. On an existing project, init makes a new key pair named after this machine; keys on other machines keep working, and each can be revoked on its own.

Install the SDK

npm install @shipmantis/sdk
composer config --global github-oauth.github.com "$(gh auth token)"
composer config repositories.mantis vcs https://github.com/thealexsan/mantis-php
composer require shipmantis/mantis:^0.3

The package comes from a private repository, so Composer needs a GitHub token that can read it. init wrote the keys to .env.local, which Laravel doesn't read. Copy them into .env:

.env
MANTIS_URL=https://data.shipmantis.com
MANTIS_SECRET_KEY=mk_secret_...

The app's default database connection is now the project's main database.

Define a table

mantis/schema.ts
import { defineSchema, t, table } from "@shipmantis/sdk";

export default defineSchema({
  todos: table({
    title: t.text(),
    done: t.boolean().default(false),
  }),
});

A Laravel app keeps its own migrations. Give tables a uuid id, so a single row can be rewound later:

database/migrations/2026_10_25_000000_create_todos_table.php
Schema::create('todos', function (Blueprint $table) {
    $table->uuid('id')->primary();
    $table->string('title');
    $table->boolean('done')->default(false);
    $table->timestamps();
});

Push it

npx shipmantis push
1 change:
  create_table   todos
Applied. The schema is at version 1.
php artisan migrate

It runs against the project's database, and Mantis records every write from then on. To try a migration on a copy first, set MANTIS_BRANCH to a branch.

Query it

lib/mantis.ts
import { createClient } from "@shipmantis/sdk";
import schema from "../mantis/schema";

export const mantis = createClient({
  url: process.env.MANTIS_URL!,
  key: process.env.MANTIS_SECRET_KEY!,
  schema,
});
const todos = mantis.from("todos");

await todos.insert({ title: "Ship it" });
const open = await todos.select({ where: { done: false } });
//    ^? { id: string; createdAt: string; title: string; done: boolean }[]

Eloquent works as it always does:

app/Models/Todo.php
class Todo extends Model
{
    use HasUuids;

    protected $fillable = ['title', 'done'];
}
Todo::create(['title' => 'Ship it']);
$open = Todo::where('done', false)->get();

What init wrote

init configures all six supported coding agents in one pass:

FileWhat it holds
.env.localMANTIS_URL, MANTIS_SECRET_KEY and MANTIS_PUBLISHABLE_KEY. Added to .gitignore.
.mcp.jsonThe mantis MCP server for Claude Code: npx -y shipmantis mcp.
.claude/skills/mantis/SKILL.mdWorkflow skill for Claude Code: plan first, branch for risky changes, snapshot, respect held changes.
.codex/config.tomlThe mantis MCP server for Codex, as [mcp_servers.mantis].
AGENTS.mdWorkflow rules between <!-- mantis:start --> and <!-- mantis:end -->, for Codex and other agents.
.cursor/mcp.json & .cursor/rules/mantis.mdcThe mantis MCP server and always-apply rules for Cursor.
.windsurf/mcp_config.json & .windsurfrulesThe mantis MCP server and rules for Windsurf.
.cline/mcp_settings.jsonThe mantis MCP server for Cline.
.gemini/mcp.jsonThe mantis MCP server for Antigravity.

Running init again updates its own lines and sections in these files and leaves the rest of each file alone. SKILL.md and .cursor/rules/mantis.mdc belong to Mantis and are rewritten whole. If your agent later works from an old version, give it the update prompt.

Never commit .env.local or paste a secret, agent, or branch-only key anywhere public. If a key leaks, reset it from the project's page in the dashboard.

Next

From here, ask your agent for features. It reads the schema with the 19 MCP tools, edits mantis/schema.ts, plans the migration and applies it. Anything on main that could lose data waits for you in the dashboard.

NextWhere
Add email/password, OTP, or external JWT authAuthentication
Let users read and write from the browserAccess rules
Show changes as they happenLive queries
Store embeddings & run hybrid searchVector search
Store images and documentsFiles
Stream videoVideo
Add table webhooks and cron jobsWebhooks & crons
Protect main from bulk writesWrite guardrails
Try risky changes & save checkpointsBranches · Snapshots & reset
Provision PR preview branches in GitHubGitHub PR previews
Track agent actions & undo mistakesAgent activity · Rewind

On this page