@radicaltools/cli 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +105 -10
- package/dist/index.js +4408 -59
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -18,6 +18,97 @@ Or run it without a global install:
|
|
|
18
18
|
npx @radicaltools/cli check path/to/model
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
## radical export confluence
|
|
22
|
+
|
|
23
|
+
Export a particular wiki view from a Radical Markdown model folder. The full
|
|
24
|
+
view is exported, including its filter chain (for example, requirements with
|
|
25
|
+
their verifying scenarios), readable requirement sentences, Markdown fields
|
|
26
|
+
and links between elements. The last focused page and Single/Multi page reading
|
|
27
|
+
mode do not truncate the export. Local exports are complete documents.
|
|
28
|
+
Publishing defaults to a **page tree**: a landing page, requirement pages,
|
|
29
|
+
then their verifying scenario pages (or the selected view's own hierarchy).
|
|
30
|
+
A shared element has one page beneath its first parent and links from every
|
|
31
|
+
other parent. `--structure document` publishes one document instead.
|
|
32
|
+
|
|
33
|
+
Studio and the CLI use the same pure `@radical/common/wikiDocument` content
|
|
34
|
+
builder for view scope, hierarchy, visible fields, requirement prose and
|
|
35
|
+
relationships. React renders editors; the CLI serializes the document and
|
|
36
|
+
publishes it through the Confluence adapter.
|
|
37
|
+
|
|
38
|
+
Find a view and preview it without Confluence credentials:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
radical export confluence architecture --list-views
|
|
42
|
+
radical export confluence architecture --view "Tes confluence" --format html --output wiki-preview.html
|
|
43
|
+
radical export confluence architecture --view "Tes confluence" --format markdown --output wiki.md
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`--view` accepts an exact view ID or an unambiguous name. `--format storage`
|
|
47
|
+
(the default) produces Confluence storage XHTML; `markdown` produces a portable
|
|
48
|
+
document and `html` a standalone browser preview. Without `--output`, local
|
|
49
|
+
exports go to stdout. Output files must be outside the model folder; existing
|
|
50
|
+
files are never overwritten. `--source-url` adds a link back to the source
|
|
51
|
+
model or Studio wiki, and `--title` overrides the document/page title.
|
|
52
|
+
|
|
53
|
+
To publish to Confluence Cloud, set `CONFLUENCE_URL`, `CONFLUENCE_EMAIL` and
|
|
54
|
+
`CONFLUENCE_API_TOKEN` in your shell or CI secret environment, then run:
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
radical export confluence architecture --view "Tes confluence" --publish --space-id 123 --parent-id 456
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Use the numeric space ID, not its key. `--parent-id` is optional. `--url` can
|
|
61
|
+
override `CONFLUENCE_URL`; use a site URL such as `https://company.atlassian.net`
|
|
62
|
+
or `https://company.atlassian.net/wiki`. Use an Atlassian API token suitable
|
|
63
|
+
for basic authentication at that site and an account that can read and
|
|
64
|
+
create/update pages in the space.
|
|
65
|
+
|
|
66
|
+
To use a token kept under another environment variable name, add
|
|
67
|
+
`--token-env TEST_WORKSPACE_ATTLASIAN_KEY` (or your chosen variable name).
|
|
68
|
+
|
|
69
|
+
The command creates a landing page with the wiki's name, then finds and
|
|
70
|
+
refreshes it on subsequent runs. Every element page carries its own export
|
|
71
|
+
marker. Stable element-to-page IDs live in small content-property buckets
|
|
72
|
+
on the landing page, so renames preserve page IDs and publication can resume
|
|
73
|
+
on another computer. Publication first creates or recovers every destination,
|
|
74
|
+
preserving existing bodies and marking new pages as publication in progress.
|
|
75
|
+
Once all destinations exist, it fills their linked content and writes the
|
|
76
|
+
landing page last. Up to four writes run concurrently, with checkpoints
|
|
77
|
+
between batches. A failed run prints the landing page ID for resuming with
|
|
78
|
+
`--page-id 789`. A title collision with a handwritten page fails without
|
|
79
|
+
changing it. Updates verify ownership, use the current Confluence version
|
|
80
|
+
and report concurrent-edit conflicts. Rate-limit responses get bounded retries;
|
|
81
|
+
uncertain network failures are not retried automatically.
|
|
82
|
+
|
|
83
|
+
To move an existing managed export under another page, pass its root page
|
|
84
|
+
ID with `--parent-id`; its children follow it:
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
radical export confluence architecture --view "Tes confluence" --publish --page-id 789 --parent-id 456
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Use a destination parent in the same Confluence space. Changing the view's
|
|
91
|
+
hierarchy also moves its managed element pages on the next publication.
|
|
92
|
+
Elements removed from the view are reported and their old pages are retained.
|
|
93
|
+
|
|
94
|
+
**Radical remains the source of truth.** Publishing replaces the managed
|
|
95
|
+
page's body, including edits made to that body in Confluence. It does not
|
|
96
|
+
import Confluence changes, write source model files, or delete pages. A
|
|
97
|
+
source-of-truth notice and optional source link sit at the bottom of every
|
|
98
|
+
exported page, in a native Confluence Info panel (a note in HTML previews and
|
|
99
|
+
a blockquote in Markdown). Unchanged element pages
|
|
100
|
+
are skipped when their source hash and published Confluence version match.
|
|
101
|
+
Exports made by the earlier single-pass publisher are refreshed once to resolve
|
|
102
|
+
their forward links before unchanged pages can be skipped again.
|
|
103
|
+
Switching from tree to document leaves previously published child pages in
|
|
104
|
+
place. Absolute HTTP(S) image URLs are preserved; local
|
|
105
|
+
images and interactive mockup wireframes are not uploaded, and the command
|
|
106
|
+
reports unsupported assets. Data Center is not supported in this version.
|
|
107
|
+
|
|
108
|
+
Exit status: 0 exported/published, 2 could not export/publish. Credentials
|
|
109
|
+
are not accepted as command-line arguments or included in error output.
|
|
110
|
+
The transport follows Atlassian's [Cloud page API](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/).
|
|
111
|
+
|
|
21
112
|
## radical diff
|
|
22
113
|
|
|
23
114
|
```sh
|
|
@@ -223,7 +314,7 @@ organization, then publish the verified first-release tarball:
|
|
|
223
314
|
```sh
|
|
224
315
|
npm login --auth-type=web
|
|
225
316
|
npm whoami
|
|
226
|
-
npm publish ./release/radicaltools-cli-0.
|
|
317
|
+
npm publish ./release/radicaltools-cli-0.2.0.tgz --access public
|
|
227
318
|
```
|
|
228
319
|
|
|
229
320
|
Complete npm's browser and 2FA prompts. When publishing directly from the
|
|
@@ -244,26 +335,30 @@ read/write access to `@radicaltools/cli`.
|
|
|
244
335
|
|
|
245
336
|
### GitHub Actions with Trusted Publishing
|
|
246
337
|
|
|
247
|
-
The **Publish
|
|
248
|
-
|
|
338
|
+
The shared **Publish to npm** workflow (`.github/workflows/npm-publish.yml`)
|
|
339
|
+
publishes either CLI or MCP. After `@radicaltools/cli` exists on npm,
|
|
249
340
|
open its **Settings → Trusted publishing** and add GitHub Actions:
|
|
250
341
|
|
|
251
342
|
| Field | Value |
|
|
252
343
|
| --- | --- |
|
|
253
344
|
| Organization or user | `radicaltools` |
|
|
254
345
|
| Repository | `radical.tools` |
|
|
255
|
-
| Workflow filename | `
|
|
346
|
+
| Workflow filename | `npm-publish.yml` |
|
|
256
347
|
| Environment name | Leave empty |
|
|
257
348
|
| Allowed actions | Enable direct publishing with `npm publish` |
|
|
258
349
|
|
|
259
|
-
Configure this on
|
|
260
|
-
|
|
261
|
-
|
|
350
|
+
Configure this on each npm package that uses the workflow. If a trusted
|
|
351
|
+
publisher points at `cli-publish.yml` or `mcp-publish.yml`, replace it with
|
|
352
|
+
one using `npm-publish.yml` after merging this change. No npm token or GitHub
|
|
353
|
+
secret is needed. The workflow uses Node 24 and npm 11, with `id-token: write`
|
|
354
|
+
for its publish job.
|
|
355
|
+
Configure a new publisher when a release is ready: its first successful
|
|
356
|
+
publish must happen within two days; a dry run does not validate it.
|
|
262
357
|
See [npm's Trusted Publishing instructions](https://docs.npmjs.com/trusted-publishers/).
|
|
263
358
|
|
|
264
|
-
Push and merge these changes first. In GitHub **Actions → Publish
|
|
265
|
-
→ Run workflow**, select `main
|
|
266
|
-
and upload the npm archive without releasing. After a reviewed version bump,
|
|
359
|
+
Push and merge these changes first. In GitHub **Actions → Publish to npm
|
|
360
|
+
→ Run workflow**, select `main`, choose **package: cli**, and leave **dry-run**
|
|
361
|
+
enabled to validate and upload the npm archive without releasing. After a reviewed version bump,
|
|
267
362
|
run with **dry-run** disabled to publish. A package version can only be
|
|
268
363
|
published once, so bump past any version already published locally.
|
|
269
364
|
|