emdash-cli

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

Updated Aug 14, 2026
One-click install
npx skills add https://github.com/tatran0195/emdash-with-docs --skill emdash-cli-tatran0195
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: emdash-cli
Source: https://github.com/tatran0195/emdash-with-docs/tree/main/templates/blank/.agents/skills/emdash-cli
Command: npx skills add https://github.com/tatran0195/emdash-with-docs --skill emdash-cli-tatran0195

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing an EmDash CMS instance programmatically requires scripting against its HTTP API, handling authentication, Portable Text conversion, and draft/publish lifecycles manually. This Skill lets you operate a running EmDash instance directly from the command line with agent-friendly defaults like auto-publishing and optimistic concurrency. ## Core Features & Use Cases - Content CRUD with Auto-Publish: Create, read, update, and delete content with automatic markdown-to-Portable-Text conversion and read-after-write consistency via _rev tokens. - Schema, Media, and Taxonomy Management: Define collections and fields, upload media assets, manage taxonomy terms and menus, and run full-text search. - Type Generation & Auth: Generate TypeScript types from a local or remote instance and authenticate via OAuth device flow, service tokens, or Cloudflare Access headers. - Use Case: An AI agent needs to publish a new blog post to an EmDash site. It runs emdash content create posts --data '{"title": "Hello", "body": "# World"}', and the CLI 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, so the returned item is already in published status.

How do I update EmDash content without overwriting changes?▼

Updates require a `_rev` token obtained from a prior `content get`. Pass it via `--rev`; if the item changed since your read, the server returns a 409 Conflict, and you re-read and retry with the fresh token.

Does the EmDash CLI work with sites behind Cloudflare Access?▼

Yes. Pass service token headers with `--header` flags or the EMDASH_HEADERS environment variable during login. If cloudflared is installed, the CLI can also obtain a JWT via the Cloudflare Access browser flow for interactive use.

Can I generate TypeScript types from an EmDash instance?▼

Yes. Run `npx emdash types` against a local dev server or add `--url` for a remote instance. It writes TypeScript interfaces to `.emdash/types.ts` and the schema to `.emdash/schema.json`.

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

The `get` command returns pending draft data if one exists, such as an unpublished edit from the admin UI. Use the `--published` flag to see only published data, or `--raw` to skip Portable Text to markdown conversion.