MiniCMS Docs
Developer

CLI Guide

Use `mini-cms` to initialize config, pull, push, generate a browser client, install a local skill, list collections, and inspect collection items.

mini-cms is the command-line tool for developer-driven schema management.

Configuration Sources

The CLI resolves values in this order:

  1. command flags like --project-id
  2. values in mini.config.json
  3. environment variables with the MINI_CMS_ prefix

Supported environment variables:

MINI_CMS_BASE_URL=
MINI_CMS_WORKSPACE_ID=
MINI_CMS_PROJECT_ID=
MINI_CMS_API_KEY=

Example:

export MINI_CMS_BASE_URL=https://mini-cms-rosy.vercel.app
export MINI_CMS_WORKSPACE_ID=org_abc123
export MINI_CMS_PROJECT_ID=project_default_xyz789
export MINI_CMS_API_KEY=mcms_test_123

mini-cms pull

What It Does

  • connects your local project to a Mini CMS workspace
  • creates mini.config.json with an interactive setup flow
  • pulls collection schemas into local files
  • pushes schema changes back to the dashboard workspace
  • generates TypeScript types for your content model
  • generates a fetch-based browser client and declaration file from local mini.* files
  • installs a local .skills/mini-cms-cli/SKILL.md helper for coding agents
  • lists collections or collection items for debugging and automation

Run The CLI

After installing the CLI, run:

mini-cms --help

Generate An API Key

  1. Sign in to the dashboard.
  2. Open API Keys.
  3. Create a workspace-scoped or collection-scoped key.
  4. Copy the key and keep it somewhere secure.

First Pull

Start with interactive setup:

mini-cms init

Or create the config directly with flags:

mini-cms init \
  --base-url https://mini-cms-rosy.vercel.app \
  --workspace-id <workspace-id> \
  --api-key <api-key> \
  --project-id <project-id>

Then pull your project schema:

Your first pull can create mini.config.json, mini.collections.json, and mini.types.ts.

mini-cms pull \
  --base-url https://mini-cms-rosy.vercel.app \
  --workspace-id <workspace-id> \
  --project-id <project-id> \
  --api-key <api-key>

Files The CLI Uses

FileGenerated ByUsed ByDescription
mini.config.jsonpull, generateall commandsSaved connection defaults and local output paths.
mini.collections.jsonpullpush, generatePulled or hand-edited collection definitions.
mini.types.tspull, generateyour app codeGenerated TypeScript content types.
mini.client.jsgeneratebrowser or app codeFetch-based Mini CMS client for the public content API.
mini.client.d.tsgenerateTypeScript projectsType declarations for mini.client.js.

JSON Schema files are available in the repo and are also served by the web app:

  • packages/cli/schemas/mini.config.schema.json
  • packages/cli/schemas/mini.collections.schema.json
  • /schemas/mini.config.schema.json
  • /schemas/mini.collections.schema.json

File Schemas

mini.config.json

Example:

{
  "$schema": "https://mini-cms-rosy.vercel.app/schemas/mini.config.schema.json",
  "baseUrl": "https://mini-cms-rosy.vercel.app",
  "workspaceId": "org_123",
  "projectId": "project_123",
  "apiKey": "mcms_test_123",
  "collectionId": "col_123",
  "collectionsPath": "mini.collections.json",
  "typesPath": "mini.types.ts",
  "clientPath": "mini.client.js",
  "declarationsPath": "mini.client.d.ts"
}
FieldTypeRequiredDescription
baseUrlstringYesBase URL for your Mini CMS app.
workspaceIdstringYesWorkspace ID used by CLI commands and generated files.
projectIdstringRequired for pull and pushDefault project ID for project-scoped schema sync and generated browser client requests.
apiKeystringNo for generate, Yes for protected commandsAPI key for schema sync and protected list endpoints.
collectionIdstringNoOptional default collection scope for pull, push, or generate.
collectionsPathstringNoPath to the collection definitions file or directory.
typesPathstringNoOutput path for generated TypeScript types.
clientPathstringNoOutput path for generated browser client JavaScript.
declarationsPathstringNoOutput path for generated browser client declarations.

