content-grade 1.0.20 → 1.0.22
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/bin/content-grade.js +41 -9
- package/package.json +1 -1
package/bin/content-grade.js
CHANGED
|
@@ -131,8 +131,12 @@ function showFreeTierCTA(count) {
|
|
|
131
131
|
// Last free run used — maximum urgency
|
|
132
132
|
console.log(` ${RD}${B}Daily limit reached${R} ${D}(${count}/${limit} free runs used today)${R}`);
|
|
133
133
|
blank();
|
|
134
|
-
console.log(`
|
|
135
|
-
|
|
134
|
+
console.log(` ${B}Upgrade to Pro — $9/mo${R} to keep going:`);
|
|
135
|
+
blank();
|
|
136
|
+
console.log(` ${GN}✓${R} ${B}Unlimited analyses${R} no daily cap`);
|
|
137
|
+
console.log(` ${GN}✓${R} ${B}Batch mode${R} grade an entire directory at once`);
|
|
138
|
+
console.log(` ${GN}✓${R} ${B}URL analysis${R} audit any live page`);
|
|
139
|
+
console.log(` ${GN}✓${R} ${B}Priority support${R} direct email response within 24h`);
|
|
136
140
|
blank();
|
|
137
141
|
console.log(` ${MG}${B}→ Upgrade to Pro — $9/mo${R}`);
|
|
138
142
|
console.log(` ${CY} ${UPGRADE_LINKS.free}${R}`);
|
|
@@ -142,8 +146,11 @@ function showFreeTierCTA(count) {
|
|
|
142
146
|
// 1 run left — build urgency
|
|
143
147
|
console.log(` ${YL}${B}${count}/${limit} free runs used${R} ${D}· 1 remaining${R}`);
|
|
144
148
|
blank();
|
|
145
|
-
console.log(` Last free run of the day. Pro is ${B}$9/mo${R}
|
|
146
|
-
|
|
149
|
+
console.log(` Last free run of the day. Pro is ${B}$9/mo${R}:`);
|
|
150
|
+
blank();
|
|
151
|
+
console.log(` ${GN}✓${R} ${B}Unlimited analyses${R} + batch mode + priority support`);
|
|
152
|
+
console.log(` ${MG}${B}→ Upgrade to Pro — $9/mo${R}`);
|
|
153
|
+
console.log(` ${CY} ${UPGRADE_LINKS.free}${R}`);
|
|
147
154
|
blank();
|
|
148
155
|
console.log(` ${D}Or use your last run: ${CY}content-grade analyze ./another-post.md${R}`);
|
|
149
156
|
} else {
|
|
@@ -162,6 +169,22 @@ function showFreeTierCTA(count) {
|
|
|
162
169
|
}
|
|
163
170
|
}
|
|
164
171
|
|
|
172
|
+
// Single-line usage counter appended after every command run.
|
|
173
|
+
// count = total runs used today (after this run).
|
|
174
|
+
function showUsageFooter(count) {
|
|
175
|
+
if (isProUser()) return;
|
|
176
|
+
const limit = TIER_LIMITS.free;
|
|
177
|
+
const remaining = Math.max(0, limit - count);
|
|
178
|
+
blank();
|
|
179
|
+
if (remaining === 0) {
|
|
180
|
+
console.log(` ${RD}[ ${count}/${limit} free runs used today · limit reached — upgrade for unlimited: ${UPGRADE_LINKS.free} ]${R}`);
|
|
181
|
+
} else if (remaining === 1) {
|
|
182
|
+
console.log(` ${YL}[ ${count}/${limit} free runs used today · 1 remaining — upgrade for unlimited: ${UPGRADE_LINKS.free} ]${R}`);
|
|
183
|
+
} else {
|
|
184
|
+
console.log(` ${D}[ ${count}/${limit} free runs used today — upgrade for unlimited: ${UPGRADE_LINKS.free} ]${R}`);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
165
188
|
// Block a run before it starts if the free tier is exhausted.
|
|
166
189
|
// Returns true (blocked) and prints a visually distinct upgrade prompt.
|
|
167
190
|
// Returns false if the user may proceed.
|
|
@@ -180,6 +203,7 @@ function checkFreeTierLimit() {
|
|
|
180
203
|
console.log(` ${GN}✓${R} ${B}Unlimited analyses${R} no daily cap`);
|
|
181
204
|
console.log(` ${GN}✓${R} ${B}Batch mode${R} grade an entire directory at once`);
|
|
182
205
|
console.log(` ${GN}✓${R} ${B}URL analysis${R} audit any live page`);
|
|
206
|
+
console.log(` ${GN}✓${R} ${B}Priority support${R} direct email response within 24h`);
|
|
183
207
|
blank();
|
|
184
208
|
console.log(` ${MG}${B}→ Upgrade to Pro — $9/mo${R}`);
|
|
185
209
|
console.log(` ${CY} ${UPGRADE_LINKS.free}${R}`);
|
|
@@ -622,7 +646,7 @@ async function cmdAnalyze(filePath) {
|
|
|
622
646
|
hr();
|
|
623
647
|
console.log(` ${D}Pro active · Next: ${CY}content-grade batch ./posts/${R}${D} to analyze a whole directory${R}`);
|
|
624
648
|
} else {
|
|
625
|
-
|
|
649
|
+
showUsageFooter(usageCount);
|
|
626
650
|
}
|
|
627
651
|
|
|
628
652
|
// CI exit code — shown after full output so user sees the score before exit
|
|
@@ -783,7 +807,7 @@ async function cmdHeadline(text) {
|
|
|
783
807
|
blank();
|
|
784
808
|
if (!isProUser()) {
|
|
785
809
|
const usageCount = incrementUsage();
|
|
786
|
-
|
|
810
|
+
showUsageFooter(usageCount);
|
|
787
811
|
}
|
|
788
812
|
}
|
|
789
813
|
|
|
@@ -1022,10 +1046,16 @@ async function cmdBatch(dirPath) {
|
|
|
1022
1046
|
console.log(` ${D}Free tier: analyze files one at a time.${R}`);
|
|
1023
1047
|
console.log(` ${CY}content-grade analyze ./post.md${R}`);
|
|
1024
1048
|
blank();
|
|
1025
|
-
console.log(` ${B}
|
|
1026
|
-
console.log(` ${CY}content-grade activate${R} ${D}(enter your license key)${R}`);
|
|
1049
|
+
console.log(` ${B}Upgrade to Pro — $9/mo${R} to unlock batch mode:`);
|
|
1027
1050
|
blank();
|
|
1028
|
-
console.log(` ${
|
|
1051
|
+
console.log(` ${GN}✓${R} ${B}Unlimited analyses${R} no daily cap`);
|
|
1052
|
+
console.log(` ${GN}✓${R} ${B}Batch mode${R} grade an entire directory at once`);
|
|
1053
|
+
console.log(` ${GN}✓${R} ${B}Priority support${R} direct email response within 24h`);
|
|
1054
|
+
blank();
|
|
1055
|
+
console.log(` ${MG}${B}→ Upgrade to Pro — $9/mo${R}`);
|
|
1056
|
+
console.log(` ${CY} ${UPGRADE_LINKS.free}${R}`);
|
|
1057
|
+
blank();
|
|
1058
|
+
console.log(` ${D}Already have a key? ${CY}content-grade activate${R}`);
|
|
1029
1059
|
blank();
|
|
1030
1060
|
process.exit(1);
|
|
1031
1061
|
}
|
|
@@ -1155,6 +1185,8 @@ async function cmdBatch(dirPath) {
|
|
|
1155
1185
|
blank();
|
|
1156
1186
|
|
|
1157
1187
|
if (_jsonMode) process.stdout.write(JSON.stringify(results, null, 2) + '\n');
|
|
1188
|
+
|
|
1189
|
+
if (!isProUser() && results.length) showUsageFooter(getUsage().count);
|
|
1158
1190
|
}
|
|
1159
1191
|
|
|
1160
1192
|
// ── Start command ─────────────────────────────────────────────────────────────
|
package/package.json
CHANGED