mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
feat(cli): list users (#1341)
This commit is contained in:
23
server/apps/cli/src/commands/list-users.command.ts
Normal file
23
server/apps/cli/src/commands/list-users.command.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { UserService } from '@app/domain';
|
||||
import { Command, CommandRunner } from 'nest-commander';
|
||||
import { CLI_USER } from '../constants';
|
||||
|
||||
@Command({
|
||||
name: 'list-users',
|
||||
description: 'List Immich users',
|
||||
})
|
||||
export class ListUsersCommand extends CommandRunner {
|
||||
constructor(private userService: UserService) {
|
||||
super();
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
try {
|
||||
const users = await this.userService.getAllUsers(CLI_USER, true);
|
||||
console.dir(users);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
console.error('Unable to load users');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user