mini.collections.json

Example:

{
  "$schema": "https://mini-cms-rosy.vercel.app/schemas/mini.collections.schema.json",
  "workspaceId": "org_123",
  "pulledAt": "2026-03-09T12:00:00.000Z",
  "collections": [
    {
      "id": "col_testimonials",
      "name": "Testimonials",
      "slug": "testimonials",
      "description": "Client quotes and endorsements",
      "schema": [
        { "key": "title", "label": "Title", "type": "text" },
        { "key": "publishedAt", "label": "Published At", "type": "date" },
        { "key": "featured", "label": "Featured", "type": "boolean" }
      ]
    }
  ]
}

You can use the $schema field to get editor validation and autocomplete for these files.

Top-level fields:

FieldTypeRequiredDescription
workspaceIdstringNoIncluded when the file was created by pull.
pulledAtstringNoISO timestamp showing when the file was last pulled.
collectionsCollection[]YesArray of collection definitions used by push and generate.

Collection fields:

FieldTypeRequiredDescription
idstringNoExisting collection ID from the dashboard.
namestringYesHuman-readable collection name.
slugstringYesURL-safe identifier for the collection.
descriptionstring | nullNoOptional description shown in the dashboard.
schemaCollectionField[]YesFields that define each item shape.

Collection field syntax:

FieldTypeRequiredDescription
keystringYesStored field key. Must not start with _.
labelstringYesHuman-readable field label.
type"text" | "url" | "number" | "boolean" | "date"YesSupported Mini CMS field type.

mini.types.ts

This file is generated. Example shape:

export const workspaceId = "org_123" as const;

export type CollectionSlug =
  | "testimonials";

export type TestimonialsItem = {
  title: string;
  publishedAt: string;
  featured: boolean;
};

export type CollectionMap = {
  "testimonials": TestimonialsItem;
};

export type CollectionItem<T extends CollectionSlug> = CollectionMap[T];

Key exports:

ExportTypeDescription
workspaceIdstring literalThe workspace ID used during generation.
CollectionSlugunion typeUnion of all collection slugs.
<CollectionName>Itemtype aliasGenerated item type for each collection.
CollectionMapmapped object typeMaps collection slugs to item types.
CollectionItem<T>generic typeLooks up an item type from a slug.

mini.client.js

This file is generated. It exports a fetch-based browser client.

The generated declaration file makes the client type-safe against your collection slugs and item shapes.

Main exports:

ExportTypeDescription
miniCmsConfigobjectEmbedded default baseUrl, workspaceId, and projectId.
getMiniCmsCollections()functionReturns generated collection metadata.
client.collectionDefinitionsarrayGenerated collection metadata array.
client.collectionsobjectCollection query helpers keyed by JS-safe collection slug.
createMiniCmsClient()functionCreates a client with getCollectionItems().

Example usage:

import { createMiniCmsClient } from "./mini.client.js";

const client = createMiniCmsClient();

const response = await client.getCollectionItems("testimonials");

response.items[0]?.title;

const sameResponse = await client.collections.testimonials.query();

sameResponse.items[0]?.title;

Hyphenated slugs are converted into JS-safe helper keys:

await client.collections.case_studies.query();

If you need request overrides, pass them as the second argument:

const filtered = await client.getCollectionItems("testimonials", {
  page: 2,
  query: "acme",
  filters: { featured: true },
});

getCollectionItems(collectionSlug, options?) option fields:

FieldTypeRequiredDescription
collectionIdstringNoDirect collection ID override if you need to bypass the generated slug lookup.
workspaceIdstringNoOverrides the default workspace ID.
projectIdstringNoOverrides the default project ID.
pagenumberNo1-based page number.
limitnumberNoPage size.
querystringNoText search sent as q.
filtersRecord<string, string | number | boolean>NoExact-match filters sent as filter.<fieldKey>.
headersHeadersInitNoExtra request headers for fetch.

