create-agentlink
v1.0.1
Published
CLI for scaffolding Supabase apps with AI agents
Readme
agentlink
CLI for scaffolding Supabase apps with AI agents.
Install
npm install -g agentlinkUsage
Run the interactive wizard:
agentlink initOr pass options directly:
agentlink init --name my-app
agentlink init --name my-app --skip-skillsWhat it does
- Creates a new project directory
- Installs the Supabase CLI (if not already installed)
- Installs the Agent Link plugin
- Configures Claude Code with MCP server and settings
- Installs companion skills (Supabase best practices, frontend design, Vercel/Next.js)
- Initializes a git repository
- Launches Claude Code with your prompt
Template Architecture
Scaffolded projects get their files from src/template/supabase/, which mirrors
the target directory structure. SQL files are loaded as text by esbuild's built-in
text loader. Edge function .ts files are loaded as text by a custom esbuild
plugin (see tsup.config.ts).
All template files are imported and registered in src/templates.ts:
TEMPLATE_FILES— map of relative path → content, used bywriteTemplateFiles()EXEC_SQL— subset of SQL that gets executed against the database during setupcomputeSetupHash()— integrity hash for the agentlink manifest
Files that depend on runtime values (config.toml, .env, seed SQL) are generated
dynamically in src/supabase.ts and are not part of the template directory.
Adding a new scaffolded file
- Create the file at its target path under
src/template/supabase/(e.g.,src/template/supabase/functions/my-function/index.ts) - If it's a
.tsfile, add a type declaration insrc/template.d.ts:declare module "./template/supabase/functions/my-function/index.ts" { const content: string; export default content; } - In
src/templates.ts, add the import and register it inTEMPLATE_FILES:import myFunction from "./template/supabase/functions/my-function/index.ts"; // ... "functions/my-function/index.ts": myFunction, - If the file is SQL that needs to be executed against the database during setup,
also add it to the
EXEC_SQLobject and call it fromscaffold.ts.
Development
npm install
npm run build
npm run dev # watch mode