mirror of
https://github.com/immich-app/immich.git
synced 2025-01-07 20:36:48 +01:00
22 lines
528 B
TypeScript
22 lines
528 B
TypeScript
import { Command, CommandRunner } from 'nest-commander';
|
|
import { CliService } from 'src/services/cli.service';
|
|
|
|
@Command({
|
|
name: 'list-users',
|
|
description: 'List Immich users',
|
|
})
|
|
export class ListUsersCommand extends CommandRunner {
|
|
constructor(private service: CliService) {
|
|
super();
|
|
}
|
|
|
|
async run(): Promise<void> {
|
|
try {
|
|
const users = await this.service.listUsers();
|
|
console.dir(users);
|
|
} catch (error) {
|
|
console.error(error);
|
|
console.error('Unable to load users');
|
|
}
|
|
}
|
|
}
|