mini.client.d.ts

This file is generated for TypeScript projects using mini.client.js.

Key declarations:

ExportTypeDescription
MiniCmsCollectionDefinitiontypeCollection metadata shape.
MiniCmsCollectionSlugtypeUnion of generated collection slugs.
MiniCmsCollectionMaptypeMaps collection slugs to generated item types.
MiniCmsCollectionItem<T>generic typeLooks up the generated item type for a collection slug.
MiniCmsClientConfigtypeOverrides for baseUrl, workspaceId, and projectId.
MiniCmsGetCollectionItemsOptions<T>generic typeOptions shape for getCollectionItems(collectionSlug, options?).
MiniCmsCollectionItemsResponse<T>generic typeResponse shape returned by the public API client with typed items.

Create A Collection From Code

Edit mini.collections.json or point mini-cms to a directory of JSON collection files.

Example collection definition:

{
  "collections": [
    {
      "name": "Testimonials",
      "slug": "testimonials",
      "description": "Client quotes and endorsements",
      "schema": [
        { "key": "title", "label": "Title", "type": "text" },
        { "key": "publishedAt", "label": "Published At", "type": "date" }
      ]
    }
  ]
}

_id and _published are built-in system fields, so you should not define custom fields that start with _.

Push Local Schema

mini-cms push

You can also override the input path:

mini-cms push --collections ./collections

Pull Remote Schema

mini-cms pull

To restrict to one collection:

mini-cms pull --collection-id <collection-id>

Generate Browser Client

Use your local mini.config.json and mini.collections.json to generate a simple fetch-based client and declaration file.

mini-cms generate --project-id <project-id>

This writes mini.client.js and mini.client.d.ts by default.

Install The CLI Skill

Install the packaged CLI skill into the current project root.

mini-cms add-skill

This writes:

.opencode/skills/mini-cms-cli/SKILL.md

Project Commands

mini-cms list-projects
mini-cms project create --name "Website" --slug website
mini-cms project delete website

Collection Commands

mini-cms list-collections
mini-cms collection create --name "Testimonials" --slug testimonials --schema ./schema.json
mini-cms collection delete testimonials
mini-cms collection item list testimonials --page 1 --limit 25
mini-cms collection item insert testimonials --items="title=Hello;published=true"
mini-cms collection item insert testimonials --items-file ./items.json
cat ./items.json | mini-cms collection item insert testimonials
mini-cms collection item update testimonials --id="item_123" --value="title=Updated"
mini-cms collection item delete testimonials --id="item_123"

Commands

CommandPurposeReadsWrites
mini-cms pullPull project-scoped remote schema into local files.mini.config.jsonmini.config.json, mini.collections.json, mini.types.ts
mini-cms initCreate mini.config.json with interactive prompts.-mini.config.json
mini-cms pushPush local collection definitions to the configured project.mini.config.json, mini.collections.json-
mini-cms list-projectsList workspace projects.mini.config.json-
mini-cms project createCreate a project.mini.config.json-
mini-cms project delete <slug-or-id>Delete a project.mini.config.json-
mini-cms list-collectionsList collections for the current workspace or project.mini.config.json-
mini-cms collection createCreate a collection.mini.config.json-
mini-cms collection delete <slug-or-id>Delete a collection.mini.config.json-
mini-cms collection item list <slug-or-id>List items in a collection.mini.config.json-
mini-cms collection item insert <slug-or-id>Insert one item with --items or many with --items-file.mini.config.json-
mini-cms collection item update <slug-or-id>Update an item in a collection.mini.config.json-
mini-cms collection item delete <slug-or-id>Delete an item from a collection.mini.config.json-
mini-cms generateGenerate a fetch-based browser client from local config and collection files.mini.config.json, mini.collections.jsonmini.config.json, mini.types.ts, mini.client.js, mini.client.d.ts
mini-cms add-skillInstall the packaged CLI skill into the current project.-.opencode/skills/mini-cms-cli/SKILL.md

