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 initinit prints a short code and opens the browser:
Your code: WDJB-MJHT
Approve it in the browser: https://app.shipmantis.com/terminal?code=WDJB-MJHTApprove 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/sdkcomposer 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.3The 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:
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
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:
Schema::create('todos', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('title');
$table->boolean('done')->default(false);
$table->timestamps();
});Push it
npx shipmantis push1 change:
create_table todos
Applied. The schema is at version 1.php artisan migrateIt 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
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:
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:
| File | What it holds |
|---|---|
.env.local | MANTIS_URL, MANTIS_SECRET_KEY and MANTIS_PUBLISHABLE_KEY. Added to .gitignore. |
.mcp.json | The mantis MCP server for Claude Code: npx -y shipmantis mcp. |
.claude/skills/mantis/SKILL.md | Workflow skill for Claude Code: plan first, branch for risky changes, snapshot, respect held changes. |
.codex/config.toml | The mantis MCP server for Codex, as [mcp_servers.mantis]. |
AGENTS.md | Workflow rules between <!-- mantis:start --> and <!-- mantis:end -->, for Codex and other agents. |
.cursor/mcp.json & .cursor/rules/mantis.mdc | The mantis MCP server and always-apply rules for Cursor. |
.windsurf/mcp_config.json & .windsurfrules | The mantis MCP server and rules for Windsurf. |
.cline/mcp_settings.json | The mantis MCP server for Cline. |
.gemini/mcp.json | The 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.
| Next | Where |
|---|---|
| Add email/password, OTP, or external JWT auth | Authentication |
| Let users read and write from the browser | Access rules |
| Show changes as they happen | Live queries |
| Store embeddings & run hybrid search | Vector search |
| Store images and documents | Files |
| Stream video | Video |
| Add table webhooks and cron jobs | Webhooks & crons |
Protect main from bulk writes | Write guardrails |
| Try risky changes & save checkpoints | Branches · Snapshots & reset |
| Provision PR preview branches in GitHub | GitHub PR previews |
| Track agent actions & undo mistakes | Agent activity · Rewind |