UNPKG

@puls-atlas/cli

Version:

The Puls Atlas CLI tool for managing Atlas projects

16 lines 1.69 kB
import handlers from './index.js'; import hooks from '../../hooks/index.js'; import { configureServiceDeployCommand } from '../deploy/serviceCommand.js'; const registerServiceCommands = (program, { withEnvironmentOptions }, dependencies = {}) => { const commandHandlers = dependencies.handlers ?? handlers; const commandHooks = dependencies.hooks ?? hooks; const service = program.command('service').description('Atlas service lifecycle commands.'); withEnvironmentOptions(configureServiceDeployCommand(service.command('deploy <serviceName>'), (serviceName, commandOptions) => commandHandlers.deploy(serviceName, commandOptions))).hook('preAction', commandHooks.versionCheck); withEnvironmentOptions(service.command('describe <serviceName>').description('Describe an Atlas runtime service, including its current and available catalog versions.').option('--limit <count>', 'Number of catalog versions to show.', '10')).action((serviceName, commandOptions) => commandHandlers.describe(serviceName, commandOptions)).hook('preAction', commandHooks.versionCheck); withEnvironmentOptions(service.command('destroy <serviceName>').description('Destroy an Atlas runtime Cloud Run service and remove its runtime config binding.')).action(commandHandlers.destroy).hook('preAction', commandHooks.versionCheck); withEnvironmentOptions(service.command('verify').description('Verify Atlas service desired-state, catalog metadata, and runtime Cloud Run drift for the selected project.').option('--local-only', 'Skip remote Cloud Run digest checks.')).action(commandHandlers.verify).hook('preAction', commandHooks.versionCheck); return service; }; export default registerServiceCommands;