feat(cli): auto-stage when nothing staged for g m/g l/g o; docs: update README

This commit is contained in:
s41r4j
2025-10-02 12:48:16 +05:30
parent c0f4cd97eb
commit f7c07e1af1
21 changed files with 2200 additions and 447 deletions
+16
View File
@@ -0,0 +1,16 @@
/**
* ANSI color utilities without external dependencies
*/
const color = {
green: (s) => `\x1b[32m${s}\x1b[0m`,
yellow: (s) => `\x1b[33m${s}\x1b[0m`,
red: (s) => `\x1b[31m${s}\x1b[0m`,
cyan: (s) => `\x1b[36m${s}\x1b[0m`,
blue: (s) => `\x1b[34m${s}\x1b[0m`,
magenta: (s) => `\x1b[35m${s}\x1b[0m`,
bold: (s) => `\x1b[1m${s}\x1b[0m`,
dim: (s) => `\x1b[2m${s}\x1b[0m`,
reset: '\x1b[0m'
};
module.exports = { color };
+49
View File
@@ -0,0 +1,49 @@
const { color } = require('./colors');
/**
* Progress indicators and user feedback utilities
*/
class Progress {
static spinner = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
static current = 0;
static interval = null;
static start(message) {
process.stdout.write(`${message} ${this.spinner[0]}`);
this.interval = setInterval(() => {
this.current = (this.current + 1) % this.spinner.length;
process.stdout.write(`\r${message} ${this.spinner[this.current]}`);
}, 100);
}
static stop(finalMessage = '') {
if (this.interval) {
clearInterval(this.interval);
this.interval = null;
}
process.stdout.write(`\r${finalMessage}\n`);
}
static success(message) {
console.log(`${color.green('✓')} ${message}`);
}
static warning(message) {
console.log(`${color.yellow('⚠')} ${message}`);
}
static error(message) {
console.log(`${color.red('✗')} ${message}`);
}
static info(message) {
console.log(`${color.cyan('')} ${message}`);
}
static step(step, total, message) {
const progress = `[${step}/${total}]`;
console.log(`${color.dim(progress)} ${message}`);
}
}
module.exports = { Progress };