emdash-cli

Manages EmDash CMS content, schema, media, and taxonomies from the command line.

Updated Sep 8, 2026
One-click install
npx skills add https://github.com/Thigh-Food/emdash --skill emdash-cli-thigh-food
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: emdash-cli
Source: https://github.com/Thigh-Food/emdash/tree/main/templates/marketing-cloudflare/.agents/skills/emdash-cli
Command: npx skills add https://github.com/Thigh-Food/emdash --skill emdash-cli-thigh-food

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing a headless CMS through an admin UI is slow for scripted or agent-driven workflows. This Skill lets you operate a running EmDash instance entirely from the command line — creating and updating content, managing collections and fields, uploading media, and generating TypeScript types — with automatic draft publishing and optimistic concurrency built in. ## Core Features & Use Cases - Content CRUD with auto-publish: Create, read, update, and delete content with automatic Portable Text to markdown conversion and _rev-based optimistic concurrency so agents never overwrite unseen changes. - Schema and type generation: List and modify collections and fields, then generate TypeScript interfaces (.emdash/types.ts) from a local or remote instance. - Media, search, taxonomies, and menus: Upload media with alt text, run full-text search, manage taxonomy terms, and inspect menus — all with --json output for scripting. - Use Case: An AI agent needs to publish a new blog post: it runs emdash content create posts --data '{"title": "Hello", "body": "# World"}', which converts the markdown body to Portable Text, creates the item, and auto-publishes it in one step. ## Quick Start Ask the agent to list the published items in your posts collection using the EmDash CLI against your local dev server.

Frequently Asked Questions about emdash-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create and publish content with the EmDash CLI?

Run npx emdash content create posts --data '{"title": "Hello", "body": "# World"}'. The CLI converts markdown in portableText fields to Portable Text and auto-publishes by default; pass --draft to skip publishing.

How do I update EmDash content without overwriting changes?

First run content get to retrieve the item's _rev token, then pass it to content update via --rev. If the item changed since your read, the server returns a 409 Conflict and you re-read before retrying.

Does the EmDash CLI work with sites behind Cloudflare Access?

Yes. Pass service token headers with --header flags at login, set them via the EMDASH_HEADERS environment variable, or let the CLI use cloudflared for browser-based Access authentication. Headers persist in ~/.config/emdash/auth.json.

Can I generate TypeScript types from my EmDash schema?

Yes. Run npx emdash types against a local dev server or a remote URL with --url. It writes .emdash/types.ts with TypeScript interfaces and .emdash/schema.json, with an optional --output path.

Why does content get return different data than what I published?

content get returns pending draft data when a draft revision exists, such as an unpublished edit from the admin UI. Use the --published flag to see only the published version of the item.