@puls-atlas/cli
Version:
The Puls Atlas CLI tool for managing Atlas projects
11 lines • 1.01 kB
JavaScript
import handlers from './index.js';
import { DEFAULT_DEVELOPER_TOKEN_EXPIRES_IN } from './printDeveloperToken.js';
import hooks from '../../hooks/index.js';
const registerAuthCommands = program => {
const auth = program.command('auth').description('Authentication commands.');
auth.command('print-developer-token <email>').description('Generate a developer token for local development.').option('--expires-in <duration>', 'JWT lifetime for the generated developer token.', DEFAULT_DEVELOPER_TOKEN_EXPIRES_IN).option('--write-env <path>', 'Write the login and token to an env file instead of printing them to stdout.').action(handlers.printDeveloperToken).hook('preAction', hooks.npmAuth);
auth.command('npm').description('Authenticate with Google Cloud Artifact Registry to access private npm packages.').action(handlers.npm);
auth.command('composer').description('Authenticate with Composer to access private PHP packages.').action(handlers.composer);
return auth;
};
export default registerAuthCommands;