periderm-cli 0.1.55 → 0.1.57

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 CHANGED
@@ -17,7 +17,6 @@ Or use the install script from your Periderm dashboard docs (`curl -fsSL https:/
17
17
  ```bash
18
18
  periderm login # authenticate once
19
19
  periderm scan # scan + upload to your dashboard
20
- periderm scan --local-only # local report only, no upload
21
20
  periderm watch # rerun on file change
22
21
  periderm whoami # show current token + plan
23
22
  ```
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ const program = new Command();
31
31
  program
32
32
  .name("periderm")
33
33
  .description("A pre-launch checklist.")
34
- .version("0.1.37");
34
+ .version("0.1.57");
35
35
  // Easter egg: `periderm bless` — hidden, undocumented
36
36
  program
37
37
  .command("bless", { hidden: true })
@@ -58,7 +58,6 @@ program
58
58
  program
59
59
  .command("scan")
60
60
  .description("Scan the current directory and write a markdown report.")
61
- .option("--local-only", "Scan locally without uploading to your Periderm dashboard")
62
61
  .option("--cwd <dir>", "Directory to scan", process.cwd())
63
62
  .action(async (opts) => {
64
63
  const root = path.resolve(opts.cwd);
@@ -157,45 +156,41 @@ program
157
156
  await fs.writeFile(path.join(outDir, "ai-instructions.md"), getAiInstructions(readConfig().apiUrl), "utf8");
158
157
  // Ignore all files in the .periderm folder to prevent leaking vulnerabilities
159
158
  await fs.writeFile(path.join(outDir, ".gitignore"), "*\n", "utf8");
160
- if (!opts.localOnly) {
161
- const cfg = readConfig();
162
- if (!cfg.token) {
163
- console.info(chalk.yellow("no token configured — run `periderm login` first to sync to dashboard."));
159
+ if (!cfg.token) {
160
+ console.info(chalk.yellow("no token configured — run `periderm login` first to sync to dashboard."));
161
+ }
162
+ else {
163
+ const uploadSpinner = ora({ text: UPLOAD_MESSAGES[0], color: "cyan" }).start();
164
+ const uploadStarted = Date.now();
165
+ const stopUploadRotate = startRotatingMessages(uploadSpinner, UPLOAD_MESSAGES);
166
+ const res = await uploadScan(cfg.token, result);
167
+ await finishRotatingMessages(stopUploadRotate, uploadStarted);
168
+ if (res.error) {
169
+ uploadSpinner.fail(`upload failed: ${res.error}`);
170
+ if (res.error.includes("401") || res.error.includes("Invalid token") || res.error.includes("expired")) {
171
+ writeConfig({ ...cfg, token: undefined });
172
+ console.info(chalk.yellow("\nYour session expired or your token is invalid. Please run `periderm login` to authenticate again."));
173
+ }
174
+ // Throw so it gets caught by the crash reporter and sent to Formspree
175
+ throw new Error(`Upload failed: ${res.error}\nContext: Uploading scan for project ${result.projectName}`);
164
176
  }
165
177
  else {
166
- const uploadSpinner = ora({ text: UPLOAD_MESSAGES[0], color: "cyan" }).start();
167
- const uploadStarted = Date.now();
168
- const stopUploadRotate = startRotatingMessages(uploadSpinner, UPLOAD_MESSAGES);
169
- const res = await uploadScan(cfg.token, result);
170
- await finishRotatingMessages(stopUploadRotate, uploadStarted);
171
- if (res.error) {
172
- uploadSpinner.fail(`upload failed: ${res.error}`);
173
- if (res.error.includes("401") || res.error.includes("Invalid token") || res.error.includes("expired")) {
174
- writeConfig({ ...cfg, token: undefined });
175
- console.info(chalk.yellow("\nYour session expired or your token is invalid. Please run `periderm login` to authenticate again."));
176
- }
177
- // Throw so it gets caught by the crash reporter and sent to Formspree
178
- throw new Error(`Upload failed: ${res.error}\nContext: Uploading scan for project ${result.projectName}`);
178
+ uploadSpinner.succeed(`Uploaded! View it at: ${chalk.underline.cyan(`${cfg.apiUrl}/dashboard/scans/${res.id ?? ""}`)}`);
179
+ let formatQuota = "Unlimited";
180
+ let remainingNum = Infinity;
181
+ if (v.plan !== "unlimited" && v.scans_remaining !== undefined) {
182
+ remainingNum = Math.max(0, v.scans_remaining - 1);
183
+ formatQuota = `${remainingNum} scans`;
179
184
  }
180
- else {
181
- uploadSpinner.succeed(`Uploaded! View it at: ${chalk.underline.cyan(`${cfg.apiUrl}/dashboard/scans/${res.id ?? ""}`)}`);
182
- let formatQuota = "Unlimited";
183
- let remainingNum = Infinity;
184
- if (v.plan !== "unlimited" && v.scans_remaining !== undefined) {
185
- remainingNum = Math.max(0, v.scans_remaining - 1);
186
- formatQuota = `${remainingNum} scans`;
187
- }
188
- console.info("");
189
- console.info(chalk.bold.white("Quota : ") + chalk.yellow(formatQuota));
190
- console.info("");
191
- console.info(chalk.bold.white("[Next Steps]"));
192
- console.info(chalk.white(" 1. Run AI Review ") + chalk.hex("#FF4D00")("$ periderm review --deep"));
193
- console.info(chalk.white(" 2. Local only ") + chalk.hex("#FF4D00")("$ periderm scan --local-only"));
194
- console.info(chalk.white(" 3. Log out ") + chalk.hex("#FF4D00")("$ periderm logout"));
195
- console.info("");
196
- if (remainingNum <= 3 && v.plan !== "unlimited") {
197
- console.info(chalk.yellow(`⚠ Almost exhausted! Renew or upgrade at `) + chalk.underline.cyan(`${cfg.apiUrl}/dashboard/billing`));
198
- }
185
+ console.info("");
186
+ console.info(chalk.bold.white("Quota : ") + chalk.yellow(formatQuota));
187
+ console.info("");
188
+ console.info(chalk.bold.white("[Next Steps]"));
189
+ console.info(chalk.white(" 1. Run AI Review ") + chalk.hex("#FF4D00")("$ periderm review --deep"));
190
+ console.info(chalk.white(" 2. Log out ") + chalk.hex("#FF4D00")("$ periderm logout"));
191
+ console.info("");
192
+ if (remainingNum <= 3 && v.plan !== "unlimited") {
193
+ console.info(chalk.yellow(`⚠ Almost exhausted! Renew or upgrade at `) + chalk.underline.cyan(`${cfg.apiUrl}/dashboard/billing`));
199
194
  }
200
195
  }
201
196
  }
@@ -374,8 +369,7 @@ program
374
369
  console.info("");
375
370
  console.info(chalk.bold.white("[Next Steps]"));
376
371
  console.info(chalk.white(" 1. Scan + upload ") + chalk.hex("#FF4D00")("$ periderm scan"));
377
- console.info(chalk.white(" 2. Local only ") + chalk.hex("#FF4D00")("$ periderm scan --local-only"));
378
- console.info(chalk.white(" 3. Log out ") + chalk.hex("#FF4D00")("$ periderm logout"));
372
+ console.info(chalk.white(" 2. Log out ") + chalk.hex("#FF4D00")("$ periderm logout"));
379
373
  console.info("");
380
374
  console.info(chalk.white("Need help? Visit ") + chalk.underline.cyan(`${apiUrl}/docs`) + chalk.white("\n"));
381
375
  server.close();
@@ -57,7 +57,7 @@ You get a terminal verdict plus report files at:
57
57
  - \`.periderm/last-report.md\`
58
58
  - \`.periderm/last-report.json\`
59
59
 
60
- Scans upload to your dashboard by default. Use \`periderm scan --local-only\` for offline-only reports.
60
+ Scans upload to your dashboard by default.
61
61
 
62
62
  ### Project context (admin dashboards & monorepos)
63
63
  Periderm detects project structure — not just folder names — to skip legal, SEO, and accessibility checks on internal admin surfaces. Override with \`.periderm/context.json\`:
@@ -79,7 +79,6 @@ When viewing scan reports, findings are broken down by severity:
79
79
 
80
80
  ### CLI commands
81
81
  - \`periderm scan\`: Scan current directory, upload results, and write reports. Requires login.
82
- - \`periderm scan --local-only\`: Scan locally without uploading to the dashboard.
83
82
  - \`periderm review --deep\`: (Scale/Unlimited plan only) AI agent review for edge cases static checks miss. Appends to your last report.
84
83
  - \`periderm login\`: Link the CLI to your Periderm account via browser.
85
84
  - \`periderm logout\`: Clear the locally stored CLI token.
@@ -66,6 +66,26 @@ export async function runSeoChecks(root, files) {
66
66
  aiPrompt: `In ${names}, add og:image and twitter:card meta tags pointing at a 1200×630 social preview image in /public.`,
67
67
  });
68
68
  }
69
+ // ── missing critical OG tags on landing pages ──────────────────────────
70
+ const checkTags = ["og:url", "og:logo", "og:title", "og:description"];
71
+ for (const tag of checkTags) {
72
+ const hasTag = (content) => new RegExp(`(?:${tag}|property:\\s*["']${tag}["'])`, "i").test(content)
73
+ || (/socialMeta|social-meta/.test(content) && !!socialMetaSource && new RegExp(tag, "i").test(socialMetaSource));
74
+ const missingRoutes = marketingRoutes.filter((r) => !hasTag(r.content));
75
+ if (missingRoutes.length > 0) {
76
+ out.push({
77
+ id: `missing-${tag.replace(':', '-')}`,
78
+ category: "SEO & Discoverability",
79
+ severity: "medium",
80
+ file: missingRoutes[0].rel,
81
+ line: 1,
82
+ message: `Landing page(s) missing ${tag}.`,
83
+ why: `The ${tag} tag is critical for proper previews and branding when shared on platforms like LinkedIn, Slack, and Twitter.`,
84
+ fix: `Add <meta property="${tag}" content="..." /> or configure it in your framework's metadata object.`,
85
+ aiPrompt: `In ${missingRoutes.slice(0, 3).map(r => r.rel).join(", ")}, add the missing ${tag} meta tag to the page head or metadata object.`,
86
+ });
87
+ }
88
+ }
69
89
  // ── sitemap ───────────────────────────────────────────────────────────
70
90
  const hasSitemap = (await exists(path.join(root, "public/sitemap.xml")))
71
91
  || relFiles.some((f) => /sitemap\.(?:xml|ts|tsx|js)$/i.test(f));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "periderm-cli",
3
- "version": "0.1.55",
4
- "description": "Periderm CLI: The Local-First Security & Performance Code Scanner",
3
+ "version": "0.1.57",
4
+ "description": "Periderm CLI: A pre-launch checklist to catch user-losing bugs, legal liabilities, revenue leaks, runaway cloud bills and so many more before you ship.",
5
5
  "type": "module",
6
6
  "preferGlobal": true,
7
7
  "bin": {
@@ -16,8 +16,8 @@
16
16
  "cli",
17
17
  "code-quality",
18
18
  "pre-launch",
19
- "security",
20
- "scanning",
19
+ "reliability",
20
+ "auditing",
21
21
  "javascript",
22
22
  "typescript",
23
23
  "jsx",
@@ -38,7 +38,7 @@
38
38
  "homepage": "https://periderm-cli.vercel.app",
39
39
  "repository": {
40
40
  "type": "git",
41
- "url": "https://periderm-cli.vercel.app/dashboard/support",
41
+ "url": "https://periderm-cli.vercel.app/",
42
42
  "directory": "packages/cli"
43
43
  },
44
44
  "bugs": {
@@ -1,36 +0,0 @@
1
- import fs from "node:fs";
2
- import path from "node:path";
3
- import os from "node:os";
4
-
5
- // If this is running inside the curl install.sh script, skip cleanup!
6
- // We want curl installations to KEEP their ~/.periderm/bin folders.
7
- if (process.env.PERIDERM_CURL_INSTALL === "1") {
8
- process.exit(0);
9
- }
10
-
11
- // Find actual home directory, even if running via sudo npm install -g
12
- const isRoot = process.getuid && process.getuid() === 0;
13
- const sudoUser = process.env.SUDO_USER;
14
-
15
- let homeDir = os.homedir();
16
- if (isRoot && sudoUser) {
17
- // Basic fallback for Linux/macOS sudo users
18
- if (fs.existsSync(`/home/${sudoUser}`)) {
19
- homeDir = `/home/${sudoUser}`;
20
- } else if (fs.existsSync(`/Users/${sudoUser}`)) {
21
- homeDir = `/Users/${sudoUser}`;
22
- }
23
- }
24
-
25
- const peridermDir = path.join(homeDir, ".periderm");
26
- const binDir = path.join(peridermDir, "bin");
27
- const nodeModulesDir = path.join(peridermDir, "node_modules");
28
-
29
- try {
30
- // If the user installs globally via NPM, delete the legacy curl folders
31
- // so that ~/.periderm/bin/periderm doesn't shadow /usr/local/bin/periderm.
32
- fs.rmSync(binDir, { recursive: true, force: true });
33
- fs.rmSync(nodeModulesDir, { recursive: true, force: true });
34
- } catch (e) {
35
- // Silent fail
36
- }