You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improves package-profile and automated-release setup: missing manifests point to the plugin-directory command, GitHub repository prompts use a detected `origin` remote, setup failures omit stack traces, and a published profile shows both manual and GitHub Actions release commands.
Copy file name to clipboardExpand all lines: docs/src/content/docs/plugins/creating-plugins/cli.mdx
+16-6Lines changed: 16 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,16 @@ import { Steps } from "@astrojs/starlight/components";
9
9
10
10
The CLI uses an [Atmosphere account](/plugins/creating-plugins/publishing/#your-atmosphere-account) as the publisher identity for package profiles and releases.
11
11
12
+
## Install the CLI
13
+
14
+
Plugins created with `pnpm dlx @emdash-cms/plugin-cli init` already include the CLI as a pinned development dependency. Add it to an existing plugin before using the other commands:
15
+
16
+
```sh
17
+
pnpm add -D @emdash-cms/plugin-cli
18
+
```
19
+
20
+
The examples use `pnpm exec emdash-plugin` so each command runs the version installed in the plugin. Use `pnpm dlx` for the one-off `init` command, not for repeated build, login, or release commands.
21
+
12
22
## Commands
13
23
14
24
The CLI provides the following commands:
@@ -51,7 +61,7 @@ The following example shows the two scripts most plugins add to `package.json`:
51
61
Create a new plugin with `init`:
52
62
53
63
```sh
54
-
npx @emdash-cms/plugin-cli init my-plugin
64
+
pnpm dlx @emdash-cms/plugin-cli init my-plugin
55
65
```
56
66
57
67
This scaffolds `emdash-plugin.jsonc`, `src/plugin.ts`, `package.json`, `tsconfig.json`, `vitest.config.ts`, a workerd-backed test, a README, `AGENTS.md`, a local `creating-plugins` skill, and package-manager configuration. `.agents/skills` and `.claude/skills` link to the canonical `skills` directory, and `.claude/CLAUDE.md` links to `AGENTS.md`, so Codex and Claude use the same project guidance. The source starts with one route assigned to a `SandboxedPlugin`-typed constant and exported as default. The test invokes that route through EmDash's production sandbox wrapper and host bridge.
@@ -63,7 +73,7 @@ The CLI detects whether npm, pnpm, Yarn, or Bun launched it and generates matchi
63
73
Non-interactive setup requires explicit ownership metadata. Use the following form in scripts:
@@ -150,7 +160,7 @@ The write uses the current record CID as a precondition. If another process chan
150
160
151
161
`profile setup` prepares the publisher-owned package profile for automated releases. It creates a missing profile from `emdash-plugin.jsonc`, or adds delegated-release settings to an existing valid profile without replacing its package metadata.
152
162
153
-
Run the interactive setup from the plugin directory:
163
+
Run the interactive setup from the plugin directory. From elsewhere in a monorepo, pass `--dir <plugin-directory>`:
154
164
155
165
```sh
156
166
emdash-plugin profile setup
@@ -159,15 +169,15 @@ emdash-plugin profile setup
159
169
| Flag | Default | Description |
160
170
| --- | --- | --- |
161
171
|`--dir <path>`| Current directory | Plugin source directory. |
162
-
|`--repository <url>`| Manifest `repo`| Canonical public GitHub repository URL. Interactive setup asks when neither value is present. |
172
+
|`--repository <url>`| Manifest `repo`, then Git `origin`| Canonical public GitHub repository URL. Interactive setup pre-fills a detected GitHub remote or asks when none is available. |
163
173
|`--confirmation <mode>`|`escalation-only`| Use `escalation-only` for permission increases or `always` for every release. |
164
174
|`--yes`, `-y`|`false`| Accept the default policy without prompting. Required when a non-interactive run would change the profile. |
165
175
166
-
The command uses the active CLI login to write the profile. It refuses to replace a different signed repository. Run `emdash-plugin switch <did>` when the active account does not match the manifest publisher.
176
+
The command uses the active CLI login to write the profile. It refuses to replace a different signed repository. Run `emdash-plugin switch <did>` when the active account does not match the manifest publisher. After publishing the profile, it shows `emdash-plugin publish` for a manual release and `emdash-plugin release setup` for GitHub Actions.
167
177
168
178
## `release setup`
169
179
170
-
`release setup` runs package-profile setup, then creates one shared `.github/workflows/emdash-release.yml` at the Git repository root. Nested plugin packages reuse the same workflow.
180
+
`release setup` runs package-profile setup from one plugin directory, then creates one shared `.github/workflows/emdash-release.yml` at the Git repository root. Nested plugin packages reuse the same workflow. Run it from a plugin directory or pass `--dir <plugin-directory>`; the repository root does not identify which package profile to prepare.
Copy file name to clipboardExpand all lines: docs/src/content/docs/plugins/creating-plugins/delegated-releases.mdx
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,8 @@ Use [`emdash-plugin publish`](/plugins/creating-plugins/publishing/#publish) for
21
21
Prepare the following before starting:
22
22
23
23
- A public GitHub repository containing a sandboxed EmDash plugin.
24
-
- A valid [`emdash-plugin.jsonc`](/plugins/creating-plugins/manifest/) with `slug`, `publisher`, `license`, an author, and a security contact. Set `repo` to the canonical GitHub URL, or enter it during interactive setup.
24
+
-`@emdash-cms/plugin-cli` installed as a development dependency. Plugins created with the CLI already include it.
25
+
- A valid [`emdash-plugin.jsonc`](/plugins/creating-plugins/manifest/) with `slug`, `publisher`, `license`, an author, and a security contact. Set `repo` to the canonical GitHub URL, or confirm the detected GitHub remote during interactive setup.
25
26
- A version in `package.json`, or in `emdash-plugin.jsonc` for a registry-only plugin.
26
27
- The Atmosphere account named by `publisher`.
27
28
- A browser that supports passkeys. Release approval requires user verification.
The CLI stores this local publishing session outside the project. GitHub Actions never receives it.
46
47
47
-
2. Prepare the package profile and generate the workflow.
48
+
2. Prepare the package profile and generate the workflow from the plugin directory.
48
49
49
50
```sh
50
51
pnpm exec emdash-plugin release setup
51
52
```
52
53
53
54
The command reads the package metadata from `emdash-plugin.jsonc`. If the package profile is missing, it offers to create it. If the profile exists without delegated-release settings, it offers to add them while preserving the existing package metadata.
54
55
56
+
In a monorepo, run the command inside the plugin package or pass `--dir <plugin-directory>`. If the manifest does not contain `repo`, setup detects the GitHub `origin` remote and pre-fills the repository prompt.
57
+
55
58
Setup asks when a release needs approval:
56
59
57
60
-**When plugin permissions increase** is the default. A release waits for approval when its declared access expands relative to the latest release.
In a non-interactive terminal, pass `--yes` to accept the default approval policy. Pass `--repository <https-url>` when the manifest does not contain `repo`, and `--confirmation always` to require approval for every release.
71
+
After publishing the package profile, this command shows the manual and GitHub Actions release commands.
72
+
73
+
In a non-interactive terminal, pass `--yes` to accept the default approval policy. Pass `--repository <https-url>` when neither the manifest nor Git remote supplies the repository, and `--confirmation always` to require approval for every release.
Copy file name to clipboardExpand all lines: packages/plugin-cli/README.md
+14-6Lines changed: 14 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,23 @@ CLI for authoring, building, and publishing EmDash plugins.
7
7
## Installation
8
8
9
9
```sh
10
-
npx @emdash-cms/plugin-cli init my-plugin
10
+
pnpm dlx @emdash-cms/plugin-cli init my-plugin
11
11
```
12
12
13
13
Interactive setup collects the required publisher, author, and security metadata, detects the invoking package manager, and shows a project summary before writing. The scaffold includes a workerd-backed Vitest host, `AGENTS.md`, a canonical `skills/creating-plugins` skill shared through `.agents/skills` and `.claude/skills` symlinks, a Claude instruction link, package scripts for every validation and publishing command, and pnpm build-script policy when pnpm is selected.
14
14
15
+
The generated plugin includes `@emdash-cms/plugin-cli` as a pinned development dependency. Add it before using the CLI in an existing plugin:
16
+
17
+
```sh
18
+
pnpm add -D @emdash-cms/plugin-cli
19
+
```
20
+
21
+
Run project commands with `pnpm exec emdash-plugin`. This uses the version pinned by the plugin instead of downloading a potentially different version for each command.
@@ -118,16 +126,16 @@ On first publish, pass `--license` and `--security-email` (or `--security-url`)
118
126
119
127
See [Automated plugin releases](https://docs.emdashcms.com/plugins/creating-plugins/delegated-releases/) for the complete publisher journey, including release-service authorisation, first-run repository approval, passkeys, and troubleshooting.
120
128
121
-
Run the setup command from a public GitHub repository containing an EmDash plugin:
129
+
Run the setup command from the plugin directory, not the monorepo root. Pass `--dir <plugin-directory>` when running it from elsewhere:
122
130
123
131
```sh
124
-
emdash-plugin login <handle-or-did>
125
-
emdash-plugin release setup
132
+
pnpm execemdash-plugin login <handle-or-did>
133
+
pnpm execemdash-plugin release setup
126
134
```
127
135
128
136
The command reads the plugin metadata and publisher from `emdash-plugin.jsonc`. If the package profile does not exist, it offers to create it. If the profile predates delegated releases, it offers to add the signed repository and release policy while preserving the existing package metadata. The default policy requires the publisher's [Atmosphere account](https://docs.emdashcms.com/plugins/creating-plugins/publishing/#your-atmosphere-account) to approve releases when plugin permissions increase. Choose the every-release option to require approval each time.
129
137
130
-
Set `repo` in `emdash-plugin.jsonc`, or enter the canonical GitHub repository URL when prompted. The standalone `emdash-plugin profile setup` command prepares only the package profile.
138
+
Set `repo` in `emdash-plugin.jsonc`, or confirm the canonical GitHub repository URL when prompted. If the manifest omits `repo`, setup detects a GitHub `origin` remote and uses it as the prompt default. The standalone `emdash-plugin profile setup` command prepares only the package profile, then shows the commands for publishing a release manually or configuring GitHub Actions.
131
139
132
140
Both setup commands accept `--repository <url>`, `--confirmation escalation-only|always`, and `--yes`. `release setup` also accepts `--service-url`, `--action-ref`, `--trigger auto|changesets|tags|manual`, and `--force` for the generated workflow. The default hosted service is `https://releases.emdashcms.com`.
0 commit comments