2025-10-28 13:05:42 +00:00
|
|
|
#!/usr/bin/env -S deno run --allow-all
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Onebox - Self-hosted container platform
|
|
|
|
|
*
|
|
|
|
|
* Entry point for the Onebox CLI and daemon.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { runCli } from './ts/index.ts';
|
2025-11-25 08:25:54 +00:00
|
|
|
import { getErrorMessage } from './ts/utils/error.ts';
|
2025-10-28 13:05:42 +00:00
|
|
|
|
|
|
|
|
if (import.meta.main) {
|
|
|
|
|
try {
|
|
|
|
|
await runCli();
|
|
|
|
|
} catch (error) {
|
2025-11-25 08:25:54 +00:00
|
|
|
console.error(`Error: ${getErrorMessage(error)}`);
|
|
|
|
|
if (Deno.args.includes('--debug') && error instanceof Error) {
|
2025-10-28 13:05:42 +00:00
|
|
|
console.error(error.stack);
|
|
|
|
|
}
|
|
|
|
|
Deno.exit(1);
|
|
|
|
|
}
|
|
|
|
|
}
|