@marlinjai/clearify 1.16.0 → 1.18.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.
@@ -280,9 +280,16 @@ ${hasInternal ? `
280
280
  npx clearify dev Start the dev server
281
281
  npx clearify build Build for production
282
282
  `);
283
+ const secretMode = options.secretMode ?? "prompt";
283
284
  if (options.hub) {
284
- const { registerWithHub } = await import("./hub-register-MFTTF6AW.js");
285
- await registerWithHub({ projectName: detectProjectName() });
285
+ const { registerWithHub } = await import("./hub-register-VJBXLOKV.js");
286
+ await registerWithHub({
287
+ projectName: detectProjectName(),
288
+ hubToken: options.hubToken,
289
+ secretMode,
290
+ secretPat: options.secretPat,
291
+ rotateSecret: options.rotateSecret
292
+ });
286
293
  } else {
287
294
  const { createInterface } = await import("readline");
288
295
  const rl = createInterface({ input: process.stdin, output: process.stdout });
@@ -291,8 +298,14 @@ ${hasInternal ? `
291
298
  });
292
299
  rl.close();
293
300
  if (answer.toLowerCase() === "y") {
294
- const { registerWithHub } = await import("./hub-register-MFTTF6AW.js");
295
- await registerWithHub({ projectName: detectProjectName() });
301
+ const { registerWithHub } = await import("./hub-register-VJBXLOKV.js");
302
+ await registerWithHub({
303
+ projectName: detectProjectName(),
304
+ hubToken: options.hubToken,
305
+ secretMode,
306
+ secretPat: options.secretPat,
307
+ rotateSecret: options.rotateSecret
308
+ });
296
309
  }
297
310
  }
298
311
  }
@@ -34,10 +34,30 @@ cli.command("build", "Build static documentation site").action(async () => {
34
34
  const { build } = await import("../node/index.js");
35
35
  await build();
36
36
  });
37
- cli.command("init", "Scaffold a docs folder and optionally register with a hub").option("--no-internal", "Skip creating the internal docs section").option("--no-claude-rules", "Skip creating .claude/rules/clearify-docs.md").option("--hub", "Register this project with a documentation hub").action(async (options) => {
38
- const { init } = await import("../node/index.js");
39
- await init({ noInternal: options.noInternal, noClaudeRules: options.noClaudeRules, hub: options.hub });
40
- });
37
+ cli.command("init", "Scaffold a docs folder and optionally register with a hub").option("--no-internal", "Skip creating the internal docs section").option("--no-claude-rules", "Skip creating .claude/rules/clearify-docs.md").option("--hub", "Register this project with a documentation hub").option(
38
+ "--hub-token <pat>",
39
+ "GitHub PAT to use instead of OAuth device flow (for environments without CLEARIFY_GITHUB_CLIENT_ID set)"
40
+ ).option(
41
+ "--secret-mode <mode>",
42
+ "How to provision HUB_DISPATCH_TOKEN: prompt (interactive, default), auto (encrypt + PUT via Secrets API), manual (print UI instructions), skip (leave it to Terraform)",
43
+ { default: "prompt" }
44
+ ).option(
45
+ "--secret-pat <pat>",
46
+ "PAT value to store as HUB_DISPATCH_TOKEN. Visible in `ps`; prefer --secret-mode=prompt for hidden input"
47
+ ).option("--rotate-secret", "Overwrite HUB_DISPATCH_TOKEN even if it already exists on the sub-repo").action(
48
+ async (options) => {
49
+ const { init } = await import("../node/index.js");
50
+ await init({
51
+ noInternal: options.noInternal,
52
+ noClaudeRules: options.noClaudeRules,
53
+ hub: options.hub,
54
+ hubToken: options.hubToken,
55
+ secretMode: options.secretMode,
56
+ secretPat: options.secretPat,
57
+ rotateSecret: options.rotateSecret
58
+ });
59
+ }
60
+ );
41
61
  cli.command("check", "Check for broken internal links and frontmatter issues").option("--frontmatter", "Only run frontmatter validation (skip broken link detection)").action(async (options) => {
42
62
  const { checkLinks } = await import("../node/check.js");
43
63
  await checkLinks({ frontmatterOnly: options.frontmatter });
@@ -9,9 +9,9 @@ declare const ClearifyDataSchema: z.ZodObject<{
9
9
  theme: z.ZodOptional<z.ZodObject<{
10
10
  primaryColor: z.ZodOptional<z.ZodString>;
11
11
  mode: z.ZodOptional<z.ZodEnum<{
12
+ auto: "auto";
12
13
  light: "light";
13
14
  dark: "dark";
14
- auto: "auto";
15
15
  }>>;
16
16
  }, z.core.$strip>>;
17
17
  logo: z.ZodOptional<z.ZodObject<{
@@ -11,7 +11,7 @@ import {
11
11
  import "../chunk-B2Q23JW3.js";
12
12
  import {
13
13
  init
14
- } from "../chunk-VRX6PLND.js";
14
+ } from "../chunk-7Z2GR22P.js";
15
15
  import {
16
16
  checkFrontmatter,
17
17
  checkLinks
@@ -2,6 +2,22 @@ interface InitOptions {
2
2
  noInternal?: boolean;
3
3
  noClaudeRules?: boolean;
4
4
  hub?: boolean;
5
+ /** PAT to use for GitHub API calls when CLEARIFY_GITHUB_CLIENT_ID is unset. */
6
+ hubToken?: string;
7
+ /**
8
+ * How to provision HUB_DISPATCH_TOKEN on the sub-repo. Defaults to 'prompt'
9
+ * during hub onboarding (interactive menu). Non-interactive modes: 'auto'
10
+ * (encrypt + PUT via Secrets API), 'manual' (print UI instructions), 'skip'
11
+ * (leave it to Terraform).
12
+ */
13
+ secretMode?: 'prompt' | 'auto' | 'manual' | 'skip';
14
+ /**
15
+ * The PAT value to store as HUB_DISPATCH_TOKEN. Visible in `ps` when passed
16
+ * as a flag; prefer --secret-mode=prompt for the hidden input path.
17
+ */
18
+ secretPat?: string;
19
+ /** Overwrite HUB_DISPATCH_TOKEN even if it already exists on the sub-repo. */
20
+ rotateSecret?: boolean;
5
21
  }
6
22
  declare function init(options?: InitOptions): Promise<void>;
7
23
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init
3
- } from "../chunk-VRX6PLND.js";
3
+ } from "../chunk-7Z2GR22P.js";
4
4
  export {
5
5
  init
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marlinjai/clearify",
3
- "version": "1.16.0",
3
+ "version": "1.18.0",
4
4
  "description": "An open-source documentation site generator. Turn markdown into beautiful docs.",
5
5
  "type": "module",
6
6
  "bin": {