1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-08 12:56:48 +01:00
immich/server/src/commands/list-users.command.ts

23 lines
528 B
TypeScript
Raw Normal View History

2023-01-17 01:31:46 +01:00
import { Command, CommandRunner } from 'nest-commander';
2024-05-22 22:23:47 +02:00
import { CliService } from 'src/services/cli.service';
2023-01-17 01:31:46 +01:00
@Command({
name: 'list-users',
description: 'List Immich users',
})
export class ListUsersCommand extends CommandRunner {
2024-05-22 22:23:47 +02:00
constructor(private service: CliService) {
2023-01-17 01:31:46 +01:00
super();
}
async run(): Promise<void> {
try {
2024-05-22 22:23:47 +02:00
const users = await this.service.listUsers();
2023-01-17 01:31:46 +01:00
console.dir(users);
} catch (error) {
console.error(error);
console.error('Unable to load users');
}
}
}