Skip to content

Commit fab88cb

Browse files
authored
Merge pull request #585 from underctrl-io/expose-cli-api
feat: expose programmatic access to the cli api
2 parents 2548b79 + dd57330 commit fab88cb

File tree

18 files changed

+335
-169
lines changed

18 files changed

+335
-169
lines changed

apps/test-bot/commandkit.config.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ import { i18n } from '@commandkit/i18n';
33
import { devtools } from '@commandkit/devtools';
44
import { cache } from '@commandkit/cache';
55
import { ai } from '@commandkit/ai';
6-
import { tasks } from '@commandkit/tasks';
6+
import { tasks, setDriver } from '@commandkit/tasks';
7+
import { BullMQDriver } from '@commandkit/tasks/bullmq';
78

8-
const setup = noBuildOnly(() => {
9-
setInterval(() => {
10-
console.log(`Hello from ${process.pid}`);
11-
}, 1000);
12-
});
13-
14-
setup();
9+
noBuildOnly(() => {
10+
setDriver(
11+
new BullMQDriver({
12+
maxRetriesPerRequest: null,
13+
}),
14+
);
15+
})();
1516

1617
export default defineConfig({
1718
plugins: [
@@ -20,8 +21,7 @@ export default defineConfig({
2021
cache(),
2122
ai(),
2223
tasks({
23-
initializeDefaultDriver: true,
24-
sqliteDriverDatabasePath: './tasks.db',
24+
initializeDefaultDriver: false,
2525
}),
2626
],
2727
});

apps/test-bot/src/ai.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { createGoogleGenerativeAI } from '@ai-sdk/google';
22
import { configureAI } from '@commandkit/ai';
3-
import { Logger } from 'commandkit';
43

54
const google = createGoogleGenerativeAI({
65
apiKey: process.env.GOOGLE_API_KEY,

apps/test-bot/src/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ commandkit.setPrefixResolver((message) => {
2525
];
2626
});
2727

28-
console.dir({ importedConfig: config }, { depth: null });
28+
Logger.info`Imported JSON file: ${config}`;
2929

3030
export default client;

apps/test-bot/src/commands/old/legacy-autocomplete.ts

Lines changed: 0 additions & 53 deletions
This file was deleted.

apps/test-bot/src/commands/old/legacy-content.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

apps/test-bot/src/commands/old/legacy.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

apps/test-bot/src/events/clientReady/test.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

apps/test-bot/src/events/guildMemberAdd/guildMemberAdd.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

apps/test-bot/src/events/messageCreate/01-log.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

apps/test-bot/src/events/messageCreate/02-log.ts

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)