Something went wrong. Try again.
standard.site frontend
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475import 'dart:io';
import 'package:args/args.dart';
import 'commands.dart';
const String _usage = '''Usage: vibecode <command> [options]
Commands: init Create the site.standard.publication record publish <path> Publish a Markdown file to ATProto unpublish <path> Delete a document record by path list List published documents sync Publish all Markdown files under content/
Options: -h, --help Show this help message''';
Future<void> runCli(List<String> args) async { final parser = ArgParser() ..addFlag('help', abbr: 'h', negatable: false, help: 'Show help');
late final ArgResults results; try { results = parser.parse(args); } on FormatException catch (e) { stderr.writeln('Error: ${e.message}'); stderr.writeln(_usage); exit(64); }
if (results['help'] as bool) { print(_usage); return; }
final commandArgs = results.rest; if (commandArgs.isEmpty) { stderr.writeln('Error: no command provided'); stderr.writeln(_usage); exit(64); }
final command = commandArgs.first; final positional = commandArgs.sublist(1); final basePath = Directory.current.path;
switch (command) { case 'init': await initPublication(basePath); case 'publish': if (positional.isEmpty) { stderr.writeln('Error: publish requires a file path'); exit(64); } await publishFile(positional.first, basePath); case 'unpublish': if (positional.isEmpty) { stderr.writeln('Error: unpublish requires a path'); exit(64); } await unpublishPath(positional.first, basePath); case 'list': await listDocuments(basePath); case 'sync': await syncContent(basePath); default: stderr.writeln('Error: unknown command "$command"'); stderr.writeln(_usage); exit(64); }}