Import
The `yamlresume ai import` command turns one or more resume images into a YAMLResume file with a vision-capable model.
The yamlresume ai import command imports a resume from one or more images
into a YAMLResume file. It is handy when all you have is a screenshot, a scan,
or exported pages of an existing resume.
$ yamlresume ai import --help
Usage: yamlresume ai import [options] <image-1.png> [image-2.png ...] <output>
import a resume from one or more images with AI
Arguments:
paths ordered image paths followed by the output resume
filename
Options:
-m, --model <model> AI provider model to use
-b, --base-url <url> AI provider base URL
-r, --retry <count> maximum retries when validation fails (default: 2)
-l, --language <language> locale language override
--no-layouts do not append the default layouts block
--no-comments do not inject YAML comments
-h, --help display help for command
Environment variables:
Required (one API key for the selected cloud provider):
DEEPSEEK_API_KEY DeepSeek API key
OPENAI_API_KEY OpenAI API key
MOONSHOT_API_KEY Kimi (Moonshot AI) API key
Optional:
OLLAMA_HOST Ollama host for local models
YAMLRESUME_AI_MODEL model override (overridden by --model)
YAMLRESUME_AI_BASE_URL API base URL override (overridden by --base-url)
Import notes:
Only image files are supported: .png, .jpg, .jpeg, .webp, .gif.
Pass image paths in page order, followed by the output resume filename:
yamlresume ai import page-01.png page-02.png resume.yml
A vision-capable model is required. Use --model to select one when the
provider default does not accept image input.Examples
Set a provider API key and import a single image. The last path is always the output resume filename:
$ export OPENAI_API_KEY=sk-...
$ yamlresume ai import screenshot.png resume.ymlFor a multi-page resume, pass the images in page order before the output:
$ yamlresume ai import page-01.png page-02.png page-03.png resume.ymlA real import: the input image and the same resume rebuilt from the imported
YAML with yamlresume build.


Only image files are supported: .png, .jpg, .jpeg, .webp, and .gif.
Each image and the combined input are limited to 20 MiB. PDF and DOCX import
are planned for a later phase.
The command does not overwrite an existing output file; choose a new output path or remove the old file first.
A vision-capable model is required. Use -m, --model to select one when the
provider default does not accept image input. See
Generate: Supported providers for the
available providers and their default models; you can also override the model
and base URL with the YAMLRESUME_AI_MODEL and YAMLRESUME_AI_BASE_URL
environment variables.
-l, --language
By default, the model detects the resume's locale language from the images.
Use -l, --language to override the detection and set
locale.language explicitly:
$ yamlresume ai import --language zh-hans page-01.png resume.yml--no-layouts and --no-comments
By default, the imported resume includes the default layouts block and
helpful YAML comments for editor/IDE schema validation, so you can build it
right away. Disable either with:
$ yamlresume ai import --no-layouts --no-comments screenshot.png resume.yml--retry
Import validates the generated YAML after each attempt. Structural failures — output that is not valid YAML or does not have the YAMLResume document shape — are fed back to the model and retried, up to 2 retries by default.
Use -r, --retry with a non-negative integer to change the limit:
$ yamlresume ai import --retry 5 screenshot.png resume.ymlThe retry count must be a non-negative safe integer. Negative numbers,
decimals, partial numeric strings such as 2x, and unsafe integers are
rejected. Use --retry 0 to fail on the first structural error without
retrying.
Validation and review
Import uses best-effort validation. It requires valid YAML with the YAMLResume document shape, but preserves missing fields and value-level schema issues so no source information is discarded. When the generated YAML still has schema issues, the command logs a warning instead of failing.
Run yamlresume validate afterward to identify and correct any remaining
issues before building:
$ yamlresume validate resume.ymlProgrammatic API
The @yamlresume/ai package
exposes the underlying import API. Pass multiple attachments to treat them as
pages of the same resume:
import { importResume } from "@yamlresume/ai";
import { openai } from "@ai-sdk/openai";
import { readFileSync } from "node:fs";
const model = openai("gpt-5");
const data = readFileSync("resume.png");
const yaml = await importResume(
{ attachments: [{ data, mediaType: "image/png" }] },
{
model,
// Optional: override locale detection
language: "en",
}
);When working with files in Node.js, @yamlresume/node
exposes importResumeFile, which accepts a single path or an ordered array of
paths and writes the imported resume to a new file.
Last updated on