tat-optimize
Version:
š§æ Tat Tvam Asi CLI ā Chakra Diagnostic, Healing & Optimization Tool powered by Multidimensional Consciousness Coding. Ideal for DevOps mystics, spiritual engineers, and agentic AI orchestration.
99 lines (79 loc) ⢠3.24 kB
JavaScript
// tat-check.mjs š§æ Chakra Alignment Diagnostic CLI (Multidimensional Holistic Completion)
import fs from 'fs';
import path from 'path';
import chalk from 'chalk';
import ora from 'ora';
const FILE = '.tat-optimize';
const LOG_FILE = '.chakra.log';
const EXPORT_FILE = 'chakra-export.json';
const SNAPSHOT_FILE = '.chakra.snapshot.json';
const args = process.argv.slice(2);
const chakraColors = {
Muladhara: 'red',
Svadhisthana: 'orange',
Manipura: 'yellow',
Anahata: 'green',
Vishuddha: 'blue',
Ajna: 'magenta',
Sahasrara: 'cyan',
'Anahata (Human)': 'greenBright',
'Ajna (Ethics)': 'magentaBright',
'Sahasrara (Growth)': 'cyanBright'
};
function logToFile(data) {
const timestamp = new Date().toISOString();
const entry = `[${timestamp}] ${data}\n`;
fs.appendFileSync(path.resolve(LOG_FILE), entry);
}
function exportChakrasToJSON(chakras) {
const outputPath = path.resolve(EXPORT_FILE);
fs.writeFileSync(outputPath, JSON.stringify(chakras, null, 2));
console.log(chalk.yellow(`\nš¦ Exported chakra data to ${EXPORT_FILE}`));
}
function syncSnapshot(manifest) {
const outputPath = path.resolve(SNAPSHOT_FILE);
fs.writeFileSync(outputPath, JSON.stringify(manifest, null, 2));
console.log(chalk.blue(`\nš¾ Synced chakra snapshot to ${SNAPSHOT_FILE}`));
}
function printChakraStatus(chakra, mode = 'diagnostic') {
const { chakra: name, field, status } = chakra;
const color = chakraColors[name] || 'white';
const label = chalk[color]?.(`š¹ ${name.padEnd(20)} ā ${field.padEnd(28)}`) || `š¹ ${name.padEnd(20)} ā ${field.padEnd(28)}`;
const logStatus = (status === 'active') ? 'ā
ACTIVE' : 'ā ļø INACTIVE';
logToFile(`${name} (${field}): ${logStatus}`);
if (status === 'active') {
console.log(`${label} ${chalk.green.bold(logStatus)}`);
} else {
console.log(`${label} ${chalk.red.bold(logStatus)}`);
if (mode === 'heal') {
console.log(chalk.green(` šæ Healing action: Apply mudra, chant bija mantra, and visualize ${name} blossoming.`));
} else {
console.log(chalk.gray(` ⨠Affirmation: "I now activate the ${name} center for full-flow integration."`));
}
}
}
async function runDiagnostic() {
const spinner = ora('š Scanning chakra alignment...').start();
try {
const raw = fs.readFileSync(path.resolve(FILE), 'utf8');
const manifest = JSON.parse(raw);
spinner.succeed('⨠Chakra scan complete!\n');
console.log(chalk.bold.cyan('\nš Tat Tvam Asi ā Chakra Optimization Diagnostic š\n'));
console.log(chalk.gray(`System: ${manifest.system} | Profile: ${manifest.profile}\n`));
const chakras = manifest.chakras || [];
const mode = args.includes('--heal') ? 'heal' : 'diagnostic';
chakras.forEach(chakra => printChakraStatus(chakra, mode));
if (args.includes('--export')) {
exportChakrasToJSON(chakras);
}
if (args.includes('--sync')) {
syncSnapshot(manifest);
}
console.log(chalk.cyan('\n⨠Diagnostic complete. All chakras are now visible to the agents of flow.\n'));
} catch (err) {
spinner.fail('ā Failed to read .tat-optimize file.');
console.error(chalk.red(err.message));
}
}
runDiagnostic();