Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/danielroe/goff. Sync GitHub issues offline into a local folder
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233import process from 'node:process'
import { defineCommand } from 'citty'import consola from 'consola'
import { fetchUser } from '../api'import { setToken } from '../auth'
export const auth = defineCommand({ meta: { description: 'Authenticate with GitHub, which may be needed for syncing larger repositories.', }, args: { token: { type: 'string', required: true, description: 'A GitHub token with read permissions. You can generate one at `https://github.com/settings/tokens/new`.', }, }, async run({ args }) { // TODO: authentication flow with GitHub setToken(args.token) try { await fetchUser() consola.success('Authenticated with GitHub.') } catch { consola.error('Failed to authenticate with GitHub. Please check your token and try again.') process.exit(1) } },})