How to use the clipanion.Cli function in clipanion

To help you get started, we’ve selected a few clipanion examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yarnpkg / berry / packages / yarnpkg-builder / sources / cli.ts View on Github external
#!/usr/bin/env node

import {Cli}              from 'clipanion';

import BuildBundleCommand from './commands/build/bundle';
import BuildPluginCommand from './commands/build/plugin';
import HelpCommand        from './commands/help';
import NewPluginCommand   from './commands/new/plugin';

const cli = new Cli({
  binaryName: `yarn builder`,
});

cli.register(NewPluginCommand);
cli.register(BuildBundleCommand);
cli.register(BuildPluginCommand);
cli.register(HelpCommand);

cli.runExit(process.argv.slice(2), {
  stdin: process.stdin,
  stdout: process.stdout,
  stderr: process.stderr,
});
github yarnpkg / berry / packages / yarnpkg-check / sources / cli.ts View on Github external
} catch {}

          progress.tick();
        }
      } catch (error) {
        reportedProgress.stop();
        throw error;
      }

      report.reportSeparator();
      await reportedProgress;
    });
  }
}

const cli = new Cli({binaryName: `yarn dlx @yarnpkg/check`});
cli.register(EntryCommand);
cli.runExit(process.argv.slice(2), {
  stdin: process.stdin,
  stdout: process.stdout,
  stderr: process.stderr,
});
github yarnpkg / berry / packages / yarnpkg-cli / sources / main.ts View on Github external
async function run(): Promise {
    const cli = new Cli({
      binaryLabel: `Yarn Package Manager`,
      binaryName: `yarn`,
      binaryVersion,
    });

    try {
      await exec(cli);
    } catch (error) {
      process.stdout.write(cli.error(error));
      process.exitCode = 1;
    }
  }

clipanion

Type-safe CLI library / framework with no runtime dependencies

MIT
Latest version published 2 months ago

Package Health Score

83 / 100
Full package analysis