본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)14k · #11248

emdash-cli

하는 일

이 스킬은 EmDash 명령줄 도구를 사용해 콘텐츠와 미디어부터 스키마와 백업까지 EmDash 웹사이트를 확인하고 관리합니다. 터미널에서 작업하는 것을 선호하는 사이트 소유자와 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓터미널에서 EmDash 사이트의 콘텐츠를 나열하거나 추가하거나 바꾸고 싶을 때.
  • ✓사이트를 내보내거나 다른 곳으로 가져오려고 할 때.
  • ✓데이터베이스 마이그레이션을 준비하거나 프로젝트용 타입을 생성해야 할 때.

스킬 링크

https://github.com/emdash-cms/emdash/blob/main/skills/emdash-cli/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/emdash-cms/emdash/blob/main/skills/emdash-cli/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“명령줄에서 내 EmDash 사이트의 최신 블로그 글을 나열하고, 사이트 전체를 백업으로 내보내 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 요청에 맞는 명령을 실행합니다. 예를 들어 콘텐츠 목록 조회나 사이트 내보내기입니다. 먼저 현재 사이트를 읽어 대상을 확인하고, 사용자가 정한 범위 안에서만 변경합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

EmDash CLI

The EmDash CLI (emdash, with the short alias em) manages EmDash CMS instances. Commands fall into two categories:

  • Local commands work with project files or a configured database: init, doctor, seed, migrate, export-seed, and secrets.
  • Remote commands talk to a running EmDash instance: types, login, logout, whoami, content, schema, media, search, taxonomy, menu, and site.

Run npx emdash --help and npx emdash <command> --help for the installed version's exact commands and flags. Resolve the current target with a read command before a destructive or bulk mutation; examples in this skill do not authorize changing an instance the user did not place in scope.

Authentication

Remote commands resolve auth automatically:

  1. --token flag
  2. EMDASH_TOKEN env var
  3. Stored credentials from emdash login
  4. Dev bypass (localhost only — no token needed)

For a localhost development server with the development bypass enabled, the client can authenticate automatically. For a remote instance, run emdash login --url https://example.com or provide a scoped token.

Custom Headers & Reverse Proxies

Sites behind Cloudflare Access or other reverse proxies need auth headers on every request. The CLI supports this via --header flags and environment variables.

Service tokens for automation

# Provide sensitive headers through the environment in CI.
export EMDASH_HEADERS="CF-Access-Client-Id: xxx
CF-Access-Client-Secret: yyy"
npx emdash whoami --url https://example.com

emdash login --header persists custom headers to ~/.config/emdash/auth.json for later commands. Prefer environment-provided headers in CI so a service secret is not written to the credential file or shell history.

Cloudflare Access Browser Flow

If you don't have service tokens and cloudflared is installed, the CLI will automatically:

  1. Detect when Access blocks the request
  2. Try to get a cached JWT via cloudflared access token
  3. Fall back to cloudflared access login for browser-based auth

This works for interactive use but isn't suitable for CI. Use service tokens for automation.

Generic Reverse Proxy Auth

The --header flag works with any auth scheme:

# Basic auth
npx emdash login --url https://example.com -H "Authorization: Basic dXNlcjpwYXNz"

# Custom auth header
npx emdash login --url https://example.com -H "X-API-Key: secret123"

Quick Reference

Database Setup

For normal site startup, use the project's package script. The first request runs pending migrations and, before setup is completed, applies the bundled seed's schema and structure once; sample content comes from the setup wizard, /_emdash/api/setup/dev-bypass, or emdash seed. The Astro integration generates emdash-env.d.ts when the server starts.

# Start the site with its package script
pnpm dev

# Export an existing database as a seed file
# (the runtime auto-discovers .emdash/seed.json on first boot;
# `mkdir -p` because the directory may not exist yet)
mkdir -p .emdash
npx emdash export-seed > .emdash/seed.json
npx emdash export-seed --with-content=all > .emdash/seed.json

Type Generation

# Generate types from local dev server
npx emdash types

# Generate from remote
npx emdash types --url https://example.com

# Custom output path
npx emdash types --output src/types/cms.ts

Writes .emdash/types.ts (TypeScript interfaces) and .emdash/schema.json.

Authentication

# Login (OAuth Device Flow)
npx emdash login --url https://example.com

# Check current user
npx emdash whoami

# Logout
npx emdash logout

# Generate an encryption key for deployment
npx emdash secrets generate

Content CRUD

The CLI is designed for agents. Create and update auto-publish by default so agents get read-after-write consistency without managing drafts.

# List content
npx emdash content list posts
npx emdash content list posts --status published --limit 10

# Get a single item (Portable Text fields converted to markdown)
# Returns draft data if a pending draft exists
npx emdash content get posts 01ABC123
npx emdash content get posts 01ABC123 --raw        # skip PT->markdown conversion
npx emdash content get posts 01ABC123 --published   # ignore pending drafts

# Create content (auto-publishes by default)
npx emdash content create posts --data '{"title": "Hello", "body": "# World"}'
npx emdash content create posts --file po
자주 묻는 질문

어떻게 로그인하나요?

저장된 로그인, 사용자가 제공한 토큰, 또는 localhost에서의 개발용 우회를 사용합니다.

프록시 뒤에 있는 사이트에서도 작동하나요?

네. Cloudflare Access 같은 서비스 뒤에 있는 사이트를 위해 사용자 지정 헤더를 지원합니다.

지정하지 않은 사이트를 바꾸나요?

아니요. 스킬이 먼저 대상을 확인하며, 변경은 사용자가 정한 범위 안에서만 이뤄집니다.

상세 정보

작성자의 원본 설명

Use the EmDash CLI to inspect and manage an EmDash instance from the command line, including content, schema, media, taxonomies, menus, search, authentication, seeds, migrations, generated types, and whole-site export and import.

repo: emdash-cms/emdash

인기도

GitHub 스타
14k
순위
#11248
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