Convex Snippets for VS Code & Cursor

Boost your Convex development with intelligent code snippets. Write queries, mutations, and actions faster than ever.

Why Convex Snippets?

Lightning Fast

Write Convex functions in seconds with smart snippets that follow best practices.

No Duplicate Imports

Smart import system prevents duplicate imports when using multiple snippets.

Complete Coverage

Supports queries, mutations, actions, internal functions, and React hooks.

Available Snippets

Server-side Functions

  • cqf - Query Function
  • cmf - Mutation Function
  • caf - Action Function
  • ciqf - Internal Query
  • cimf - Internal Mutation

CRUD Operations

  • cmfins - Insert
  • cmfupd - Update
  • cmfdel - Delete
  • cqfid - Get by ID
  • cqffil - With Filter

Client-side Hooks

  • cuq - useQuery
  • cum - useMutation
  • cua - useAction

Imports

  • cimport-server - Server functions
  • cimport-values - Validators
  • cimport-react - React hooks

Installation

For Cursor

  1. 1. Open Cursor
  2. 2. Press Cmd+Shift+X
  3. 3. Search for "Convex Snippets"
  4. 4. Click Install
View on OpenVSX →

For VS Code

  1. 1. Open VS Code
  2. 2. Press Cmd+Shift+X
  3. 3. Search for "Convex Snippets"
  4. 4. Click Install
View on Marketplace →

Quick Example

Type the snippet prefix and press Tab:

import { query } from "./_generated/server";
import { v } from "convex/values";
export const
myQuery = query({
  args: {
    // cursor stops here
  },
  handler: async (ctx, args) => {
    // your code here
  },
});