Initial commit: kisync CLI client for KIS API Builder

CLI tool for syncing local folders with KIS API Builder server.
Commands: init, pull, push, status with conflict detection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-14 16:19:48 +03:00
commit 4c54bfff26
13 changed files with 1882 additions and 0 deletions

67
src/index.ts Normal file
View File

@@ -0,0 +1,67 @@
#!/usr/bin/env node
import { Command } from 'commander';
import chalk from 'chalk';
import { initCommand } from './commands/init';
import { pullCommand } from './commands/pull';
import { pushCommand } from './commands/push';
import { statusCommand } from './commands/status';
const program = new Command();
program
.name('kisync')
.description('CLI tool for syncing local folders with KIS API Builder')
.version('1.0.0');
program
.command('init')
.description('Initialize a new kisync project in the current directory')
.action(async () => {
try {
await initCommand();
} catch (err: any) {
console.error(chalk.red(`Error: ${err.message}`));
process.exit(1);
}
});
program
.command('pull')
.description('Download all endpoints from server to local files')
.option('--force', 'Overwrite local changes without prompting')
.action(async (opts) => {
try {
await pullCommand(opts.force);
} catch (err: any) {
console.error(chalk.red(`Error: ${err.message}`));
process.exit(1);
}
});
program
.command('push')
.description('Upload local changes to server')
.option('--force', 'Force push, overwriting server changes')
.action(async (opts) => {
try {
await pushCommand(opts.force);
} catch (err: any) {
console.error(chalk.red(`Error: ${err.message}`));
process.exit(1);
}
});
program
.command('status')
.description('Show sync status — what changed locally and on server')
.action(async () => {
try {
await statusCommand();
} catch (err: any) {
console.error(chalk.red(`Error: ${err.message}`));
process.exit(1);
}
});
program.parse();