Files
winos-config/src/bin.ts
2025-12-01 00:11:55 -05:00

32 lines
850 B
TypeScript

import { Command } from '@effect/cli';
import { BunContext, BunRuntime } from '@effect/platform-bun';
import { Effect } from 'effect';
import pkg from '../package.json' with { type: 'json' };
const diffCommand = Command.make('diff', {}, () =>
Effect.gen(function* () {
yield* Effect.log('diff');
yield* Effect.log('diff2');
}),
);
const applyCommand = Command.make('apply', {}, () =>
Effect.gen(function* () {
yield* Effect.log('apply');
yield* Effect.log('apply2');
}),
);
const cliName = 'winos-config';
const app = Command.make(cliName, {}).pipe(
Command.withDescription('NixOS-like tool for windows'),
Command.withSubcommands([diffCommand, applyCommand]),
);
const cli = Command.run(app, {
name: cliName,
version: pkg.version,
});
cli(process.argv).pipe(Effect.provide(BunContext.layer), BunRuntime.runMain);