faf-cli 2.1.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/LICENSE +21 -0
- package/README.md +227 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +1249 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/ai-analyze.d.ts +18 -0
- package/dist/commands/ai-analyze.d.ts.map +1 -0
- package/dist/commands/ai-analyze.js +226 -0
- package/dist/commands/ai-analyze.js.map +1 -0
- package/dist/commands/ai-enhance.d.ts +17 -0
- package/dist/commands/ai-enhance.d.ts.map +1 -0
- package/dist/commands/ai-enhance.js +278 -0
- package/dist/commands/ai-enhance.js.map +1 -0
- package/dist/commands/audit.d.ts +11 -0
- package/dist/commands/audit.d.ts.map +1 -0
- package/dist/commands/audit.js +180 -0
- package/dist/commands/audit.js.map +1 -0
- package/dist/commands/auto.d.ts +27 -0
- package/dist/commands/auto.d.ts.map +1 -0
- package/dist/commands/auto.js +106 -0
- package/dist/commands/auto.js.map +1 -0
- package/dist/commands/bi-sync.d.ts +43 -0
- package/dist/commands/bi-sync.d.ts.map +1 -0
- package/dist/commands/bi-sync.js +224 -0
- package/dist/commands/bi-sync.js.map +1 -0
- package/dist/commands/chat.d.ts +6 -0
- package/dist/commands/chat.d.ts.map +1 -0
- package/dist/commands/chat.js +227 -0
- package/dist/commands/chat.js.map +1 -0
- package/dist/commands/check.d.ts +15 -0
- package/dist/commands/check.d.ts.map +1 -0
- package/dist/commands/check.js +58 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/clear.d.ts +15 -0
- package/dist/commands/clear.d.ts.map +1 -0
- package/dist/commands/clear.js +167 -0
- package/dist/commands/clear.js.map +1 -0
- package/dist/commands/commit.d.ts +8 -0
- package/dist/commands/commit.d.ts.map +1 -0
- package/dist/commands/commit.js +164 -0
- package/dist/commands/commit.js.map +1 -0
- package/dist/commands/convert.d.ts +19 -0
- package/dist/commands/convert.d.ts.map +1 -0
- package/dist/commands/convert.js +102 -0
- package/dist/commands/convert.js.map +1 -0
- package/dist/commands/credit.d.ts +13 -0
- package/dist/commands/credit.d.ts.map +1 -0
- package/dist/commands/credit.js +149 -0
- package/dist/commands/credit.js.map +1 -0
- package/dist/commands/edit-helper.d.ts +6 -0
- package/dist/commands/edit-helper.d.ts.map +1 -0
- package/dist/commands/edit-helper.js +55 -0
- package/dist/commands/edit-helper.js.map +1 -0
- package/dist/commands/edit.d.ts +14 -0
- package/dist/commands/edit.d.ts.map +1 -0
- package/dist/commands/edit.js +196 -0
- package/dist/commands/edit.js.map +1 -0
- package/dist/commands/faf-auth.d.ts +10 -0
- package/dist/commands/faf-auth.d.ts.map +1 -0
- package/dist/commands/faf-auth.js +162 -0
- package/dist/commands/faf-auth.js.map +1 -0
- package/dist/commands/faf-dna.d.ts +9 -0
- package/dist/commands/faf-dna.d.ts.map +1 -0
- package/dist/commands/faf-dna.js +141 -0
- package/dist/commands/faf-dna.js.map +1 -0
- package/dist/commands/faf-log.d.ts +9 -0
- package/dist/commands/faf-log.d.ts.map +1 -0
- package/dist/commands/faf-log.js +135 -0
- package/dist/commands/faf-log.js.map +1 -0
- package/dist/commands/faf-recover.d.ts +3 -0
- package/dist/commands/faf-recover.d.ts.map +1 -0
- package/dist/commands/faf-recover.js +299 -0
- package/dist/commands/faf-recover.js.map +1 -0
- package/dist/commands/faf-update.d.ts +9 -0
- package/dist/commands/faf-update.d.ts.map +1 -0
- package/dist/commands/faf-update.js +68 -0
- package/dist/commands/faf-update.js.map +1 -0
- package/dist/commands/faq.d.ts +12 -0
- package/dist/commands/faq.d.ts.map +1 -0
- package/dist/commands/faq.js +84 -0
- package/dist/commands/faq.js.map +1 -0
- package/dist/commands/flow.d.ts +11 -0
- package/dist/commands/flow.d.ts.map +1 -0
- package/dist/commands/flow.js +117 -0
- package/dist/commands/flow.js.map +1 -0
- package/dist/commands/formats.d.ts +12 -0
- package/dist/commands/formats.d.ts.map +1 -0
- package/dist/commands/formats.js +109 -0
- package/dist/commands/formats.js.map +1 -0
- package/dist/commands/index.d.ts +14 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +443 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/init.d.ts +14 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +202 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/lint.d.ts +11 -0
- package/dist/commands/lint.d.ts.map +1 -0
- package/dist/commands/lint.js +269 -0
- package/dist/commands/lint.js.map +1 -0
- package/dist/commands/mirror.d.ts +7 -0
- package/dist/commands/mirror.d.ts.map +1 -0
- package/dist/commands/mirror.js +130 -0
- package/dist/commands/mirror.js.map +1 -0
- package/dist/commands/score.d.ts +11 -0
- package/dist/commands/score.d.ts.map +1 -0
- package/dist/commands/score.js +192 -0
- package/dist/commands/score.js.map +1 -0
- package/dist/commands/search.d.ts +16 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +174 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/share.d.ts +17 -0
- package/dist/commands/share.d.ts.map +1 -0
- package/dist/commands/share.js +260 -0
- package/dist/commands/share.js.map +1 -0
- package/dist/commands/show.d.ts +10 -0
- package/dist/commands/show.d.ts.map +1 -0
- package/dist/commands/show.js +167 -0
- package/dist/commands/show.js.map +1 -0
- package/dist/commands/stacks.d.ts +51 -0
- package/dist/commands/stacks.d.ts.map +1 -0
- package/dist/commands/stacks.js +180 -0
- package/dist/commands/stacks.js.map +1 -0
- package/dist/commands/status.d.ts +13 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +158 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/sync.d.ts +11 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +300 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/todo.d.ts +14 -0
- package/dist/commands/todo.d.ts.map +1 -0
- package/dist/commands/todo.js +279 -0
- package/dist/commands/todo.js.map +1 -0
- package/dist/commands/trust.d.ts +33 -0
- package/dist/commands/trust.d.ts.map +1 -0
- package/dist/commands/trust.js +316 -0
- package/dist/commands/trust.js.map +1 -0
- package/dist/commands/validate.d.ts +11 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +100 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/commands/verify.d.ts +36 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +194 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/commands/version.d.ts +5 -0
- package/dist/commands/version.d.ts.map +1 -0
- package/dist/commands/version.js +33 -0
- package/dist/commands/version.js.map +1 -0
- package/dist/commands/vibe.d.ts +7 -0
- package/dist/commands/vibe.d.ts.map +1 -0
- package/dist/commands/vibe.js +78 -0
- package/dist/commands/vibe.js.map +1 -0
- package/dist/converters/faf-converters.d.ts +43 -0
- package/dist/converters/faf-converters.d.ts.map +1 -0
- package/dist/converters/faf-converters.js +186 -0
- package/dist/converters/faf-converters.js.map +1 -0
- package/dist/engine-bridge.d.ts +35 -0
- package/dist/engine-bridge.d.ts.map +1 -0
- package/dist/engine-bridge.js +76 -0
- package/dist/engine-bridge.js.map +1 -0
- package/dist/engines/claude-todo-engine.d.ts +115 -0
- package/dist/engines/claude-todo-engine.d.ts.map +1 -0
- package/dist/engines/claude-todo-engine.js +346 -0
- package/dist/engines/claude-todo-engine.js.map +1 -0
- package/dist/engines/drop-coach.d.ts +64 -0
- package/dist/engines/drop-coach.d.ts.map +1 -0
- package/dist/engines/drop-coach.js +222 -0
- package/dist/engines/drop-coach.js.map +1 -0
- package/dist/engines/fab-formats-processor.d.ts +167 -0
- package/dist/engines/fab-formats-processor.d.ts.map +1 -0
- package/dist/engines/fab-formats-processor.js +1274 -0
- package/dist/engines/fab-formats-processor.js.map +1 -0
- package/dist/engines/faf-dna.d.ts +160 -0
- package/dist/engines/faf-dna.d.ts.map +1 -0
- package/dist/engines/faf-dna.js +522 -0
- package/dist/engines/faf-dna.js.map +1 -0
- package/dist/engines/relentless-context-extractor.d.ts +101 -0
- package/dist/engines/relentless-context-extractor.d.ts.map +1 -0
- package/dist/engines/relentless-context-extractor.js +625 -0
- package/dist/engines/relentless-context-extractor.js.map +1 -0
- package/dist/fix-once/colors.d.ts +83 -0
- package/dist/fix-once/colors.d.ts.map +1 -0
- package/dist/fix-once/colors.js +145 -0
- package/dist/fix-once/colors.js.map +1 -0
- package/dist/fix-once/types.d.ts +258 -0
- package/dist/fix-once/types.d.ts.map +1 -0
- package/dist/fix-once/types.js +26 -0
- package/dist/fix-once/types.js.map +1 -0
- package/dist/framework-detector.d.ts +286 -0
- package/dist/framework-detector.d.ts.map +1 -0
- package/dist/framework-detector.js +782 -0
- package/dist/framework-detector.js.map +1 -0
- package/dist/generators/faf-generator-championship.d.ts +11 -0
- package/dist/generators/faf-generator-championship.d.ts.map +1 -0
- package/dist/generators/faf-generator-championship.js +371 -0
- package/dist/generators/faf-generator-championship.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -0
- package/dist/index.js.map +1 -0
- package/dist/output/experience-manager.d.ts +58 -0
- package/dist/output/experience-manager.d.ts.map +1 -0
- package/dist/output/experience-manager.js +212 -0
- package/dist/output/experience-manager.js.map +1 -0
- package/dist/schema/faf-schema.d.ts +92 -0
- package/dist/schema/faf-schema.d.ts.map +1 -0
- package/dist/schema/faf-schema.js +173 -0
- package/dist/schema/faf-schema.js.map +1 -0
- package/dist/scoring/championship-scorer.d.ts +114 -0
- package/dist/scoring/championship-scorer.d.ts.map +1 -0
- package/dist/scoring/championship-scorer.js +380 -0
- package/dist/scoring/championship-scorer.js.map +1 -0
- package/dist/scoring/score-calculator.d.ts +29 -0
- package/dist/scoring/score-calculator.d.ts.map +1 -0
- package/dist/scoring/score-calculator.js +520 -0
- package/dist/scoring/score-calculator.js.map +1 -0
- package/dist/telemetry/analytics.d.ts +74 -0
- package/dist/telemetry/analytics.d.ts.map +1 -0
- package/dist/telemetry/analytics.js +370 -0
- package/dist/telemetry/analytics.js.map +1 -0
- package/dist/utils/balance-visualizer.d.ts +38 -0
- package/dist/utils/balance-visualizer.d.ts.map +1 -0
- package/dist/utils/balance-visualizer.js +196 -0
- package/dist/utils/balance-visualizer.js.map +1 -0
- package/dist/utils/championship-style.d.ts +110 -0
- package/dist/utils/championship-style.d.ts.map +1 -0
- package/dist/utils/championship-style.js +213 -0
- package/dist/utils/championship-style.js.map +1 -0
- package/dist/utils/color-utils.d.ts +17 -0
- package/dist/utils/color-utils.d.ts.map +1 -0
- package/dist/utils/color-utils.js +96 -0
- package/dist/utils/color-utils.js.map +1 -0
- package/dist/utils/fab-formats-engine.d.ts +76 -0
- package/dist/utils/fab-formats-engine.d.ts.map +1 -0
- package/dist/utils/fab-formats-engine.js +424 -0
- package/dist/utils/fab-formats-engine.js.map +1 -0
- package/dist/utils/fafignore-parser.d.ts +21 -0
- package/dist/utils/fafignore-parser.d.ts.map +1 -0
- package/dist/utils/fafignore-parser.js +178 -0
- package/dist/utils/fafignore-parser.js.map +1 -0
- package/dist/utils/file-utils.d.ts +65 -0
- package/dist/utils/file-utils.d.ts.map +1 -0
- package/dist/utils/file-utils.js +598 -0
- package/dist/utils/file-utils.js.map +1 -0
- package/dist/utils/platform-detector.d.ts +31 -0
- package/dist/utils/platform-detector.d.ts.map +1 -0
- package/dist/utils/platform-detector.js +218 -0
- package/dist/utils/platform-detector.js.map +1 -0
- package/dist/utils/technical-credit.d.ts +36 -0
- package/dist/utils/technical-credit.d.ts.map +1 -0
- package/dist/utils/technical-credit.js +286 -0
- package/dist/utils/technical-credit.js.map +1 -0
- package/dist/utils/trust-cache.d.ts +29 -0
- package/dist/utils/trust-cache.d.ts.map +1 -0
- package/dist/utils/trust-cache.js +123 -0
- package/dist/utils/trust-cache.js.map +1 -0
- package/dist/utils/turbo-cat-knowledge.d.ts +82 -0
- package/dist/utils/turbo-cat-knowledge.d.ts.map +1 -0
- package/dist/utils/turbo-cat-knowledge.js +1346 -0
- package/dist/utils/turbo-cat-knowledge.js.map +1 -0
- package/dist/utils/turbo-cat-pyramid.d.ts +38 -0
- package/dist/utils/turbo-cat-pyramid.d.ts.map +1 -0
- package/dist/utils/turbo-cat-pyramid.js +287 -0
- package/dist/utils/turbo-cat-pyramid.js.map +1 -0
- package/dist/utils/turbo-cat.d.ts +92 -0
- package/dist/utils/turbo-cat.d.ts.map +1 -0
- package/dist/utils/turbo-cat.js +412 -0
- package/dist/utils/turbo-cat.js.map +1 -0
- package/dist/utils/vibe-sync.d.ts +25 -0
- package/dist/utils/vibe-sync.d.ts.map +1 -0
- package/dist/utils/vibe-sync.js +169 -0
- package/dist/utils/vibe-sync.js.map +1 -0
- package/dist/utils/yaml-generator.d.ts +39 -0
- package/dist/utils/yaml-generator.d.ts.map +1 -0
- package/dist/utils/yaml-generator.js +345 -0
- package/dist/utils/yaml-generator.js.map +1 -0
- package/package.json +96 -0
package/dist/cli.js
ADDED
|
@@ -0,0 +1,1249 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* đ .faf CLI - Command Line Interface
|
|
5
|
+
* Universal AI Context Format Tooling
|
|
6
|
+
*/
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
+
}
|
|
13
|
+
Object.defineProperty(o, k2, desc);
|
|
14
|
+
}) : (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
o[k2] = m[k];
|
|
17
|
+
}));
|
|
18
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
19
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
20
|
+
}) : function(o, v) {
|
|
21
|
+
o["default"] = v;
|
|
22
|
+
});
|
|
23
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
24
|
+
var ownKeys = function(o) {
|
|
25
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
26
|
+
var ar = [];
|
|
27
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
28
|
+
return ar;
|
|
29
|
+
};
|
|
30
|
+
return ownKeys(o);
|
|
31
|
+
};
|
|
32
|
+
return function (mod) {
|
|
33
|
+
if (mod && mod.__esModule) return mod;
|
|
34
|
+
var result = {};
|
|
35
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
36
|
+
__setModuleDefault(result, mod);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
})();
|
|
40
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.program = void 0;
|
|
45
|
+
const commander_1 = require("commander");
|
|
46
|
+
Object.defineProperty(exports, "program", { enumerable: true, get: function () { return commander_1.program; } });
|
|
47
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
48
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
49
|
+
const validate_1 = require("./commands/validate");
|
|
50
|
+
const init_1 = require("./commands/init");
|
|
51
|
+
const score_1 = require("./commands/score");
|
|
52
|
+
const show_1 = require("./commands/show");
|
|
53
|
+
const edit_helper_1 = require("./commands/edit-helper");
|
|
54
|
+
const auto_1 = require("./commands/auto");
|
|
55
|
+
const formats_1 = require("./commands/formats");
|
|
56
|
+
const version_1 = require("./commands/version");
|
|
57
|
+
const sync_1 = require("./commands/sync");
|
|
58
|
+
const audit_1 = require("./commands/audit");
|
|
59
|
+
const lint_1 = require("./commands/lint");
|
|
60
|
+
const ai_enhance_1 = require("./commands/ai-enhance");
|
|
61
|
+
const ai_analyze_1 = require("./commands/ai-analyze");
|
|
62
|
+
const trust_1 = require("./commands/trust");
|
|
63
|
+
const status_1 = require("./commands/status");
|
|
64
|
+
const verify_1 = require("./commands/verify");
|
|
65
|
+
const stacks_1 = require("./commands/stacks");
|
|
66
|
+
const bi_sync_1 = require("./commands/bi-sync");
|
|
67
|
+
const credit_1 = require("./commands/credit");
|
|
68
|
+
const todo_1 = require("./commands/todo");
|
|
69
|
+
const check_1 = require("./commands/check");
|
|
70
|
+
const clear_1 = require("./commands/clear");
|
|
71
|
+
const edit_1 = require("./commands/edit");
|
|
72
|
+
const search_1 = require("./commands/search");
|
|
73
|
+
const index_1 = require("./commands/index");
|
|
74
|
+
const share_1 = require("./commands/share");
|
|
75
|
+
const chat_1 = require("./commands/chat");
|
|
76
|
+
const convert_1 = require("./commands/convert");
|
|
77
|
+
const flow_1 = require("./commands/flow");
|
|
78
|
+
const color_utils_1 = require("./utils/color-utils");
|
|
79
|
+
const championship_style_1 = require("./utils/championship-style");
|
|
80
|
+
const analytics_1 = require("./telemetry/analytics");
|
|
81
|
+
const file_utils_1 = require("./utils/file-utils");
|
|
82
|
+
const score_calculator_1 = require("./scoring/score-calculator");
|
|
83
|
+
const trust_cache_1 = require("./utils/trust-cache");
|
|
84
|
+
const YAML = __importStar(require("yaml"));
|
|
85
|
+
const version = require('../package.json').version;
|
|
86
|
+
/**
|
|
87
|
+
* Show current score as footer
|
|
88
|
+
*/
|
|
89
|
+
async function showScoreFooter(context) {
|
|
90
|
+
console.log('');
|
|
91
|
+
// Show context status line
|
|
92
|
+
if (context === 'device') {
|
|
93
|
+
console.log(chalk_1.default.dim('Using Device CLI'));
|
|
94
|
+
}
|
|
95
|
+
else if (context === 'faf') {
|
|
96
|
+
console.log(chalk_1.default.dim('Using faf CLI'));
|
|
97
|
+
}
|
|
98
|
+
else if (context === 'chat') {
|
|
99
|
+
console.log(chalk_1.default.dim('Using faf chat'));
|
|
100
|
+
}
|
|
101
|
+
try {
|
|
102
|
+
const existingFafPath = await (0, file_utils_1.findFafFile)();
|
|
103
|
+
if (existingFafPath) {
|
|
104
|
+
const fs = await Promise.resolve().then(() => __importStar(require('fs'))).then(m => m.promises);
|
|
105
|
+
const fafContent = await fs.readFile(existingFafPath, 'utf-8');
|
|
106
|
+
const fafData = YAML.parse(fafContent);
|
|
107
|
+
const scoreResult = await (0, score_calculator_1.calculateFafScore)(fafData, existingFafPath);
|
|
108
|
+
const percentage = Math.round(scoreResult.totalScore);
|
|
109
|
+
// Get AI readiness from trust cache
|
|
110
|
+
const trustCache = await (0, trust_cache_1.getTrustCache)(existingFafPath);
|
|
111
|
+
const aiReadiness = trustCache?.aiCompatibilityScore || 0;
|
|
112
|
+
// Style the scores with championship colors
|
|
113
|
+
const scoreColor = percentage >= 85 ? championship_style_1.FAF_COLORS.fafGreen : percentage >= 70 ? championship_style_1.FAF_COLORS.fafCyan : championship_style_1.FAF_COLORS.fafOrange;
|
|
114
|
+
// RULE: Only show AI-Predictive if it's greater than FAF Score
|
|
115
|
+
if (aiReadiness > percentage) {
|
|
116
|
+
console.log(`Current Score: ${scoreColor(percentage + '%')} > AI-Predictive: ${championship_style_1.FAF_COLORS.fafCyan(aiReadiness + '%')}`);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
console.log(`Current Score: ${scoreColor(percentage + '%')}`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
console.log(`Current Score: 0% > AI-Predictive: ${championship_style_1.FAF_COLORS.fafCyan('0%')}`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
console.log(`Current Score: 0% > AI-Predictive: ${championship_style_1.FAF_COLORS.fafCyan('0%')}`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Analytics tracking wrapper for commands
|
|
132
|
+
*/
|
|
133
|
+
function withAnalyticsTracking(commandName, fn) {
|
|
134
|
+
return (async (...args) => {
|
|
135
|
+
const start = Date.now();
|
|
136
|
+
const commandArgs = process.argv.slice(2);
|
|
137
|
+
try {
|
|
138
|
+
const result = await fn(...args);
|
|
139
|
+
const duration = Date.now() - start;
|
|
140
|
+
await (0, analytics_1.trackCommand)(commandName, commandArgs, duration, true);
|
|
141
|
+
// Show score footer after every command
|
|
142
|
+
await showScoreFooter('device');
|
|
143
|
+
return result;
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
const duration = Date.now() - start;
|
|
147
|
+
await (0, analytics_1.trackCommand)(commandName, commandArgs, duration, false);
|
|
148
|
+
await (0, analytics_1.trackError)(error, commandName, commandArgs);
|
|
149
|
+
throw error;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function showHeaderIfAppropriate(commandName) {
|
|
154
|
+
const showHeaderCommands = ['help', 'init', 'clear', 'enhance', 'analyze', 'chat', 'formats', 'score', 'version'];
|
|
155
|
+
if (!commandName || showHeaderCommands.includes(commandName)) {
|
|
156
|
+
console.log((0, championship_style_1.generateFAFHeader)());
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
commander_1.program
|
|
160
|
+
.name('faf')
|
|
161
|
+
.description('.faf = THE JPEG for AI | Foundational AI-context Format | SPEEDY AI you can TRUST! đ§ĄâĄī¸')
|
|
162
|
+
.version(version)
|
|
163
|
+
.option('--no-color', 'Disable colored output for accessibility')
|
|
164
|
+
.option('--color-scheme <scheme>', 'Color scheme for colorblind accessibility: normal|deuteranopia|protanopia|tritanopia', 'normal')
|
|
165
|
+
.option('--auto', 'Auto mode - menu-driven interface for learning and exploration')
|
|
166
|
+
.option('--manual', 'Manual mode - direct command-line interface for power users')
|
|
167
|
+
.addHelpText('after', `
|
|
168
|
+
${championship_style_1.FAF_COLORS.fafOrange('đĄ In Terminal:')} Use ${chalk_1.default.cyan('faf')} prefix - like ${chalk_1.default.cyan('faf init')}, ${chalk_1.default.cyan('faf faq')}
|
|
169
|
+
|
|
170
|
+
${championship_style_1.FAF_COLORS.fafCyan('đ Quick Start - Get Perfect AI Context:')}
|
|
171
|
+
|
|
172
|
+
${chalk_1.default.bold.green('FASTEST:')} ${chalk_1.default.cyan('faf auto')} ${chalk_1.default.gray('# ONE COMMAND - Zero to Championship!')}
|
|
173
|
+
|
|
174
|
+
${chalk_1.default.gray('Or step by step:')}
|
|
175
|
+
${championship_style_1.FAF_COLORS.fafOrange('1.')} ${chalk_1.default.cyan('faf init')} ${chalk_1.default.gray('# Get your .faf file')}
|
|
176
|
+
${championship_style_1.FAF_COLORS.fafOrange('2.')} ${chalk_1.default.cyan('faf score')} ${chalk_1.default.gray('# Get a high score (70%+)')}
|
|
177
|
+
${championship_style_1.FAF_COLORS.fafOrange('3.')} ${chalk_1.default.cyan('faf trust')} ${chalk_1.default.gray('# Build AI trust & confidence')}
|
|
178
|
+
${championship_style_1.FAF_COLORS.fafOrange('4.')} ${chalk_1.default.cyan('faf bi-sync')} ${chalk_1.default.gray('# Set & forget - persistent context-mirroring')}
|
|
179
|
+
|
|
180
|
+
${championship_style_1.FAF_COLORS.fafCyan('đ¯ What is .faf?')}
|
|
181
|
+
.faf = Foundational AI-context Format (THE JPEG for AI!)
|
|
182
|
+
Just like JPEG makes images universal, .faf makes projects AI-readable.
|
|
183
|
+
bi-sync = persistent context-mirroring through thick and thin
|
|
184
|
+
Get high score, build trust, share freely!
|
|
185
|
+
|
|
186
|
+
${championship_style_1.FAF_COLORS.fafOrange('đ Need more?')} ${chalk_1.default.cyan('faf index')} ${chalk_1.default.gray('# Complete A-Z reference guide')}
|
|
187
|
+
${championship_style_1.FAF_COLORS.fafOrange('đ¯ VS Coders?')} ${chalk_1.default.cyan('faf faq')} ${chalk_1.default.gray('# VS Code extension & Command Palette info!')}
|
|
188
|
+
`);
|
|
189
|
+
// đ§ĄâĄī¸ faf flow - The Complete Three-Step Flow (NEW!)
|
|
190
|
+
commander_1.program
|
|
191
|
+
.command('flow [directory]')
|
|
192
|
+
.description('đ§ĄâĄī¸ Get .faffed â Mirror â Commit | Complete 3-step flow to 99%')
|
|
193
|
+
.addHelpText('after', `
|
|
194
|
+
Examples:
|
|
195
|
+
$ faf flow # Complete 3-step flow
|
|
196
|
+
$ faf flow ./my-project # Flow for specific directory
|
|
197
|
+
|
|
198
|
+
đ§ĄâĄī¸ The Three-Step Flow:
|
|
199
|
+
1. Get .faffed - Create/validate your .faf file (85%)
|
|
200
|
+
2. Mirror - Context-Mirroring with CLAUDE.md (95%)
|
|
201
|
+
3. Commit - Lock in excellence at 99%+
|
|
202
|
+
|
|
203
|
+
"The JPEG for AIâĸ" - One command to 99% AI-readiness!`)
|
|
204
|
+
.action(withAnalyticsTracking('flow', flow_1.flow));
|
|
205
|
+
// đ faf mirror - Context-Mirroring (Step 2)
|
|
206
|
+
commander_1.program
|
|
207
|
+
.command('mirror [directory]')
|
|
208
|
+
.description('đ Context-Mirroring - Bi-sync .faf âī¸ CLAUDE.md (95% score)')
|
|
209
|
+
.addHelpText('after', `
|
|
210
|
+
Examples:
|
|
211
|
+
$ faf mirror # Mirror context with CLAUDE.md
|
|
212
|
+
$ faf mirror ./my-project # Mirror specific directory
|
|
213
|
+
|
|
214
|
+
Context-Mirroringâĸ:
|
|
215
|
+
âĸ Creates CLAUDE.md if missing
|
|
216
|
+
âĸ Bi-directional sync established
|
|
217
|
+
âĸ Increases score to 95%
|
|
218
|
+
âĸ Real-time context alignment`)
|
|
219
|
+
.action(withAnalyticsTracking('mirror', flow_1.mirrorCommand));
|
|
220
|
+
// đ faf commit - Context-Commitment (Step 3)
|
|
221
|
+
commander_1.program
|
|
222
|
+
.command('commit [directory]')
|
|
223
|
+
.description('đ Context-Commitmentâĸ - Lock in 99%+ excellence forever')
|
|
224
|
+
.addHelpText('after', `
|
|
225
|
+
Examples:
|
|
226
|
+
$ faf commit # Commit to 99%+ excellence
|
|
227
|
+
$ faf commit ./my-project # Commit specific directory
|
|
228
|
+
|
|
229
|
+
Context-Commitmentâĸ:
|
|
230
|
+
âĸ Locks in 99%+ AI-readiness
|
|
231
|
+
âĸ Eternal-Syncâĸ activated
|
|
232
|
+
âĸ Self-healing enabled
|
|
233
|
+
âĸ One-way improvements only
|
|
234
|
+
âĸ Degradation prevented
|
|
235
|
+
|
|
236
|
+
Your AI context becomes bulletproof!`)
|
|
237
|
+
.action(withAnalyticsTracking('commit', flow_1.commitCommand));
|
|
238
|
+
// đī¸ faf auto - The One Command Championship (PRIORITY #1)
|
|
239
|
+
commander_1.program
|
|
240
|
+
.command('auto [directory]')
|
|
241
|
+
.description('đī¸ ONE COMMAND TO RULE THEM ALL - Zero to Championship instantly!')
|
|
242
|
+
.option('-f, --force', 'Force overwrite existing files')
|
|
243
|
+
.option('-a, --ai', 'Include AI enhancement (requires API key)')
|
|
244
|
+
.option('--no-show', 'Skip showing scorecard at end')
|
|
245
|
+
.addHelpText('after', `
|
|
246
|
+
Examples:
|
|
247
|
+
$ faf auto # Transform current directory to Championship
|
|
248
|
+
$ faf auto ./my-project # Transform specific project
|
|
249
|
+
$ faf auto --ai # Include AI enhancements
|
|
250
|
+
$ faf auto --force # Overwrite everything, fresh start
|
|
251
|
+
|
|
252
|
+
đī¸ What FAF AUTO Does (in 30 seconds):
|
|
253
|
+
1. Creates perfect .faf file
|
|
254
|
+
2. Syncs all dependencies
|
|
255
|
+
3. Generates CLAUDE.md
|
|
256
|
+
4. Sets up bi-directional sync
|
|
257
|
+
5. Shows your Championship scorecard
|
|
258
|
+
|
|
259
|
+
From 0% to 99% in one command. No faffing about!`)
|
|
260
|
+
.action(withAnalyticsTracking('auto', auto_1.autoCommand));
|
|
261
|
+
// Add all the command definitions back
|
|
262
|
+
commander_1.program
|
|
263
|
+
.command('init [directory]')
|
|
264
|
+
.description('Create .faf file from your project (detects React, Python, Node.js, etc.)')
|
|
265
|
+
.option('-f, --force', 'Overwrite existing .faf file')
|
|
266
|
+
.option('-n, --new', 'Create a fresh .faf file (friendlier than --force)')
|
|
267
|
+
.option('-c, --choose', 'Interactive choice when .faf exists')
|
|
268
|
+
.option('-t, --template <type>', 'Use specific template (svelte, react, vue, node)', 'auto')
|
|
269
|
+
.option('-o, --output <file>', 'Output file path')
|
|
270
|
+
.addHelpText('after', `
|
|
271
|
+
Examples:
|
|
272
|
+
$ faf init # Detect project type automatically
|
|
273
|
+
$ faf init --new # Create a fresh .faf file
|
|
274
|
+
$ faf init --choose # Interactive choice when .faf exists
|
|
275
|
+
$ faf init my-app # Create .faf for different directory
|
|
276
|
+
$ faf init -t react # Force React template`)
|
|
277
|
+
.action(withAnalyticsTracking('init', (directory, options) => (0, init_1.initFafFile)(directory, options)));
|
|
278
|
+
// đ§Ŧ faf dna - Show your journey at a glance
|
|
279
|
+
commander_1.program
|
|
280
|
+
.command('dna')
|
|
281
|
+
.description('đ§Ŧ Show your FAF DNA journey (22% â 85% â 99% â 92%)')
|
|
282
|
+
.addHelpText('after', `
|
|
283
|
+
Examples:
|
|
284
|
+
$ faf dna # See your journey at a glance
|
|
285
|
+
|
|
286
|
+
đ§Ŧ Shows instantly:
|
|
287
|
+
âĸ Your complete journey line
|
|
288
|
+
âĸ Quick stats and growth
|
|
289
|
+
âĸ Achievements unlocked
|
|
290
|
+
âĸ Links to detailed info`)
|
|
291
|
+
.action(withAnalyticsTracking('dna', () => {
|
|
292
|
+
const dnaCommand = require('./commands/faf-dna');
|
|
293
|
+
return dnaCommand.default?.();
|
|
294
|
+
}));
|
|
295
|
+
// đ faf auth - Authenticate your FAF DNA
|
|
296
|
+
commander_1.program
|
|
297
|
+
.command('auth')
|
|
298
|
+
.description('đ Authenticate your FAF project with a birth certificate')
|
|
299
|
+
.option('--verify <certificate>', 'Verify an existing certificate')
|
|
300
|
+
.option('--show', 'Show current authentication status')
|
|
301
|
+
.addHelpText('after', `
|
|
302
|
+
Examples:
|
|
303
|
+
$ faf auth # Authenticate your project
|
|
304
|
+
$ faf auth --show # Show authentication status
|
|
305
|
+
$ faf auth --verify FAF-2025-PROJECT-XXXX # Verify certificate
|
|
306
|
+
|
|
307
|
+
đ Birth Certificate:
|
|
308
|
+
âĸ Proves origin of your context
|
|
309
|
+
âĸ Tracks evolution from birth weight
|
|
310
|
+
âĸ Enables Context-Mirroring guarantee`)
|
|
311
|
+
.action(withAnalyticsTracking('auth', () => {
|
|
312
|
+
const authCommand = require('./commands/faf-auth');
|
|
313
|
+
return authCommand.default?.();
|
|
314
|
+
}));
|
|
315
|
+
// đ faf log - View context evolution history
|
|
316
|
+
commander_1.program
|
|
317
|
+
.command('log')
|
|
318
|
+
.description('đ View complete evolution history of your FAF context')
|
|
319
|
+
.option('--milestones', 'Show milestones only')
|
|
320
|
+
.option('--analytics', 'Show growth analytics')
|
|
321
|
+
.option('--json', 'Output as JSON')
|
|
322
|
+
.addHelpText('after', `
|
|
323
|
+
Examples:
|
|
324
|
+
$ faf log # Full evolution history
|
|
325
|
+
$ faf log --milestones # Key milestones only
|
|
326
|
+
$ faf log --analytics # Growth analytics
|
|
327
|
+
$ faf log --json # Export as JSON
|
|
328
|
+
|
|
329
|
+
đ Shows Your Journey:
|
|
330
|
+
âĸ Birth weight (from CLAUDE.md)
|
|
331
|
+
âĸ Every version and growth
|
|
332
|
+
âĸ Milestones achieved
|
|
333
|
+
âĸ Current position vs peak`)
|
|
334
|
+
.action(withAnalyticsTracking('log', () => {
|
|
335
|
+
const logCommand = require('./commands/faf-log');
|
|
336
|
+
return logCommand.default?.();
|
|
337
|
+
}));
|
|
338
|
+
// đž faf update - Save your current version
|
|
339
|
+
commander_1.program
|
|
340
|
+
.command('update')
|
|
341
|
+
.description('đž Save your current FAF version (checkpoint your progress)')
|
|
342
|
+
.addHelpText('after', `
|
|
343
|
+
Examples:
|
|
344
|
+
$ faf update # Save current version
|
|
345
|
+
|
|
346
|
+
đž Simple checkpoint:
|
|
347
|
+
âĸ Marks current state as good
|
|
348
|
+
âĸ Creates reference point
|
|
349
|
+
âĸ Track future changes from here`)
|
|
350
|
+
.action(withAnalyticsTracking('update', () => {
|
|
351
|
+
const updateCommand = require('./commands/faf-update');
|
|
352
|
+
return updateCommand.default?.();
|
|
353
|
+
}));
|
|
354
|
+
// đ¨ faf recover - Disaster Recovery
|
|
355
|
+
commander_1.program
|
|
356
|
+
.command('recover')
|
|
357
|
+
.description('đ¨ Disaster recovery for corrupted or missing FAF files')
|
|
358
|
+
.option('--auto', 'Attempt automatic recovery')
|
|
359
|
+
.option('--backup', 'List available backups')
|
|
360
|
+
.option('--check', 'Check health without recovery')
|
|
361
|
+
.option('--force', 'Force recovery even if risky')
|
|
362
|
+
.addHelpText('after', `
|
|
363
|
+
Examples:
|
|
364
|
+
$ faf recover # Interactive recovery
|
|
365
|
+
$ faf recover --auto # Try automatic fix
|
|
366
|
+
$ faf recover --backup # List backups
|
|
367
|
+
$ faf recover --check # Health check only
|
|
368
|
+
|
|
369
|
+
đ¨ Emergency Commands:
|
|
370
|
+
âĸ faf recover --auto: Try automatic recovery
|
|
371
|
+
âĸ git checkout HEAD -- .faf: Restore from git
|
|
372
|
+
âĸ faf init --force: Start fresh (loses history)`)
|
|
373
|
+
.action(withAnalyticsTracking('recover', (options) => {
|
|
374
|
+
const { spawn } = require('child_process');
|
|
375
|
+
const recoverPath = require('path').join(__dirname, 'commands', 'faf-recover.ts');
|
|
376
|
+
const args = ['ts-node', recoverPath];
|
|
377
|
+
if (options.auto)
|
|
378
|
+
args.push('--auto');
|
|
379
|
+
if (options.backup)
|
|
380
|
+
args.push('--backup');
|
|
381
|
+
if (options.check)
|
|
382
|
+
args.push('--check');
|
|
383
|
+
if (options.force)
|
|
384
|
+
args.push('--force');
|
|
385
|
+
const child = spawn('npx', args, { stdio: 'inherit' });
|
|
386
|
+
child.on('exit', (code) => {
|
|
387
|
+
process.exit(code || 0);
|
|
388
|
+
});
|
|
389
|
+
}));
|
|
390
|
+
// đŊ faf formats - TURBO-CAT Format Discovery
|
|
391
|
+
commander_1.program
|
|
392
|
+
.command('formats [directory]')
|
|
393
|
+
.description('đŊ TURBO-CATâĸ discovers all formats in your project (154 validated types!)')
|
|
394
|
+
.option('-e, --export', 'Export as JSON')
|
|
395
|
+
.option('-c, --category', 'Show by category')
|
|
396
|
+
.addHelpText('after', `
|
|
397
|
+
Examples:
|
|
398
|
+
$ faf formats # List all discovered formats
|
|
399
|
+
$ faf formats --category # Show by category
|
|
400
|
+
$ faf formats --export # Export as JSON`)
|
|
401
|
+
.action(withAnalyticsTracking('formats', (directory, options) => (0, formats_1.formatsCommand)(directory, options)));
|
|
402
|
+
// đ faf version - Show version with MK2 status
|
|
403
|
+
commander_1.program
|
|
404
|
+
.command('version')
|
|
405
|
+
.description('đ Show FAF version with MK2 Engine and TURBO-CAT status')
|
|
406
|
+
.action(withAnalyticsTracking('version', () => (0, version_1.versionCommand)()));
|
|
407
|
+
// đ§Ą faf trust - Consolidated Trust Dashboard (The Emotional Core)
|
|
408
|
+
commander_1.program
|
|
409
|
+
.command('trust')
|
|
410
|
+
.description('đ§Ą Unified trust dashboard - confidence, garage, panic, guarantee modes')
|
|
411
|
+
.option('-d, --detailed', 'Show detailed trust metrics')
|
|
412
|
+
.option('--confidence', 'Show AI confidence analysis')
|
|
413
|
+
.option('--garage', 'Safe experimentation mode with backup')
|
|
414
|
+
.option('--panic', 'Emergency context repair mode')
|
|
415
|
+
.option('--guarantee', 'Quality assurance mode (85%+ threshold)')
|
|
416
|
+
.addHelpText('after', `
|
|
417
|
+
Examples:
|
|
418
|
+
$ faf trust # Main trust dashboard
|
|
419
|
+
$ faf trust --detailed # Detailed metrics breakdown
|
|
420
|
+
$ faf trust --confidence # AI confidence analysis
|
|
421
|
+
$ faf trust --garage # Safe experiment mode
|
|
422
|
+
$ faf trust --panic # Emergency repair
|
|
423
|
+
$ faf trust --guarantee # Quality guarantee check
|
|
424
|
+
|
|
425
|
+
Trust Modes:
|
|
426
|
+
âĸ Confidence: AI confidence levels and boosting tips
|
|
427
|
+
âĸ Garage: Safe experimentation with automatic backup
|
|
428
|
+
âĸ Panic: Emergency repair and restoration
|
|
429
|
+
âĸ Guarantee: Championship quality assurance (85%+ standard)`)
|
|
430
|
+
.action(withAnalyticsTracking('trust', (options) => (0, trust_1.trustCommand)(options)));
|
|
431
|
+
// âĄī¸ faf vibe - No-Code/Low-Code Builder Edition
|
|
432
|
+
commander_1.program
|
|
433
|
+
.command('vibe')
|
|
434
|
+
.description('âĄī¸ FAF VIBE - Check $9 tier eligibility for no-code builders')
|
|
435
|
+
.option('-p, --preview', 'Preview TURBO-CAT discovery')
|
|
436
|
+
.addHelpText('after', `
|
|
437
|
+
Examples:
|
|
438
|
+
$ faf vibe # Check platform & pricing
|
|
439
|
+
$ faf vibe --preview # Include TURBO-CAT preview
|
|
440
|
+
|
|
441
|
+
âĄī¸ FAF VIBE Features:
|
|
442
|
+
âĸ Auto-detects no-code platforms (Replit, Lovable, Wix, etc.)
|
|
443
|
+
âĸ $9/month FOREVER (limited time offer)
|
|
444
|
+
âĸ Same features as $100 Pro Plan
|
|
445
|
+
âĸ TURBO-CAT format discovery
|
|
446
|
+
âĸ Lightning not rainbows!`)
|
|
447
|
+
.action(withAnalyticsTracking('vibe', (options) => {
|
|
448
|
+
const { vibeCommand } = require('./commands/vibe');
|
|
449
|
+
return vibeCommand(options);
|
|
450
|
+
}));
|
|
451
|
+
// đ faf status - Quick context health check (git status equivalent)
|
|
452
|
+
commander_1.program
|
|
453
|
+
.command('status')
|
|
454
|
+
.description('Show quick .faf context health status (<200ms)')
|
|
455
|
+
.addHelpText('after', `
|
|
456
|
+
Examples:
|
|
457
|
+
$ faf status # Quick health check
|
|
458
|
+
|
|
459
|
+
Shows:
|
|
460
|
+
âĸ Context health score (0-100%)
|
|
461
|
+
âĸ Files tracked and last sync time
|
|
462
|
+
âĸ AI readiness status
|
|
463
|
+
âĸ Performance metrics
|
|
464
|
+
âĸ Bi-sync (claude.md) status`)
|
|
465
|
+
.action(withAnalyticsTracking('status', () => (0, status_1.statusCommand)()));
|
|
466
|
+
// đ faf credit - Technical Credit Dashboard (Revolutionary Psychology)
|
|
467
|
+
commander_1.program
|
|
468
|
+
.command('credit')
|
|
469
|
+
.description('đ Technical Credit Dashboard - See your accumulated development credits')
|
|
470
|
+
.option('-d, --detailed', 'Show detailed credit breakdown by category')
|
|
471
|
+
.option('-h, --history', 'Show credit earning history')
|
|
472
|
+
.option('-c, --clear', 'Clear credit history (confirmation required)')
|
|
473
|
+
.addHelpText('after', `
|
|
474
|
+
Examples:
|
|
475
|
+
$ faf credit # Show credit dashboard
|
|
476
|
+
$ faf credit --detailed # Detailed breakdown by category
|
|
477
|
+
$ faf credit --history # See credit earning timeline
|
|
478
|
+
|
|
479
|
+
đ Technical Credit System:
|
|
480
|
+
âĸ Earn credit for every improvement (vs. technical debt)
|
|
481
|
+
âĸ Transform developer psychology from anxiety to confidence
|
|
482
|
+
âĸ Track AI happiness improvements and context quality
|
|
483
|
+
âĸ Build trust through measurable technical achievements
|
|
484
|
+
âĸ Championship levels: Beginner â Professional â Championship
|
|
485
|
+
|
|
486
|
+
Expected Impact:
|
|
487
|
+
đ° "I hope this works" â đ "I trust my context"`)
|
|
488
|
+
.action((options) => (0, credit_1.creditCommand)(options));
|
|
489
|
+
// đ faf todo - Claude-Inspired Todo System (The Gamifier)
|
|
490
|
+
commander_1.program
|
|
491
|
+
.command('todo')
|
|
492
|
+
.description('đ Claude-inspired todo system - gamify your context improvements')
|
|
493
|
+
.option('-s, --show', 'Show current todo list')
|
|
494
|
+
.option('-c, --complete <task>', 'Mark task as completed (by number or keyword)')
|
|
495
|
+
.option('-r, --reset', 'Reset current todo list')
|
|
496
|
+
.addHelpText('after', `
|
|
497
|
+
Examples:
|
|
498
|
+
$ faf todo # Generate new improvement plan
|
|
499
|
+
$ faf todo --show # View current todo list
|
|
500
|
+
$ faf todo --complete 1 # Complete task #1
|
|
501
|
+
$ faf todo --complete readme # Complete README task
|
|
502
|
+
$ faf todo --reset # Start fresh
|
|
503
|
+
|
|
504
|
+
Philosophy:
|
|
505
|
+
âĸ Transform low scores into exciting improvement games
|
|
506
|
+
âĸ Claude-inspired task prioritization and celebrations
|
|
507
|
+
âĸ Gamified progress tracking with championship rewards
|
|
508
|
+
âĸ Turn "I need better context" â "I'm completing achievements!"
|
|
509
|
+
|
|
510
|
+
Expected Impact:
|
|
511
|
+
đ 47% score â đ 85% score through guided achievements`)
|
|
512
|
+
.action((options) => (0, todo_1.todoCommand)(options));
|
|
513
|
+
// đ faf index - Universal A-Z Reference (The Everything Catalog)
|
|
514
|
+
commander_1.program
|
|
515
|
+
.command('index [term]')
|
|
516
|
+
.description('đ Universal A-Z reference - commands, concepts, features, everything!')
|
|
517
|
+
.option('--category <category>', 'Filter by category (core, ai, trust, utilities, etc.)')
|
|
518
|
+
.option('--search <query>', 'Search within index entries')
|
|
519
|
+
.option('--examples', 'Show usage examples for commands')
|
|
520
|
+
.addHelpText('after', `
|
|
521
|
+
Examples:
|
|
522
|
+
$ faf index # Full A-Z catalog
|
|
523
|
+
$ faf index trust # Everything about trust
|
|
524
|
+
$ faf index --category ai # All AI-related entries
|
|
525
|
+
$ faf index --search "context" # Search for "context"
|
|
526
|
+
$ faf index --examples # Show usage examples
|
|
527
|
+
|
|
528
|
+
The Everything Catalog:
|
|
529
|
+
âĸ âĄī¸ Commands: All available commands with usage
|
|
530
|
+
âĸ đĄ Concepts: Core FAF concepts (bi-sync, technical-credit, etc.)
|
|
531
|
+
âĸ đ§Ą Features: Specialized features (garage, panic, guarantee modes)
|
|
532
|
+
âĸ đ Categories: core, ai, trust, utilities, improvement, psychology
|
|
533
|
+
|
|
534
|
+
Perfect for:
|
|
535
|
+
âĸ New users: "What can FAF do?" â faf index
|
|
536
|
+
âĸ Power users: "What were trust options?" â faf index trust
|
|
537
|
+
âĸ Discovery: "Show me AI features" â faf index --category ai`)
|
|
538
|
+
.action((term, options) => (0, index_1.indexCommand)(term, options));
|
|
539
|
+
// đ faf share - Universal .faf Distribution System
|
|
540
|
+
commander_1.program
|
|
541
|
+
.command('share [file]')
|
|
542
|
+
.description('đ Secure .faf sharing with auto-sanitization')
|
|
543
|
+
.option('-p, --private', 'Keep sensitive info (default: sanitize)')
|
|
544
|
+
.option('-f, --format <format>', 'Output format: yaml|json|url', 'yaml')
|
|
545
|
+
.option('-e, --expires <duration>', 'Expiration: 24h|7d|30d', '7d')
|
|
546
|
+
.option('--password <password>', 'Password protect shared .faf')
|
|
547
|
+
.option('-d, --description <text>', 'Share description')
|
|
548
|
+
.option('-a, --anonymous', 'Remove author information')
|
|
549
|
+
.addHelpText('after', `
|
|
550
|
+
Examples:
|
|
551
|
+
$ faf share # Share with auto-sanitization
|
|
552
|
+
$ faf share --private # Share with sensitive info intact
|
|
553
|
+
$ faf share --format json # Share as JSON format
|
|
554
|
+
$ faf share --expires 24h # Expire in 24 hours
|
|
555
|
+
$ faf share --anonymous # Remove author info
|
|
556
|
+
$ faf share --password secret123 # Password protect
|
|
557
|
+
|
|
558
|
+
Security Features:
|
|
559
|
+
âĸ đ Auto-sanitization removes sensitive data by default
|
|
560
|
+
âĸ đ Anonymous sharing option removes author info
|
|
561
|
+
âĸ â° Configurable expiration (24h, 7d, 30d)
|
|
562
|
+
âĸ đ Optional password protection
|
|
563
|
+
âĸ đ Multiple formats: YAML, JSON, shareable URLs
|
|
564
|
+
|
|
565
|
+
Perfect for:
|
|
566
|
+
âĸ Team handoffs: Clean context sharing
|
|
567
|
+
âĸ Community help: Sanitized project sharing
|
|
568
|
+
âĸ Documentation: Shareable project examples`)
|
|
569
|
+
.action((file, options) => (0, share_1.shareCommand)(file, options));
|
|
570
|
+
// đ GOLDEN RULE: faf convert - YAML to MD/TXT
|
|
571
|
+
commander_1.program
|
|
572
|
+
.command('convert [file]')
|
|
573
|
+
.alias('to-md')
|
|
574
|
+
.description('đ Convert .faf YAML to Markdown or Text (Golden Rule: We SPEAK YAML)')
|
|
575
|
+
.option('-f, --format <type>', 'Output format (md|txt)', 'md')
|
|
576
|
+
.option('-o, --output <file>', 'Output file path')
|
|
577
|
+
.option('-s, --save', 'Save to file (.faf.md or .faf.txt)')
|
|
578
|
+
.addHelpText('after', `
|
|
579
|
+
Examples:
|
|
580
|
+
$ faf convert # Convert .faf to Markdown (console output)
|
|
581
|
+
$ faf convert --save # Save as .faf.md
|
|
582
|
+
$ faf to-md # Quick alias for Markdown
|
|
583
|
+
$ faf convert -f txt # Convert to plain text
|
|
584
|
+
$ faf convert -f txt -s # Save as .faf.txt
|
|
585
|
+
|
|
586
|
+
đ GOLDEN RULE: .faf = YAML ONLY
|
|
587
|
+
âĸ One source of truth: Pure YAML
|
|
588
|
+
âĸ Convert when needed: MD for docs, TXT for sharing
|
|
589
|
+
âĸ No parse errors ever again!`)
|
|
590
|
+
.action(withAnalyticsTracking('convert', async (file, options) => {
|
|
591
|
+
await (0, convert_1.convertCommand)(file, options);
|
|
592
|
+
}));
|
|
593
|
+
commander_1.program
|
|
594
|
+
.command('to-txt [file]')
|
|
595
|
+
.description('đ Quick convert .faf YAML to plain text')
|
|
596
|
+
.action(withAnalyticsTracking('to-txt', async (file) => {
|
|
597
|
+
await (0, convert_1.toText)(file);
|
|
598
|
+
}));
|
|
599
|
+
// đŖī¸ faf chat - Natural Language .faf Generation
|
|
600
|
+
commander_1.program
|
|
601
|
+
.command('chat')
|
|
602
|
+
.description('đŖī¸ Natural language .faf generation - conversation-driven context building')
|
|
603
|
+
.addHelpText('after', `
|
|
604
|
+
Examples:
|
|
605
|
+
$ faf chat # Start conversational .faf creation
|
|
606
|
+
|
|
607
|
+
đŖī¸ Simple Natural Language Interface:
|
|
608
|
+
âĸ Answer simple questions about your project
|
|
609
|
+
âĸ Choose from numbered options (KISS method)
|
|
610
|
+
âĸ Get perfect .faf file without technical flags
|
|
611
|
+
âĸ Same championship output, accessible input
|
|
612
|
+
|
|
613
|
+
Perfect for:
|
|
614
|
+
âĸ Non-technical team members
|
|
615
|
+
âĸ Quick project setup
|
|
616
|
+
âĸ Learning FAF concepts through conversation`)
|
|
617
|
+
.action(withAnalyticsTracking('chat', () => (0, chat_1.chatCommand)()));
|
|
618
|
+
// đ¤ faf verify - AI Verification System (The Trust Builder)
|
|
619
|
+
commander_1.program
|
|
620
|
+
.command('verify')
|
|
621
|
+
.description('đ¤ Test .faf context with Claude, ChatGPT & Gemini - prove AI understanding')
|
|
622
|
+
.option('-d, --detailed', 'Show detailed verification results')
|
|
623
|
+
.option('-m, --models <models>', 'Specify models to test (comma-separated)', 'claude,chatgpt,gemini')
|
|
624
|
+
.option('-t, --timeout <ms>', 'Verification timeout in milliseconds', '30000')
|
|
625
|
+
.addHelpText('after', `
|
|
626
|
+
Examples:
|
|
627
|
+
$ faf verify # Test with all AI models
|
|
628
|
+
$ faf verify --detailed # Show detailed results & suggestions
|
|
629
|
+
$ faf verify -m claude,chatgpt # Test with specific models only
|
|
630
|
+
|
|
631
|
+
AI Verification Tests:
|
|
632
|
+
âĸ Claude: Context understanding & confidence
|
|
633
|
+
âĸ ChatGPT: Project comprehension & clarity
|
|
634
|
+
âĸ Gemini: Technical stack recognition
|
|
635
|
+
âĸ Trust Score: Updated based on AI feedback
|
|
636
|
+
|
|
637
|
+
Expected Transformation:
|
|
638
|
+
đ´ Needs improvement â âī¸ Perfect context`)
|
|
639
|
+
.action((options) => {
|
|
640
|
+
const models = options.models ? options.models.split(',').map((m) => m.trim()) : undefined;
|
|
641
|
+
(0, verify_1.verifyCommand)({
|
|
642
|
+
models,
|
|
643
|
+
timeout: parseInt(options.timeout),
|
|
644
|
+
detailed: options.detailed
|
|
645
|
+
});
|
|
646
|
+
});
|
|
647
|
+
// đ faf stacks - STACKTISTICS: Stack Discovery & Collection
|
|
648
|
+
commander_1.program
|
|
649
|
+
.command('stacks')
|
|
650
|
+
.description('đ Discover and collect technology stack signatures')
|
|
651
|
+
.option('-s, --scan', 'Scan current project for stack signature')
|
|
652
|
+
.option('-e, --export-gallery', 'Export stacks for Gallery-Svelte')
|
|
653
|
+
.addHelpText('after', `
|
|
654
|
+
đ STACKTISTICS Examples:
|
|
655
|
+
$ faf stacks # List your discovered stacks
|
|
656
|
+
$ faf stacks --scan # Discover current project stack
|
|
657
|
+
$ faf stacks --export-gallery # Export for Gallery-Svelte
|
|
658
|
+
|
|
659
|
+
Stack Discovery:
|
|
660
|
+
âĸ Extends fab-formats intelligence - zero performance impact
|
|
661
|
+
âĸ Simple YAML lookup of known stack patterns
|
|
662
|
+
âĸ Builds collection of your technology experiences`)
|
|
663
|
+
.action(async (options) => {
|
|
664
|
+
if (options.scan) {
|
|
665
|
+
await (0, stacks_1.scanCurrentProject)();
|
|
666
|
+
}
|
|
667
|
+
else if (options['export-gallery']) {
|
|
668
|
+
await (0, stacks_1.exportForGallery)();
|
|
669
|
+
}
|
|
670
|
+
else {
|
|
671
|
+
await (0, stacks_1.listStacks)();
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
// đ faf check - Comprehensive validation & audit (merged validate + audit)
|
|
675
|
+
commander_1.program
|
|
676
|
+
.command('check')
|
|
677
|
+
.description('đ Comprehensive .faf validation and freshness check')
|
|
678
|
+
.option('--format', 'Check format/validity only (old validate)')
|
|
679
|
+
.option('--fresh', 'Check freshness/completeness only (old audit)')
|
|
680
|
+
.option('--fix', 'Auto-fix issues where possible')
|
|
681
|
+
.option('-d, --detailed', 'Show detailed check results')
|
|
682
|
+
.addHelpText('after', `
|
|
683
|
+
Examples:
|
|
684
|
+
$ faf check # Full check (format + freshness)
|
|
685
|
+
$ faf check --format # Format validation only
|
|
686
|
+
$ faf check --fresh # Freshness audit only
|
|
687
|
+
$ faf check --fix # Auto-fix issues
|
|
688
|
+
$ faf check --detailed # Detailed diagnostics
|
|
689
|
+
|
|
690
|
+
Combines old validate + audit:
|
|
691
|
+
âĸ Format validation (schema, YAML syntax, required fields)
|
|
692
|
+
âĸ Freshness audit (up-to-date, completeness, staleness)
|
|
693
|
+
âĸ Auto-fix capabilities for common issues`)
|
|
694
|
+
.action((options) => (0, check_1.checkCommand)(options));
|
|
695
|
+
// â
faf validate - Check if .faf file is valid
|
|
696
|
+
commander_1.program
|
|
697
|
+
.command('validate [file]')
|
|
698
|
+
.description('Validate .faf file structure and content')
|
|
699
|
+
.option('-v, --verbose', 'Show detailed validation output')
|
|
700
|
+
.option('-s, --schema <path>', 'Custom schema file to validate against')
|
|
701
|
+
.addHelpText('after', `
|
|
702
|
+
Examples:
|
|
703
|
+
$ faf validate # Validate current .faf file
|
|
704
|
+
$ faf validate --verbose # Show detailed validation report`)
|
|
705
|
+
.action(withAnalyticsTracking('validate', validate_1.validateFafFile));
|
|
706
|
+
// đ faf audit - Check freshness and quality
|
|
707
|
+
commander_1.program
|
|
708
|
+
.command('audit [file]')
|
|
709
|
+
.description('Check .faf file freshness and identify improvement areas')
|
|
710
|
+
.option('-w, --warn-days <days>', 'Days before warning about staleness', '7')
|
|
711
|
+
.option('-e, --error-days <days>', 'Days before marking as stale', '30')
|
|
712
|
+
.addHelpText('after', `
|
|
713
|
+
Examples:
|
|
714
|
+
$ faf audit # Check freshness and quality
|
|
715
|
+
$ faf audit --warn-days 3 # Warn if older than 3 days`)
|
|
716
|
+
.action(withAnalyticsTracking('audit', audit_1.auditFafFile));
|
|
717
|
+
// đ faf score - See how complete your context is
|
|
718
|
+
commander_1.program
|
|
719
|
+
.command('score [file]')
|
|
720
|
+
.description('Rate your .faf completeness (0-100%). Aim for 70%+ for good AI context.')
|
|
721
|
+
.option('-d, --details', 'Show detailed scoring breakdown')
|
|
722
|
+
.option('-m, --minimum <score>', 'Minimum required score (fails if below)')
|
|
723
|
+
.addHelpText('after', `
|
|
724
|
+
Examples:
|
|
725
|
+
$ faf score # Quick score check
|
|
726
|
+
$ faf score --details # See what's missing for higher score
|
|
727
|
+
$ faf score --minimum 80 # Fail if score below 80%`)
|
|
728
|
+
.action(withAnalyticsTracking('score', score_1.scoreFafFile));
|
|
729
|
+
// đ faf edit - Edit helper
|
|
730
|
+
commander_1.program
|
|
731
|
+
.command('edit [file]')
|
|
732
|
+
.description('Get guidance on editing your .faf file to improve score')
|
|
733
|
+
.option('-o, --open', 'Open in default editor')
|
|
734
|
+
.addHelpText('after', `
|
|
735
|
+
Examples:
|
|
736
|
+
$ faf edit # Show what to edit
|
|
737
|
+
$ faf edit --open # Open in $EDITOR
|
|
738
|
+
|
|
739
|
+
Helps you understand which fields to fill for a higher score.`)
|
|
740
|
+
.action(withAnalyticsTracking('edit', edit_helper_1.editFafFile));
|
|
741
|
+
// đī¸ faf show - Championship Score Card Display
|
|
742
|
+
commander_1.program
|
|
743
|
+
.command('show [directory]')
|
|
744
|
+
.description('đī¸ Display FAF Championship Score Card with clean markdown output')
|
|
745
|
+
.option('-r, --raw', 'Output raw markdown (for piping)')
|
|
746
|
+
.addHelpText('after', `
|
|
747
|
+
Examples:
|
|
748
|
+
$ faf show # Show score card for current directory
|
|
749
|
+
$ faf show ./my-project # Show score card for specific directory
|
|
750
|
+
$ faf show --raw # Output raw markdown for piping
|
|
751
|
+
$ faf show --raw | pbcopy # Copy score card to clipboard
|
|
752
|
+
|
|
753
|
+
đĢđ CHOCOLATE ORANGE - NO WRAPPERS!
|
|
754
|
+
Clean markdown output that displays naturally.`)
|
|
755
|
+
.action(withAnalyticsTracking('show', show_1.showFafScoreCard));
|
|
756
|
+
// đ faf sync - Keep .faf up-to-date automatically + Bi-directional sync
|
|
757
|
+
commander_1.program
|
|
758
|
+
.command('sync [file]')
|
|
759
|
+
.description('Update .faf when dependencies change OR sync with claude.md (bi-directional sync)')
|
|
760
|
+
.option('-a, --auto', 'Automatically apply detected changes')
|
|
761
|
+
.option('-d, --dry-run', 'Show changes without applying')
|
|
762
|
+
.option('-b, --bi-sync', 'đ Bi-directional sync .faf â claude.md')
|
|
763
|
+
.option('-w, --watch', 'Start real-time file watching (with --bi-sync)')
|
|
764
|
+
.addHelpText('after', `
|
|
765
|
+
Examples:
|
|
766
|
+
$ faf sync # Show what needs updating
|
|
767
|
+
$ faf sync --auto # Update automatically
|
|
768
|
+
$ faf sync --dry-run # Preview changes only
|
|
769
|
+
|
|
770
|
+
đ Bi-Sync Examples:
|
|
771
|
+
$ faf sync --bi-sync # Real-time .faf â claude.md sync
|
|
772
|
+
$ faf sync --bi-sync --watch # Continuous real-time monitoring
|
|
773
|
+
$ faf sync --bi-sync --auto # Automatic conflict-free sync
|
|
774
|
+
|
|
775
|
+
Championship Bi-Sync Features:
|
|
776
|
+
âĸ ⥠Sub-40ms sync time (faster than most file operations)
|
|
777
|
+
âĸ đ§ Smart merge algorithms prevent conflicts and data corruption
|
|
778
|
+
âĸ đ Self-healing: Auto-recovers from file locks/system issues
|
|
779
|
+
âĸ đ Credit propagation: Technical credit updates both files
|
|
780
|
+
âĸ đ§Ą Trust synchronization: AI compatibility scores stay aligned
|
|
781
|
+
âĸ đĄī¸ Conflict prevention: Detects simultaneous edits safely`)
|
|
782
|
+
.action(async (file, options) => {
|
|
783
|
+
if (options.biSync) {
|
|
784
|
+
// Bi-directional sync mode
|
|
785
|
+
await (0, bi_sync_1.biSyncCommand)({
|
|
786
|
+
auto: options.auto,
|
|
787
|
+
watch: options.watch,
|
|
788
|
+
force: false
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
else {
|
|
792
|
+
// Original sync functionality
|
|
793
|
+
await (0, sync_1.syncFafFile)(file, options);
|
|
794
|
+
}
|
|
795
|
+
});
|
|
796
|
+
// đ faf bi-sync - Standalone bi-directional sync command
|
|
797
|
+
commander_1.program
|
|
798
|
+
.command('bi-sync')
|
|
799
|
+
.description('đ Bi-directional sync .faf â claude.md')
|
|
800
|
+
.option('-a, --auto', 'Automatic sync without prompts')
|
|
801
|
+
.option('-w, --watch', 'Start real-time file watching')
|
|
802
|
+
.option('-f, --force', 'Force overwrite conflicts')
|
|
803
|
+
.addHelpText('after', `
|
|
804
|
+
Examples:
|
|
805
|
+
$ faf bi-sync # Create claude.md and sync
|
|
806
|
+
$ faf bi-sync --auto # Automatic conflict-free sync
|
|
807
|
+
$ faf bi-sync --watch # Continuous real-time monitoring
|
|
808
|
+
|
|
809
|
+
Championship Bi-Sync Features:
|
|
810
|
+
âĸ ⥠Sub-40ms sync time (faster than most file operations)
|
|
811
|
+
âĸ đ§ Smart merge algorithms prevent conflicts and data corruption
|
|
812
|
+
âĸ đ Self-healing: Auto-recovers from file locks/system issues
|
|
813
|
+
âĸ đ Credit propagation: Technical credit updates both files
|
|
814
|
+
âĸ đ§Ą Trust synchronization: AI compatibility scores stay aligned
|
|
815
|
+
âĸ đĄī¸ Conflict prevention: Detects simultaneous edits safely`)
|
|
816
|
+
.action(async (options) => {
|
|
817
|
+
await (0, bi_sync_1.biSyncCommand)({
|
|
818
|
+
auto: options.auto,
|
|
819
|
+
watch: options.watch,
|
|
820
|
+
force: options.force || false
|
|
821
|
+
});
|
|
822
|
+
});
|
|
823
|
+
// đ§š faf clear - Reset caches and state (Claude Code consistency)
|
|
824
|
+
commander_1.program
|
|
825
|
+
.command('clear')
|
|
826
|
+
.description('đ§š Clear caches, temporary files, and reset state')
|
|
827
|
+
.option('--cache', 'Clear trust cache only')
|
|
828
|
+
.option('--todos', 'Clear todo lists only')
|
|
829
|
+
.option('--backups', 'Clear backup files only')
|
|
830
|
+
.option('--all', 'Clear everything (default)')
|
|
831
|
+
.addHelpText('after', `
|
|
832
|
+
Examples:
|
|
833
|
+
$ faf clear # Clear all caches and temp files
|
|
834
|
+
$ faf clear --cache # Clear trust cache only
|
|
835
|
+
$ faf clear --todos # Clear todo lists only
|
|
836
|
+
$ faf clear --backups # Clear backup files only
|
|
837
|
+
|
|
838
|
+
Claude Code Consistency:
|
|
839
|
+
âĸ Similar to /clear command in Claude Code
|
|
840
|
+
âĸ Fresh start for .faf system
|
|
841
|
+
âĸ Removes temporary files and cached data`)
|
|
842
|
+
.action((options) => (0, clear_1.clearCommand)(options));
|
|
843
|
+
// âī¸ faf edit - Interactive .faf editor (Claude Code consistency)
|
|
844
|
+
commander_1.program
|
|
845
|
+
.command('edit')
|
|
846
|
+
.description('âī¸ Interactive .faf editor with validation')
|
|
847
|
+
.option('--editor <editor>', 'Specific editor to use (code, vim, nano)')
|
|
848
|
+
.option('--section <section>', 'Edit specific section (project, stack, etc.)')
|
|
849
|
+
.option('--no-validate', 'Skip validation after editing')
|
|
850
|
+
.addHelpText('after', `
|
|
851
|
+
Examples:
|
|
852
|
+
$ faf edit # Open .faf in default editor
|
|
853
|
+
$ faf edit --editor vim # Use specific editor
|
|
854
|
+
$ faf edit --section project # Edit project section only
|
|
855
|
+
$ faf edit --no-validate # Skip post-edit validation
|
|
856
|
+
|
|
857
|
+
Claude Code Consistency:
|
|
858
|
+
âĸ Similar to /edit command in Claude Code
|
|
859
|
+
âĸ Automatic backup before editing
|
|
860
|
+
âĸ Post-edit validation with restore on errors`)
|
|
861
|
+
.action((options) => (0, edit_1.editCommand)(options));
|
|
862
|
+
// đ faf search - Search .faf content (Claude Code consistency)
|
|
863
|
+
commander_1.program
|
|
864
|
+
.command('search <query>')
|
|
865
|
+
.description('đ Search within .faf file content with highlighting')
|
|
866
|
+
.option('--section <section>', 'Search in specific section only')
|
|
867
|
+
.option('--case', 'Case sensitive search')
|
|
868
|
+
.option('--keys', 'Search keys only')
|
|
869
|
+
.option('--values', 'Search values only')
|
|
870
|
+
.option('--count', 'Show match count only')
|
|
871
|
+
.addHelpText('after', `
|
|
872
|
+
Examples:
|
|
873
|
+
$ faf search "react" # Search for "react" anywhere
|
|
874
|
+
$ faf search "api" --section project # Search in project section only
|
|
875
|
+
$ faf search "test" --keys # Search in keys only
|
|
876
|
+
$ faf search "node" --case # Case sensitive search
|
|
877
|
+
$ faf search "component" --count # Just show match count
|
|
878
|
+
|
|
879
|
+
Claude Code Consistency:
|
|
880
|
+
âĸ Similar to /search command in Claude Code
|
|
881
|
+
âĸ Intelligent highlighting of matches
|
|
882
|
+
âĸ Section-aware searching with path display`)
|
|
883
|
+
.action(withAnalyticsTracking('search', (query, options) => (0, search_1.searchCommand)(query, options)));
|
|
884
|
+
// đ faf analytics - Analytics & Telemetry Management
|
|
885
|
+
commander_1.program
|
|
886
|
+
.command('analytics')
|
|
887
|
+
.description('đ View usage analytics and manage telemetry settings')
|
|
888
|
+
.option('-s, --summary', 'Show analytics summary')
|
|
889
|
+
.option('-d, --disable', 'Disable telemetry collection')
|
|
890
|
+
.option('-e, --enable', 'Enable telemetry collection')
|
|
891
|
+
.option('--reset', 'Reset all analytics data')
|
|
892
|
+
.addHelpText('after', `
|
|
893
|
+
Examples:
|
|
894
|
+
$ faf analytics --summary # View usage statistics
|
|
895
|
+
$ faf analytics --disable # Turn off telemetry
|
|
896
|
+
$ faf analytics --enable # Turn on telemetry
|
|
897
|
+
$ faf analytics --reset # Clear analytics data
|
|
898
|
+
|
|
899
|
+
Championship Analytics:
|
|
900
|
+
âĸ đ Performance metrics (F1-inspired speed tracking)
|
|
901
|
+
âĸ đ Command usage patterns and favorites
|
|
902
|
+
âĸ đ Trust score improvements over time
|
|
903
|
+
âĸ đ Privacy-first: All data anonymized and local
|
|
904
|
+
âĸ đ Help make FAF better for everyone!
|
|
905
|
+
|
|
906
|
+
Privacy Controls:
|
|
907
|
+
âĸ Telemetry can be disabled anytime
|
|
908
|
+
âĸ No sensitive data collected (keys, tokens filtered)
|
|
909
|
+
âĸ All metrics stored locally first
|
|
910
|
+
âĸ Opt-in for improvement insights`)
|
|
911
|
+
.action(withAnalyticsTracking('analytics', async (options) => {
|
|
912
|
+
if (options.summary) {
|
|
913
|
+
await analytics_1.analytics.showAnalyticsSummary();
|
|
914
|
+
}
|
|
915
|
+
else if (options.disable) {
|
|
916
|
+
await analytics_1.analytics.disableTelemetry();
|
|
917
|
+
}
|
|
918
|
+
else if (options.enable) {
|
|
919
|
+
await analytics_1.analytics.enableTelemetry();
|
|
920
|
+
}
|
|
921
|
+
else if (options.reset) {
|
|
922
|
+
// Reset analytics would be implemented
|
|
923
|
+
console.log('đ Analytics reset functionality coming soon!');
|
|
924
|
+
}
|
|
925
|
+
else {
|
|
926
|
+
// Default: show summary
|
|
927
|
+
await analytics_1.analytics.showAnalyticsSummary();
|
|
928
|
+
}
|
|
929
|
+
}));
|
|
930
|
+
// đŠĩ faf faq - Show FAQ
|
|
931
|
+
commander_1.program
|
|
932
|
+
.command('faq')
|
|
933
|
+
.description('đŠĩ Frequently Asked Questions - Get help with common issues')
|
|
934
|
+
.option('-s, --search <term>', 'Search FAQ for specific topic')
|
|
935
|
+
.addHelpText('after', `
|
|
936
|
+
Examples:
|
|
937
|
+
$ faf faq # Show full FAQ
|
|
938
|
+
$ faf faq --search spacebar # Search for spacebar info
|
|
939
|
+
$ faf faq --search commands # Search for command info`)
|
|
940
|
+
.action(withAnalyticsTracking('faq', async (options) => {
|
|
941
|
+
const faqCommand = await Promise.resolve().then(() => __importStar(require('./commands/faq')));
|
|
942
|
+
await faqCommand.faqCommand(options);
|
|
943
|
+
}));
|
|
944
|
+
// đ§ faf lint - Clean up formatting automatically
|
|
945
|
+
commander_1.program
|
|
946
|
+
.command('lint [file]')
|
|
947
|
+
.description('Fix .faf formatting and style issues')
|
|
948
|
+
.option('-f, --fix', 'Automatically fix formatting issues')
|
|
949
|
+
.option('--schema-version <version>', 'Validate against specific schema version')
|
|
950
|
+
.addHelpText('after', `
|
|
951
|
+
Examples:
|
|
952
|
+
$ faf lint # Check formatting issues
|
|
953
|
+
$ faf lint --fix # Fix formatting automatically
|
|
954
|
+
$ faf lint --schema-version 2.4.0 # Use specific schema`)
|
|
955
|
+
.action(lint_1.lintFafFile);
|
|
956
|
+
// đ faf enhance - Claude-First, Big-3 Compatible Enhancement
|
|
957
|
+
commander_1.program
|
|
958
|
+
.command('enhance [file]')
|
|
959
|
+
.description('đ Claude-First AI Enhancement - Big-3 Compatible, Bullet-proof Universal')
|
|
960
|
+
.option('-m, --model <model>', 'AI model: claude|chatgpt|gemini|big3|universal', 'claude')
|
|
961
|
+
.option('-f, --focus <area>', 'Focus: human-context|ai-instructions|completeness|claude-exclusive', 'completeness')
|
|
962
|
+
.option('--consensus', 'Build consensus from multiple models')
|
|
963
|
+
.option('--dry-run', 'Show enhancement prompt without executing')
|
|
964
|
+
.addHelpText('after', `
|
|
965
|
+
đ¤ Claude-First Enhancement:
|
|
966
|
+
$ faf enhance # Claude intelligence (default)
|
|
967
|
+
$ faf enhance --model big3 # Big-3 consensus enhancement
|
|
968
|
+
$ faf enhance --focus claude-exclusive # Claude's F1-inspired specialty
|
|
969
|
+
$ faf enhance --consensus # Multi-model consensus
|
|
970
|
+
$ faf enhance --dry-run # Preview enhancement
|
|
971
|
+
|
|
972
|
+
đ NO EXTERNAL DEPENDENCIES - Uses our own Big-3 verification engine!`)
|
|
973
|
+
.action(ai_enhance_1.enhanceFafWithAI);
|
|
974
|
+
// đ faf analyze - Claude-First, Big-3 Compatible Analysis
|
|
975
|
+
commander_1.program
|
|
976
|
+
.command('analyze [file]')
|
|
977
|
+
.description('đ Claude-First AI Analysis - Big-3 Compatible Intelligence')
|
|
978
|
+
.option('-m, --model <model>', 'AI model: claude|chatgpt|gemini|big3|universal', 'claude')
|
|
979
|
+
.option('-f, --focus <area>', 'Focus: completeness|quality|ai-readiness|human-context|claude-exclusive')
|
|
980
|
+
.option('-v, --verbose', 'Show detailed section breakdown')
|
|
981
|
+
.option('-s, --suggestions', 'Include automated suggestions')
|
|
982
|
+
.option('-c, --comparative', 'Compare perspectives from multiple models')
|
|
983
|
+
.addHelpText('after', `
|
|
984
|
+
đ¤ Claude-First Analysis:
|
|
985
|
+
$ faf analyze # Claude intelligence (default)
|
|
986
|
+
$ faf analyze --model big3 # Big-3 perspective analysis
|
|
987
|
+
$ faf analyze --focus claude-exclusive # Claude's championship analysis
|
|
988
|
+
$ faf analyze --comparative # Multi-model comparison
|
|
989
|
+
$ faf analyze --verbose --suggestions # Detailed analysis + tips
|
|
990
|
+
|
|
991
|
+
đ NO EXTERNAL DEPENDENCIES - Uses our own Big-3 verification engine!`)
|
|
992
|
+
.action(ai_analyze_1.analyzeFafWithAI);
|
|
993
|
+
// Handle unknown commands with helpful suggestions
|
|
994
|
+
commander_1.program
|
|
995
|
+
.command('*', { noHelp: true })
|
|
996
|
+
.action((cmd) => {
|
|
997
|
+
console.log(chalk_1.default.red(`â Unknown command: ${cmd}`));
|
|
998
|
+
console.log('');
|
|
999
|
+
console.log(championship_style_1.FAF_COLORS.fafOrange('đĄ Did you mean:'));
|
|
1000
|
+
console.log(' ' + chalk_1.default.cyan('faf init') + ' # Create .faf file');
|
|
1001
|
+
console.log(' ' + chalk_1.default.cyan('faf score') + ' # Check completeness');
|
|
1002
|
+
console.log(' ' + chalk_1.default.cyan('faf --help') + ' # See all commands');
|
|
1003
|
+
process.exit(1);
|
|
1004
|
+
});
|
|
1005
|
+
/**
|
|
1006
|
+
* Interactive welcome screen with persistent bottom command line
|
|
1007
|
+
*/
|
|
1008
|
+
async function showInteractiveWelcome() {
|
|
1009
|
+
// Clear screen and set up persistent layout
|
|
1010
|
+
console.clear();
|
|
1011
|
+
// ASCII Header
|
|
1012
|
+
console.log((0, championship_style_1.generateFAFHeader)());
|
|
1013
|
+
console.log('');
|
|
1014
|
+
console.log(chalk_1.default.dim('Using faf menu'));
|
|
1015
|
+
console.log('');
|
|
1016
|
+
// Hello User
|
|
1017
|
+
const username = require('os').userInfo().username;
|
|
1018
|
+
console.log(chalk_1.default.cyan.bold(` đ Hello ${username}!`));
|
|
1019
|
+
console.log('');
|
|
1020
|
+
// Ready message
|
|
1021
|
+
console.log(chalk_1.default.white(' Ready to make your AI happy again?'));
|
|
1022
|
+
console.log('');
|
|
1023
|
+
// Footer - show BEFORE menu
|
|
1024
|
+
await showScoreFooter();
|
|
1025
|
+
console.log('');
|
|
1026
|
+
try {
|
|
1027
|
+
const answer = await inquirer_1.default.prompt([
|
|
1028
|
+
{
|
|
1029
|
+
type: 'list',
|
|
1030
|
+
name: 'action',
|
|
1031
|
+
message: 'Select an option',
|
|
1032
|
+
choices: [
|
|
1033
|
+
{ name: '1. Create your first .faf file', value: 'init' },
|
|
1034
|
+
{ name: '2. Interactive context builder', value: 'chat' },
|
|
1035
|
+
{ name: '3. See all commands', value: 'help' },
|
|
1036
|
+
{ name: '4. FAQ - Get help & answers', value: 'faq' },
|
|
1037
|
+
{ name: '5. Browse everything A-Z', value: 'index' },
|
|
1038
|
+
{ name: '6. Switch to command line', value: 'commandline' },
|
|
1039
|
+
new inquirer_1.default.Separator('')
|
|
1040
|
+
]
|
|
1041
|
+
}
|
|
1042
|
+
]);
|
|
1043
|
+
// If user selected command line mode, switch to persistent typing
|
|
1044
|
+
if (answer.action === 'commandline') {
|
|
1045
|
+
console.clear();
|
|
1046
|
+
console.log((0, championship_style_1.generateFAFHeader)());
|
|
1047
|
+
console.log('');
|
|
1048
|
+
console.log(chalk_1.default.dim('Using faf CLI'));
|
|
1049
|
+
console.log('');
|
|
1050
|
+
console.log(chalk_1.default.cyan.bold('â¨ī¸ Command Line Mode'));
|
|
1051
|
+
console.log(chalk_1.default.gray('Type commands, "menu" for menu, or "index" for the .faf A-Z'));
|
|
1052
|
+
console.log('');
|
|
1053
|
+
// Persistent command line loop with spacebar detection
|
|
1054
|
+
let inCommandMode = true;
|
|
1055
|
+
while (inCommandMode) {
|
|
1056
|
+
const cmdAnswer = await new Promise((resolve) => {
|
|
1057
|
+
let inputBuffer = '';
|
|
1058
|
+
// Show prompt
|
|
1059
|
+
process.stdout.write('> ');
|
|
1060
|
+
// Set up raw keyboard input for spacebar detection
|
|
1061
|
+
if (process.stdin.isTTY) {
|
|
1062
|
+
process.stdin.setRawMode(true);
|
|
1063
|
+
process.stdin.resume();
|
|
1064
|
+
process.stdin.setEncoding('utf8');
|
|
1065
|
+
const keyHandler = (key) => {
|
|
1066
|
+
// Spacebar pressed - toggle to menu
|
|
1067
|
+
if (key === ' ' && inputBuffer === '') {
|
|
1068
|
+
process.stdin.setRawMode(false);
|
|
1069
|
+
process.stdin.removeListener('data', keyHandler);
|
|
1070
|
+
console.log('\n' + chalk_1.default.dim('đ¯ Switching to menu...'));
|
|
1071
|
+
resolve({ command: 'menu' });
|
|
1072
|
+
return;
|
|
1073
|
+
}
|
|
1074
|
+
// Escape pressed - exit
|
|
1075
|
+
if (key === '\u001b') {
|
|
1076
|
+
process.stdin.setRawMode(false);
|
|
1077
|
+
process.stdin.removeListener('data', keyHandler);
|
|
1078
|
+
console.log('\nđ Goodbye!');
|
|
1079
|
+
process.exit(0);
|
|
1080
|
+
}
|
|
1081
|
+
// Enter pressed - execute command
|
|
1082
|
+
if (key === '\r' || key === '\n') {
|
|
1083
|
+
process.stdin.setRawMode(false);
|
|
1084
|
+
process.stdin.removeListener('data', keyHandler);
|
|
1085
|
+
console.log('');
|
|
1086
|
+
resolve({ command: inputBuffer });
|
|
1087
|
+
return;
|
|
1088
|
+
}
|
|
1089
|
+
// Backspace
|
|
1090
|
+
if (key === '\u007f') {
|
|
1091
|
+
if (inputBuffer.length > 0) {
|
|
1092
|
+
inputBuffer = inputBuffer.slice(0, -1);
|
|
1093
|
+
process.stdout.write('\b \b');
|
|
1094
|
+
}
|
|
1095
|
+
return;
|
|
1096
|
+
}
|
|
1097
|
+
// Regular character
|
|
1098
|
+
if (key >= ' ' && key <= '~') {
|
|
1099
|
+
inputBuffer += key;
|
|
1100
|
+
process.stdout.write(key);
|
|
1101
|
+
}
|
|
1102
|
+
};
|
|
1103
|
+
process.stdin.on('data', keyHandler);
|
|
1104
|
+
}
|
|
1105
|
+
else {
|
|
1106
|
+
// Fallback for non-TTY - use regular inquirer
|
|
1107
|
+
inquirer_1.default.prompt([{
|
|
1108
|
+
type: 'input',
|
|
1109
|
+
name: 'command',
|
|
1110
|
+
message: '>'
|
|
1111
|
+
}]).then(resolve);
|
|
1112
|
+
}
|
|
1113
|
+
});
|
|
1114
|
+
const command = cmdAnswer.command.trim().toLowerCase();
|
|
1115
|
+
// Handle mode switching commands
|
|
1116
|
+
if (command === 'exit' || command === 'quit') {
|
|
1117
|
+
console.log('đ Goodbye!');
|
|
1118
|
+
process.exit(0);
|
|
1119
|
+
}
|
|
1120
|
+
if (command === 'menu') {
|
|
1121
|
+
inCommandMode = false;
|
|
1122
|
+
console.log(chalk_1.default.dim('âŠī¸ Returning to menu...'));
|
|
1123
|
+
console.log('');
|
|
1124
|
+
// Recursively call showInteractiveWelcome to return to menu
|
|
1125
|
+
await showInteractiveWelcome();
|
|
1126
|
+
return;
|
|
1127
|
+
}
|
|
1128
|
+
// Execute typed command
|
|
1129
|
+
switch (command) {
|
|
1130
|
+
case 'init':
|
|
1131
|
+
await (0, init_1.initFafFile)();
|
|
1132
|
+
break;
|
|
1133
|
+
case 'chat':
|
|
1134
|
+
await (0, chat_1.chatCommand)();
|
|
1135
|
+
break;
|
|
1136
|
+
case 'help':
|
|
1137
|
+
commander_1.program.help();
|
|
1138
|
+
break;
|
|
1139
|
+
case 'index':
|
|
1140
|
+
await (0, index_1.indexCommand)();
|
|
1141
|
+
break;
|
|
1142
|
+
case 'status':
|
|
1143
|
+
await (0, status_1.statusCommand)();
|
|
1144
|
+
break;
|
|
1145
|
+
case 'faq':
|
|
1146
|
+
const faqCommand = await Promise.resolve().then(() => __importStar(require('./commands/faq')));
|
|
1147
|
+
await faqCommand.faqCommand();
|
|
1148
|
+
break;
|
|
1149
|
+
case '':
|
|
1150
|
+
// Empty command, just continue
|
|
1151
|
+
break;
|
|
1152
|
+
default:
|
|
1153
|
+
// Check if user tried a slash command
|
|
1154
|
+
if (command.startsWith('/')) {
|
|
1155
|
+
const commandWithoutSlash = command.slice(1);
|
|
1156
|
+
console.log(chalk_1.default.red(`â Unknown command: ${command}`));
|
|
1157
|
+
console.log(championship_style_1.FAF_COLORS.fafCyan('đ Good news! You don\'t need a slash in FAF CLI mode'));
|
|
1158
|
+
console.log(championship_style_1.FAF_COLORS.fafOrange(`đĄ Try: ${commandWithoutSlash} (without the /)`));
|
|
1159
|
+
}
|
|
1160
|
+
else {
|
|
1161
|
+
console.log(chalk_1.default.red(`â Unknown command: ${command}`));
|
|
1162
|
+
console.log(championship_style_1.FAF_COLORS.fafOrange('đĄ Try: init, chat, help, index, status, score, exit'));
|
|
1163
|
+
}
|
|
1164
|
+
break;
|
|
1165
|
+
}
|
|
1166
|
+
// Show footer after each command (unless it was help which shows its own footer)
|
|
1167
|
+
if (command !== 'help' && command !== '') {
|
|
1168
|
+
await showScoreFooter('faf');
|
|
1169
|
+
}
|
|
1170
|
+
console.log('');
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
else {
|
|
1174
|
+
// Execute selected menu item
|
|
1175
|
+
const action = answer.action;
|
|
1176
|
+
switch (action) {
|
|
1177
|
+
case 'init':
|
|
1178
|
+
await (0, init_1.initFafFile)();
|
|
1179
|
+
break;
|
|
1180
|
+
case 'chat':
|
|
1181
|
+
await (0, chat_1.chatCommand)();
|
|
1182
|
+
break;
|
|
1183
|
+
case 'help':
|
|
1184
|
+
commander_1.program.help();
|
|
1185
|
+
break;
|
|
1186
|
+
case 'faq':
|
|
1187
|
+
const faqMenuCommand = await Promise.resolve().then(() => __importStar(require('./commands/faq')));
|
|
1188
|
+
await faqMenuCommand.faqCommand();
|
|
1189
|
+
break;
|
|
1190
|
+
case 'index':
|
|
1191
|
+
await (0, index_1.indexCommand)();
|
|
1192
|
+
break;
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
catch (error) {
|
|
1197
|
+
if (error instanceof Error && error.message.includes('User force closed')) {
|
|
1198
|
+
console.log(`\n${chalk_1.default.cyan('đ See you later!')}\n`);
|
|
1199
|
+
}
|
|
1200
|
+
else {
|
|
1201
|
+
console.error(`\n${chalk_1.default.red('â Error:')} ${error}\n`);
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
// Show header based on command used BEFORE parsing
|
|
1206
|
+
const commandUsed = process.argv[2];
|
|
1207
|
+
// Special case: No arguments at all - show interactive welcome
|
|
1208
|
+
if (!commandUsed) {
|
|
1209
|
+
showInteractiveWelcome().then(() => process.exit(0)).catch(err => {
|
|
1210
|
+
console.error(err);
|
|
1211
|
+
process.exit(1);
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
else {
|
|
1215
|
+
// Parse CLI arguments to check for gearbox flags
|
|
1216
|
+
commander_1.program.parse(process.argv);
|
|
1217
|
+
const options = commander_1.program.opts();
|
|
1218
|
+
// Gearbox system: Auto/Manual mode detection
|
|
1219
|
+
const isAutoMode = options.auto;
|
|
1220
|
+
const isManualMode = options.manual;
|
|
1221
|
+
// Auto mode - show interactive welcome
|
|
1222
|
+
if (isAutoMode) {
|
|
1223
|
+
showInteractiveWelcome().then(() => process.exit(0)).catch(err => {
|
|
1224
|
+
console.error(err);
|
|
1225
|
+
process.exit(1);
|
|
1226
|
+
});
|
|
1227
|
+
}
|
|
1228
|
+
else {
|
|
1229
|
+
const isHelp = commandUsed === '--help' || commandUsed === '-h' || commandUsed === 'help';
|
|
1230
|
+
showHeaderIfAppropriate(isHelp ? 'help' : commandUsed);
|
|
1231
|
+
// Apply color accessibility settings after parsing
|
|
1232
|
+
if (options.noColor || process.env.NO_COLOR) {
|
|
1233
|
+
(0, color_utils_1.setColorOptions)(false);
|
|
1234
|
+
}
|
|
1235
|
+
else if (options.colorScheme) {
|
|
1236
|
+
const scheme = options.colorScheme;
|
|
1237
|
+
const validSchemes = ['normal', 'deuteranopia', 'protanopia', 'tritanopia'];
|
|
1238
|
+
if (validSchemes.includes(scheme)) {
|
|
1239
|
+
(0, color_utils_1.setColorOptions)(true, scheme);
|
|
1240
|
+
}
|
|
1241
|
+
else {
|
|
1242
|
+
console.log(chalk_1.default.red(`â Invalid color scheme: ${scheme}`));
|
|
1243
|
+
console.log(championship_style_1.FAF_COLORS.fafOrange(`đĄ Valid schemes: ${validSchemes.join(', ')}`));
|
|
1244
|
+
process.exit(1);
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
//# sourceMappingURL=cli.js.map
|