YAMLResume

CLI

YAMLResume adopts a mono-repo structure, which means all packages are contained within a single repository. Thanks to pnpm workspace, this approach simplifies dependency management and versioning across packages.

At the time of writing, YAMLResume repo has two packages:

  • yamlresume/cli: the CLI interface for YAMLResume.
  • yamlresume/core: contains the core engine for YAMLResume. It handles parsing, validating, and rendering resumes based on the official schema.

yamlresume/core build

yamlresume/cli depends on yamlresume/core to function properly. So when you want to test yamlresume/cli, you need to ensure that yamlresume/core is also built and available.

You can do this with the following commands:

# build for dev purpose
pnpm core build

# build for production, which will minify the output and generate TypeScript
# DTS files `.d.ts`
pnpm core build:prod

# watch for file changes and build automatically
pnpm core build:watch

yamlresume/cli build

Once yamlresume/core is built, you can run the CLI commands in two ways:

  1. build yamlresume/cli local and run node.js with dist/cli.js:
pnpm cli build
node packages/cli/dist/cli.js <command> [options]
  1. run yamlresume/cli directly with the help of tsx:
pnpm cli dev <command> [options]

# this command will translate to
# tsx src/cli.ts

Demo

yamlresume/core build:

$ pnpm core build

> @yamlresume/yamlresume@0.7.1 core /Users/hanyu/work/yamlresume/yamlresume
> pnpm --filter @yamlresume/core build

> @yamlresume/core@0.7.1 build /Users/hanyu/work/yamlresume/yamlresume/packages/core
> tsup

CLI Building entry: src/index.ts
CLI Using tsconfig: tsconfig.json
CLI tsup v8.4.0
CLI Using tsup config: /Users/hanyu/work/yamlresume/yamlresume/packages/core/tsup.config.ts
CLI Target: esnext
CLI Cleaning output folder
ESM Build start
ESM dist/index.js 160.91 KB
ESM ⚡️ Build success in 111ms

yamlresume/cli build:

$ pnpm cli build

> @yamlresume/yamlresume@0.7.1 cli /Users/hanyu/work/yamlresume/yamlresume
> pnpm --filter yamlresume build

> yamlresume@0.7.1 build /Users/hanyu/work/yamlresume/yamlresume/packages/cli
> tsup

CLI Building entry: src/cli.ts
CLI Using tsconfig: tsconfig.json
CLI tsup v8.4.0
CLI Using tsup config: /Users/hanyu/work/yamlresume/yamlresume/packages/cli/tsup.config.ts
CLI Target: esnext
CLI Cleaning output folder
ESM Build start
ESM dist/cli.js 11.36 KB
ESM ⚡️ Build success in 42ms

Test yamlresume/cli with tsx by pnpm cli dev:

$ pnpm cli dev help

> @yamlresume/yamlresume@0.7.1 cli /Users/hanyu/work/yamlresume/yamlresume
> pnpm --filter yamlresume dev help

> yamlresume@0.7.1 dev /Users/hanyu/work/yamlresume/yamlresume/packages/cli
> tsx src/cli.ts help

Usage: yamlresume [options] [command]

YAMLResume — Resume as Code in YAML

 __   __ _    __  __ _     ____
 \ \ / // \  |  \/  | |   |  _ \ ___  ___ _   _ ___  ___   ___
  \ V // _ \ | |\/| | |   | |_) / _ \/ __| | | / _ \/ _ \ / _ \
   | |/ ___ \| |  | | |___|  _ <  __/\__ \ |_| | | | | | |  __/
   |_/_/   \_\_|  |_|_____|_| \_\___||___/\____|_| |_| |_|\___|


Options:
  -V, --version                  output the version number
  -v, --verbose                  verbose output
  -h, --help                     display help for command

Commands:
  new [filename]                 create a new resume
  build [options] <resume-path>  build a resume to LaTeX and PDF
  dev [options] <resume-path>    build on file changes (watch mode)
  languages                      i18n and l10n support
  templates                      manage resume templates
  validate <resume-path>         validate a resume against the YAMLResume schema
  help [command]                 display help for command

Test yamlresume/cli with Node.js:

$ node packages/cli/dist/cli.js -V
0.7.1
Edit on GitHub

Last updated on