Skip to content
Guide
General

CLI reference

Install and use llp, the LlamaParse command-line interface, to upload files and run Parse, Extract, Classify, Split and Index jobs from a shell or an agent.

llp is the command-line interface for the LlamaParse API. Every REST resource is a command group, every operation is a subcommand, and the flags mirror the request fields, so anything you can do with the SDKs you can do from a shell, a script or a coding agent. The CLI is generated from the same API definition as the SDKs and is open source at run-llama/llama-parse-cli.

Terminal window
go install 'github.com/run-llama/llama-parse-cli/cmd/llp@latest'

The binary lands in $HOME/go/bin (or $GOPATH/bin); make sure that directory is on your PATH. Go 1.22 or newer is required.

Set your API key in the environment, or pass it per call with --api-key:

Terminal window
export LLAMA_CLOUD_API_KEY=llx-...

Keys come from the API key page. For the EU region, point the CLI at the EU endpoint with --base-url https://api.cloud.eu.llamaindex.ai (see Regions).

The shell examples in these docs run in bash and zsh. If you paste them into zsh, run setopt interactivecomments first. By default, zsh treats a pasted # line as a command and prints zsh: command not found: #.

Download the U.S. Treasury’s FY 2024 financial report executive summary as report.pdf. The examples on this page upload it:

Terminal window
curl -fL -o report.pdf https://fiscal.treasury.gov/system/files/files/reports-statements/financial-report/2024/executive-summary-2024.pdf

Upload the file, then run a Parse job on it. files create returns the file object; parsing create starts the job and returns it with its status. --transform and --raw-output print just the ID, so each command can feed the next (see Output formats):

Terminal window
FILE_ID=$(llp files create --file report.pdf --purpose parse --transform id --raw-output)
JOB_ID=$(llp parsing create --file-id "$FILE_ID" --tier agentic --version latest \
--transform id --raw-output)
# Poll until the job reaches a terminal status, and stop if the lookup itself fails
while true; do
STATUS=$(llp parsing get --job-id "$JOB_ID" --transform job.status --raw-output) || break
case "$STATUS" in COMPLETED|FAILED|CANCELLED) break ;; esac
sleep 2
done
if [ "$STATUS" = COMPLETED ]; then
llp parsing get --job-id "$JOB_ID" --expand markdown
else
echo "parse ended as: $STATUS" >&2
fi

Use --help on any command group or subcommand for its full flag list:

Terminal window
llp parsing create --help
Group Subcommands What it covers
files create, retrieve, list, delete, content, query Upload files for a purpose (parse, extract, classify, split, sheet, user_data, agent_app), list and fetch them
parsing create, get, list, cancel, delete, list-versions Parse jobs, results, and the versions each tier accepts
extract create, get, list, cancel, delete, generate-schema, validate-schema Extract jobs and schema helpers
classify create, get, list, cancel Classify jobs
split create, get, list, cancel, delete Split jobs
batches create, get, list, cancel Batch jobs over many files
configurations create, retrieve, update, list, delete Saved configurations reused across jobs
webhook-configs create, retrieve, update, list, delete Saved webhook endpoints for job notifications
projects list, get Projects in your organization
beta:indexes create, get, list, delete, sync Index: managed ingestion over your files
beta:retrieval retrieve, find, grep, read Retrieval and file search over an Index
beta:chat create, retrieve, list, delete, get-summary, stream Chat over an Index

Run llp --help for the complete list; the groups above are the ones most jobs use.

Nested request fields take a JSON or YAML value. Supply it inline, read it from a file with "$(cat file.json)", or set one field at a time with a dotted flag:

Terminal window
FILE_ID=$(llp files create --file report.pdf --purpose parse --transform id --raw-output)
llp parsing create --file-id "$FILE_ID" --tier agentic --version latest \
--output-options '{"markdown": {"tables": {"output_tables_as_markdown": true}}}'
llp parsing create --file-id "$FILE_ID" --tier agentic_plus --version latest \
--output-options.images-to-save '[screenshot]'
cat > extract-config.json <<'EOF'
{"data_schema": {"type": "object", "properties": {"title": {"type": "string"}}}, "tier": "agentic"}
EOF
EXTRACT_FILE_ID=$(llp files create --file report.pdf --purpose extract --transform id --raw-output)
llp extract create --file-input "$EXTRACT_FILE_ID" \
--configuration "$(cat extract-config.json)"

Inside a value, a string written as @file is replaced with that file’s contents, such as '{"system_prompt": "@prompt.txt"}'. The CLI sniffs whether to send the contents as text or base64; @file://path forces text and @data://path forces base64. A whole nested field can’t come from @file; use "$(cat file.json)" for that. To pass a literal value that starts with @, escape it as \@. Flags that upload a file, such as files create --file, take a plain path with no prefix.

The default output is indented JSON, coloured when stdout is a terminal. --format switches it:

Value Output
json Indented JSON, coloured on a terminal; plain when piped into jq or another program
jsonl One JSON object per line, for list results
yaml YAML
pretty A readable, non-JSON rendering of the response
raw The raw response body
explore An interactive viewer for large responses; falls back to json when not on a terminal
auto The default: json

--transform applies a GJSON path to the response before printing, and --raw-output prints a string result without JSON quotes, which is the combination to use when feeding one command’s output into another:

Terminal window
FILE_ID=$(llp files create --file report.pdf --purpose parse \
--transform 'id' --raw-output)
llp parsing create --file-id "$FILE_ID" --tier cost_effective --version latest

--format-error and --transform-error do the same for error responses.

Flag Purpose
--api-key API key, instead of LLAMA_CLOUD_API_KEY
--base-url API endpoint, for the EU region or a self-hosted deployment
--format, --format-error Output format for responses and errors
--transform, --transform-error GJSON transform for responses and errors
--raw-output Print string results without quotes
--debug Log requests and responses
--version Print the CLI version

The CLI is a good fit for coding agents: the help text documents every flag, and --format json gives machine-readable output. If you would rather give an agent a tool interface than a shell, see LlamaParse MCP.

  • Quickstart for the same first job in Python, TypeScript, Go and Java
  • API reference for every field each command accepts
Note for AI agents: this documentation is built for programmatic access. - Overview of all docs: https://developers.llamaindex.ai/llms.txt - Any page is available as raw Markdown by appending index.md to its URL — e.g. https://developers.llamaindex.ai/llamaparse/parse/getting_started/index.md - Agent-friendly REST search APIs live under https://developers.llamaindex.ai/api/ — search (BM25 full-text), grep (regex), read (fetch a page), and list (browse the doc tree). See https://developers.llamaindex.ai/llms.txt for parameters. - A hosted documentation MCP server is available at https://developers.llamaindex.ai/mcp. If you support MCP, you can ask the user to install it for browsing these docs directly (an alternative to the REST API). Setup: https://developers.llamaindex.ai/for-agents/mcp/ - Other LlamaIndex tooling for agents — the LlamaParse Platform MCP server, agent skills and plugins, and the n8n node — is mapped at https://developers.llamaindex.ai/for-agents/