alnilam-cli
Version:
Git-native AI career coach that converts multi-year ambitions into weekly execution
61 lines (60 loc) • 2.54 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.statusCommand = exports.dashboardCommand = void 0;
const react_1 = __importDefault(require("react"));
const commander_1 = require("commander");
const ink_1 = require("ink");
const Dashboard_js_1 = __importDefault(require("../components/dashboard/Dashboard.js"));
const dashboardCommand = new commander_1.Command('dashboard');
exports.dashboardCommand = dashboardCommand;
dashboardCommand
.description('Interactive visual dashboard with live progress tracking')
.option('--auto-refresh', 'Enable auto-refresh every 30 seconds')
.option('--refresh-interval <seconds>', 'Set custom refresh interval in seconds', '30')
.option('--compact', 'Use compact layout for smaller terminals')
.action(async (options) => {
try {
const refreshInterval = parseInt(options.refreshInterval) * 1000;
// Render the Ink dashboard
const { rerender, unmount } = (0, ink_1.render)(react_1.default.createElement(Dashboard_js_1.default, {
autoRefresh: options.autoRefresh,
refreshInterval: refreshInterval
}));
// Handle graceful shutdown
const cleanup = () => {
unmount();
process.exit(0);
};
process.on('SIGINT', cleanup);
process.on('SIGTERM', cleanup);
}
catch (error) {
console.error('❌ Dashboard error:', error.message);
process.exit(1);
}
});
// Add status command for quick visual overview
const statusCommand = new commander_1.Command('status');
exports.statusCommand = statusCommand;
statusCommand
.description('Quick visual status overview')
.option('--visual', 'Show visual progress indicators')
.option('--json', 'Output as JSON')
.action(async (options) => {
// For now, redirect to existing functionality with visual hints
if (options.visual) {
console.log('🎯 Visual Status Overview');
console.log('═'.repeat(40));
console.log('📊 For full visual dashboard: alnl dashboard');
console.log('🔄 For momentum tracking: alnl evaluate');
console.log('📋 For weekly planning: alnl plan');
console.log('📈 For goal progress: alnl goal list');
console.log('═'.repeat(40));
}
else {
console.log('Use --visual flag for enhanced status display');
}
});