2023-01-17 01:31:46 +01:00
|
|
|
import { Command, CommandRunner } from 'nest-commander';
|
2024-03-20 19:32:04 +01:00
|
|
|
import { UserService } from 'src/domain/user/user.service';
|
|
|
|
import { CLI_USER } from 'src/immich-admin/constants';
|
2023-01-17 01:31:46 +01:00
|
|
|
|
|
|
|
@Command({
|
|
|
|
name: 'list-users',
|
|
|
|
description: 'List Immich users',
|
|
|
|
})
|
|
|
|
export class ListUsersCommand extends CommandRunner {
|
|
|
|
constructor(private userService: UserService) {
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
|
|
|
|
async run(): Promise<void> {
|
|
|
|
try {
|
2023-08-03 20:17:38 +02:00
|
|
|
const users = await this.userService.getAll(CLI_USER, true);
|
2023-01-17 01:31:46 +01:00
|
|
|
console.dir(users);
|
|
|
|
} catch (error) {
|
|
|
|
console.error(error);
|
|
|
|
console.error('Unable to load users');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|