Install the resume-cli tool
masterInstall the JSON Resume command-line tool globally using npm.
npm install -g resume-clirepository·master·Indexed 26 days ago
https://github.com/jsonresume/resume-cliThe command-line interface for JSON Resume, an open-source standard for creating resumes in JSON format. Version 3.1.2 allows users to initialize, validate, and preview resumes locally, as well as export them to HTML and PDF formats using themes. It supports multiple input formats including JSON and YAML, and includes a local development server with live reloading.
Install the JSON Resume command-line tool globally using npm.
npm install -g resume-cliThe CLI supports several ways to provide resume data using the --resume flag:
--resume <path>: Reads resume data from the specified file path.--resume -: Reads resume data from standard input (STDIN). Defaults --type to application/json.--resume is unset, the CLI looks for resume.json in the current working directory.--resume points to a directory, the path is passed to quaff to generate JSON from various formats (including JS modules).The CLI accepts the following input formats and MIME types:
Formats:
json: via JSON.parse.yaml: via yaml-js.quaff: via directory processing.MIME Types:
application/jsontext/yamlUse resume export [fileName] to generate a stylized version of your resume.
Note: You must npm install any theme you wish to use before attempting to export with it.
Options:
--format <file type>: Specify the output format (e.g., --format pdf).--theme <name>: Specify the theme name (e.g., --theme even).resume validate to check your resume.json against the JSON Resume schema. This command identifies compliance issues and helps locate errors in your data structure.resume validateRun resume serve to start a web server at http://localhost:4000/. This is useful for visualizing changes to your resume.json in real-time via live reloading.
Options:
--port <port>: Specify a custom port.--theme <name>: Specify the theme to use.Theme Development:
To develop or test a local theme, change into your theme directory and run:
resume serve --theme .
resume init to create a new resume.json file in your current working directory. You can then edit this file using your preferred text editor. Ensure you follow the official JSON Resume schema.resume initThe export logic supports generating resumes in .html and .pdf formats.
Supported Formats:
.html.pdfEnvironment Variables:
RESUME_PUPPETEER_NO_SANDBOX: If set, the --no-sandbox flag is passed to Puppeteer, which can be useful in certain containerized or restricted environments.The serve functionality (used via the CLI) starts a local web server to preview your rendered resume. It uses browser-sync to watch your resume data file for changes; when the file is saved, the resume is automatically rebuilt and the browser is reloaded.
Key behaviors:
resumeFilename and triggers a rebuild/reload on change.index.html within the specified dir.silent flag is set.The resume command accepts several global options that can be used across different commands like export, serve, and validate.
| Flag | Long Flag | Description |
|---|---|---|
-F, --force | --force | Bypasses schema testing (used by publish and export). |
-t, --theme <theme name> | --theme <theme name> | Specify a theme name (e.g., elegant) or a path starting with . (e.g., ./my-theme). Defaults to jsonresume-theme-elegant. |
-f, --format <ext> | --format <ext> | Specify the file type extension (used by export). |
-r, --resume <path> | --resume <path> | Path to the resume JSON file. Use - to read from stdin. Defaults to resume.json. |
-p, --port <port> | --port <port> | Port for the serve command. Defaults to 4000. |
-s, --silent | --silent | Tells serve whether to auto-open the browser. |
-d, --dir <path> | --dir <path> | Indicates a public directory path for serve. Defaults to public. |
--schema <path> | --schema <path> | Path to a custom schema for validate. |
When exporting to PDF, the process can be customized using options defined within the theme package. The exporter looks for the following properties in the theme's index.js:
pdfViewport: An object used to set the Puppeteer page viewport.pdfRenderOptions: An object containing options passed directly to Puppeteer's page.pdf() method.pdfRenderOptions.mediaType: Determines the media type used for emulation (defaults to 'screen' if not provided).page.pdf() options can be included in this object.export command to generate a local file. You can specify a filename as an argument and use the --format flag to choose the output format (e.g., html or pdf).