Detailed Command Reference


mini-cms init

Interactive setup that creates mini.config.json with prompts for base URL, workspace ID, project ID, and API key.

mini-cms init

Interactive Prompts

When run without flags, init prompts for:

  1. Base URL: Your deployed Mini CMS instance (e.g., https://mini-cms-rosy.vercel.app)
  2. Workspace ID: The workspace to connect to (e.g., org_abc123)
  3. Project ID: Default project for pull/push operations (optional)
  4. API Key: Your API key for protected operations (optional)
  5. Collections Path: Where to save pulled collections (default: mini.collections.json)
  6. Types Path: Where to save generated types (default: mini.types.ts)

Non-Interactive Mode

Pass flags directly to skip prompts:

mini-cms init \
  --base-url https://mini-cms-rosy.vercel.app \
  --workspace-id org_abc123 \
  --project-id project_default_xyz789 \
  --api-key mcms_test_123

If MINI_CMS_BASE_URL, MINI_CMS_WORKSPACE_ID, MINI_CMS_PROJECT_ID, or MINI_CMS_API_KEY are set, init uses them as defaults before prompting.

Options

OptionTypeDescription
--configstringOutput path for mini.config.json. Default: ./mini.config.json
--base-urlstringSet the base URL directly
--workspace-idstringSet the workspace ID
--project-idstringSet the default project ID
--api-keystringSet the API key
--collection-idstringSet default collection ID
--collectionsstringCollections file path
--typesstringTypes output path
--clientstringClient output path
--declarationsstringDeclarations output path

Output

Creates mini.config.json:

{
  "baseUrl": "https://mini-cms-rosy.vercel.app",
  "workspaceId": "org_abc123",
  "projectId": "project_default_xyz789",
  "apiKey": "mcms_test_123"
}

Use Cases

  • First-time setup for a new project
  • Re-initializing after deleting mini.config.json
  • Creating multiple config files for different environments

mini-cms pull

Downloads the remote schema from a project and saves it to local files.

mini-cms pull --project-id <project-id>

What It Does

  1. Connects to the configured Mini CMS instance
  2. Fetches all collections in the specified project
  3. Writes mini.collections.json with collection definitions
  4. Generates mini.types.ts with TypeScript types
  5. Updates mini.config.json with the project ID

Basic Usage

# Pull all collections from a project
mini-cms pull --project-id project_default_xyz789
# With config file
mini-cms pull

Pull a Single Collection

# Only pull one collection by ID
mini-cms pull --project-id project_default_xyz789 --collection-id col_testimonials

Options

OptionTypeRequiredDescription
--base-urlstringNo*Mini CMS base URL (*if not in config)
--workspace-idstringNo*Workspace ID (*if not in config)
--project-idstringYesProject scope for the pull
--api-keystringNo*API key (*if not in config)
--collection-idstringNoRestrict pull to one collection
--collectionsstringNoOutput path for mini.collections.json
--typesstringNoOutput path for mini.types.ts

Output Files

mini.collections.json:

{
  "workspaceId": "org_abc123",
  "pulledAt": "2026-03-11T10:30:00.000Z",
  "collections": [
    {
      "id": "col_testimonials",
      "name": "Testimonials",
      "slug": "testimonials",
      "description": "Client quotes",
      "schema": [
        { "key": "title", "label": "Title", "type": "text" },
        { "key": "featured", "label": "Featured", "type": "boolean" }
      ]
    }
  ]
}

mini.types.ts:

export const workspaceId = "org_abc123" as const;
export type CollectionSlug = "testimonials";
export type TestimonialsItem = {
  title: string;
  featured: boolean;
};
export type CollectionMap = {
  "testimonials": TestimonialsItem;
};
export type CollectionItem<T extends CollectionSlug> = CollectionMap[T];

Use Cases

  • Setting up a new local project
  • Syncing schema changes made in the dashboard
  • Generating TypeScript types for your content model

mini-cms push

Uploads local collection definitions to the remote project.

mini-cms push --project-id <project-id>

What It Does

  1. Reads collection definitions from mini.collections.json (or a directory)
  2. Creates any collections that don't exist in the project
  3. Updates existing collections with new schema fields
  4. Preserves existing items in updated collections

Basic Usage

# Push all collections from default file
mini-cms push --project-id project_default_xyz789
# Push from a directory of collection files
mini-cms push --project-id project_default_xyz789 --collections ./collections

Input File Format

Single file (mini.collections.json):

{
  "collections": [
    {
      "name": "Testimonials",
      "slug": "testimonials",
      "description": "Client quotes",
      "schema": [
        { "key": "title", "label": "Title", "type": "text" }
      ]
    }
  ]
}

Directory (each file is a collection):

collections/
  testimonials.json
  partners.json

Each file:

{
  "name": "Testimonials",
  "slug": "testimonials",
  "schema": [
    { "key": "title", "label": "Title", "type": "text" }
  ]
}

Options

OptionTypeRequiredDescription
--base-urlstringNo*Mini CMS base URL (*if not in config)
--workspace-idstringNo*Workspace ID (*if not in config)
--project-idstringYesTarget project for push
--api-keystringNo*API key (*if not in config)
--collection-idstringNoRestrict push to one collection
--collectionsstringNoInput file or directory

Use Cases

  • Deploying schema changes from local code to the dashboard
  • Creating new collections programmatically
  • Syncing field changes across environments

mini-cms generate

Creates a fetch-based browser client and TypeScript types from local collection files.

mini-cms generate --project-id <project-id>

What It Does

  1. Reads mini.collections.json for collection definitions
  2. Generates mini.types.ts with TypeScript types
  3. Generates mini.client.js with a fetch-based client
  4. Generates mini.client.d.ts with type declarations

Basic Usage

# Generate with default paths
mini-cms generate --project-id project_default_xyz789
# Custom output paths
mini-cms generate \
  --project-id project_default_xyz789 \
  --types ./src/cms-types.ts \
  --client ./src/cms-client.js \
  --declarations ./src/cms-client.d.ts

Options

OptionTypeRequiredDescription
--base-urlstringNo*Public Mini CMS base URL
--workspace-idstringNo*Default workspace ID
--project-idstringRecommendedDefault project ID
--collection-idstringNoRestrict to one collection
--collectionsstringNoInput collections file
--typesstringNoTypes output path
--clientstringNoClient output path
--declarationsstringNoDeclarations output path

Generated Client Usage

import { createMiniCmsClient } from "./mini.client.js";

const client = createMiniCmsClient();

// Get testimonials
const response = await client.getCollectionItems("testimonials");
console.log(response.items[0]?.title);

// Or use the typed helper
const testimonials = await client.collections.testimonials.query();

Use Cases

  • Building a static site that fetches content at runtime
  • Adding CMS content to an existing web app
  • Type-safe content fetching in frontend code

mini-cms list-projects

Lists all projects in the configured workspace.

mini-cms list-projects

Basic Usage

mini-cms list-projects

Output:

Projects in workspace org_abc123:

  default (project_default_xyz789)
  website (project_website_abc123)

Options

OptionTypeRequiredDescription
--base-urlstringNo*Mini CMS base URL
--workspace-idstringNo*Workspace ID
--api-keystringNo*API key

Use Cases

  • Finding project IDs for pull/push operations
  • Checking which projects exist in a workspace
  • Automation scripts that need project information

mini-cms project create

Creates a new project in the workspace.

mini-cms project create --name "My Project" --slug my-project

Basic Usage

mini-cms project create \
  --name "Website" \
  --slug website

Options

OptionTypeRequiredDescription
--namestringYesProject display name
--slugstringYesURL-friendly project identifier
--base-urlstringNo*Mini CMS base URL
--workspace-idstringNo*Workspace ID
--api-keystringNo*API key

Use Cases

  • Creating a new project for a client site
  • Setting up separate projects for dev/staging/prod

mini-cms project delete

Deletes a project and all its collections and items.

mini-cms project delete <slug-or-id>

Basic Usage

# By slug
mini-cms project delete website

# By ID
mini-cms project delete project_website_abc123

Warning

This deletes the project and ALL collections and items within it. This action cannot be undone.

# Confirmation prompt
? Delete project "website"? This will delete all collections and items. (y/N)

Options

OptionTypeRequiredDescription
<slug-or-id>stringYesProject slug or ID
--base-urlstringNo*Mini CMS base URL
--workspace-idstringNo*Workspace ID
--api-keystringNo*API key

Use Cases

  • Cleaning up old projects
  • Removing test environments

mini-cms list-collections

Lists collections in the workspace or project.

mini-cms list-collections

Basic Usage

# List all collections in workspace
mini-cms list-collections
# Filter by project
mini-cms list-collections --project-id project_default_xyz789

Output

Collections in workspace org_abc123:

  testimonials (col_testimonials)
    - Client quotes and endorsements
    - 2 fields: title, featured
  
  partners (col_partners)
    - Partner logos and info
    - 3 fields: name, logo, url

Options

OptionTypeRequiredDescription
--base-urlstringNo*Mini CMS base URL
--workspace-idstringNo*Workspace ID
--project-idstringNoFilter by project
--api-keystringNo*API key

Use Cases

  • Viewing available collections
  • Finding collection IDs for scripts
  • Checking collection field counts

mini-cms collection create

Creates a new collection in a project.

mini-cms collection create --name "Testimonials" --slug testimonials

Basic Usage

# Simple collection with default text field
mini-cms collection create \
  --name "Testimonials" \
  --slug testimonials \
  --project-id project_default_xyz789
# With description and schema file
mini-cms collection create \
  --name "Testimonials" \
  --slug testimonials \
  --description "Client quotes and endorsements" \
  --schema ./testimonials-schema.json \
  --project-id project_default_xyz789

Schema File Format

[
  { "key": "title", "label": "Title", "type": "text" },
  { "key": "author", "label": "Author", "type": "text" },
  { "key": "featured", "label": "Featured", "type": "boolean" },
  { "key": "publishedAt", "label": "Published At", "type": "date" }
]

Options

OptionTypeRequiredDescription
--namestringYesCollection name
--slugstringYesURL-friendly identifier
--descriptionstringNoCollection description
--schemastringNoPath to JSON schema file
--project-idstringNo*Target project
--base-urlstringNo*Mini CMS base URL
--workspace-idstringNo*Workspace ID
--api-keystringNo*API key

Use Cases

  • Creating collections from scripts
  • Automation for new content types
  • CI/CD pipelines that set up collections

mini-cms collection delete

Deletes a collection and all its items.

mini-cms collection delete <slug-or-id>

Basic Usage

# By slug
mini-cms collection delete testimonials

# By ID
mini-cms collection delete col_testimonials

Warning

This deletes the collection and ALL items within it. This action cannot be undone.

? Delete collection "testimonials"? This will delete all items. (y/N)

Options

OptionTypeRequiredDescription
<slug-or-id>stringYesCollection slug or ID
--project-idstringNo*Project scope
--base-urlstringNo*Mini CMS base URL
--workspace-idstringNo*Workspace ID
--api-keystringNo*API key

Use Cases

  • Removing deprecated content types
  • Cleaning up test collections

mini-cms collection item list

Lists items in a collection.

mini-cms collection item list <slug-or-id>

Basic Usage

# List first page
mini-cms collection item list testimonials
# Paginated
mini-cms collection item list testimonials --page 2 --limit 50

Output

Items in "testimonials" (col_testimonials):

  [1] item_abc123
      title: "Great product!"
      author: "John Doe"
      featured: true
  
  [2] item_def456
      title: "Amazing service"
      author: "Jane Smith"
      featured: false

Options

OptionTypeRequiredDescription
<slug-or-id>stringYesCollection slug or ID
--pagenumberNoPage number (default: 1)
--limitnumberNoItems per page (default: 10)
--project-idstringNo*Project scope
--base-urlstringNo*Mini CMS base URL
--workspace-idstringNo*Workspace ID
--api-keystringNo*API key

Use Cases

  • Inspecting collection content
  • Finding item IDs for updates/deletes
  • Debugging content issues

mini-cms collection item insert

Adds one or more items to a collection.

mini-cms collection item insert <slug-or-id>

Single Item with --items

mini-cms collection item insert testimonials \
  --items "title=Great product!;author=John Doe;featured=true"

Format: key=value;key=value where semicolons separate fields.

Single Item with --items-file

# Single object
mini-cms collection item insert testimonials \
  --items-file ./item.json

item.json:

{
  "title": "Great product!",
  "author": "John Doe",
  "featured": true
}

Multiple Items with --items-file

# Array of objects
mini-cms collection item insert testimonials \
  --items-file ./items.json

items.json:

[
  { "title": "First item", "author": "John" },
  { "title": "Second item", "author": "Jane" }
]

Stdin Input

# Pipe JSON
echo '{"title": "Piped item", "author": "Dev"}' | \
  mini-cms collection item insert testimonials
# Pipe array
cat ./items.json | mini-cms collection item insert testimonials

Auto-Generated Fields

  • slug: Auto-generated from title if not provided
  • _published: Defaults to true if not specified

Options

OptionTypeRequiredDescription
<slug-or-id>stringYesCollection slug or ID
--itemsstringNo*Item values as key=value;key=value
--items-filestringNo*JSON file with item(s)
--project-idstringNo*Project scope
--base-urlstringNo*Mini CMS base URL
--workspace-idstringNo*Workspace ID
--api-keystringNo*API key

*One of --items, --items-file, or stdin is required.

Use Cases

  • Seed data for new collections
  • Importing content from other systems
  • CI/CD content deployment

mini-cms collection item update

Updates an existing item's values.

mini-cms collection item update <slug-or-id> --id <item-id> --value "key=value"

Basic Usage

# Update single field
mini-cms collection item update testimonials \
  --id item_abc123 \
  --value "title=Updated title"
# Update multiple fields
mini-cms collection item update testimonials \
  --id item_abc123 \
  --value "title=New title;author=New Author;featured=false"

Options

OptionTypeRequiredDescription
<slug-or-id>stringYesCollection slug or ID
--idstringYesItem ID to update
--valuestringYesUpdated values as key=value;key=value
--project-idstringNo*Project scope
--base-urlstringNo*Mini CMS base URL
--workspace-idstringNo*Workspace ID
--api-keystringNo*API key

Use Cases

  • Editing content from CLI
  • Bulk updates via scripts
  • Fixing typos in published content

mini-cms collection item delete

Deletes an item from a collection.

mini-cms collection item delete <slug-or-id> --id <item-id>

Basic Usage

mini-cms collection item delete testimonials --id item_abc123

Options

OptionTypeRequiredDescription
<slug-or-id>stringYesCollection slug or ID
--idstringYesItem ID to delete
--project-idstringNo*Project scope
--base-urlstringNo*Mini CMS base URL
--workspace-idstringNo*Workspace ID
--api-keystringNo*API key

Use Cases

  • Removing deprecated content
  • Cleaning up test items
  • Automation scripts

mini-cms add-skill

Installs the Mini CMS CLI skill for coding agents.

mini-cms add-skill

What It Does

Creates .opencode/skills/mini-cms-cli/SKILL.md with:

  • CLI command reference
  • Common workflows
  • Code examples for agent use

Output Location

.opencode/skills/mini-cms-cli/SKILL.md

Usage

When using OpenCode or similar agents, they can load this skill to understand Mini CMS workflows.

Options

None. Takes no flags.


--verbose Flag

All commands support --verbose for debugging.

mini-cms pull --project-id project_default_xyz789 --verbose

What It Shows

  • HTTP request headers and URLs
  • Response status codes
  • Request/response bodies
  • Timing information

Use Cases

  • Debugging API issues
  • Understanding request flow
  • Troubleshooting authentication problems

Common Workflows

New Project Setup

# 1. Initialize config
mini-cms init \
  --base-url https://mini-cms-rosy.vercel.app \
  --workspace-id org_abc123 \
  --project-id project_default_xyz789 \
  --api-key mcms_test_123

# 2. Pull existing schema
mini-cms pull --project-id project_default_xyz789

# 3. Generate browser client
mini-cms generate --project-id project_default_xyz789

Create Collection from Code

# 1. Create collection
mini-cms collection create \
  --name "Blog Posts" \
  --slug blog-posts \
  --description "Articles and blog content" \
  --schema ./blog-schema.json \
  --project-id project_default_xyz789

# 2. Pull to get the collection ID
mini-cms pull --project-id project_default_xyz789

Seed Content

# Create items from JSON file
mini-cms collection item insert testimonials \
  --items-file ./seed-data.json \
  --project-id project_default_xyz789

Sync Schema Changes

# After editing mini.collections.json locally
mini-cms push --project-id project_default_xyz789

Tips and Best Practices

  • Always use --project-id for pull and push to avoid ambiguity
  • Keep your API key secure - never commit it to version control
  • Use --verbose when debugging issues with the CLI
  • Pull before push to ensure you have the latest schema
  • Use stdin for automated scripts that generate content dynamically
  • Collection slugs must be unique within a project

Troubleshooting

"Project not found"

  • Verify the project ID is correct with mini-cms list-projects
  • Check that your API key has access to the project

"Collection not found"

  • Use mini-cms list-collections --project-id <id> to find the collection
  • Make sure you're using the correct project

"API key required"

  • Generate an API key from the dashboard
  • Pass it with --api-key or set it in mini.config.json

Authentication errors

  • Verify your API key is valid
  • Check the workspace ID matches your account
  • Use --verbose to see exact request/response details

On this page

Configuration SourcesWhat It DoesRun The CLIGenerate An API KeyFirst PullFiles The CLI UsesFile Schemasmini.config.jsonmini.collections.jsonmini.types.tsmini.client.jsmini.client.d.tsCreate A Collection From CodePush Local SchemaPull Remote SchemaGenerate Browser ClientInstall The CLI SkillProject CommandsCollection CommandsCommandsDetailed Command Referencemini-cms initInteractive PromptsNon-Interactive ModeOptionsOutputUse Casesmini-cms pullWhat It DoesBasic UsagePull a Single CollectionOptionsOutput FilesUse Casesmini-cms pushWhat It DoesBasic UsageInput File FormatOptionsUse Casesmini-cms generateWhat It DoesBasic UsageOptionsGenerated Client UsageUse Casesmini-cms list-projectsBasic UsageOptionsUse Casesmini-cms project createBasic UsageOptionsUse Casesmini-cms project deleteBasic UsageWarningOptionsUse Casesmini-cms list-collectionsBasic UsageOutputOptionsUse Casesmini-cms collection createBasic UsageSchema File FormatOptionsUse Casesmini-cms collection deleteBasic UsageWarningOptionsUse Casesmini-cms collection item listBasic UsageOutputOptionsUse Casesmini-cms collection item insertSingle Item with --itemsSingle Item with --items-fileMultiple Items with --items-fileStdin InputAuto-Generated FieldsOptionsUse Casesmini-cms collection item updateBasic UsageOptionsUse Casesmini-cms collection item deleteBasic UsageOptionsUse Casesmini-cms add-skillWhat It DoesOutput LocationUsageOptions--verbose FlagWhat It ShowsUse CasesCommon WorkflowsNew Project SetupCreate Collection from CodeSeed ContentSync Schema ChangesTips and Best PracticesTroubleshooting"Project not found""Collection not found""API key required"Authentication errors