gaunt-sloth-assistant
Version:
> ⚠️ **`gaunt-sloth-assistant` has been renamed to [`gaunt-sloth`](https://www.npmjs.com/package/gaunt-sloth).** > The `1.5.x` series is the final release under the old name — active development continues under > the new package. To switch: > > ```bash >
25 lines • 1.12 kB
JavaScript
import { initConfig } from '@gaunt-sloth/core/config.js';
import { displayError } from '@gaunt-sloth/core/utils/consoleUtils.js';
import { setExitCode } from '@gaunt-sloth/core/utils/systemUtils.js';
export function apiCommand(program, commandLineConfigOverrides) {
const api = program.command('api').description('Start an API server for Gaunt Sloth');
api
.command('ag-ui')
.description('Start an AG-UI protocol HTTP server')
.option('--port <port>', 'Port to listen on')
.action(async (options) => {
try {
const config = await initConfig(commandLineConfigOverrides);
const port = options.port
? parseInt(options.port, 10)
: (config.commands?.api?.port ?? 3000);
const { startAgUiServer } = await import('@gaunt-sloth/api/modules/apiAgUiModule.js');
await startAgUiServer(config, port);
}
catch (error) {
displayError(error instanceof Error ? error.message : String(error));
setExitCode(1);
}
});
}
//# sourceMappingURL=apiCommand.js.map