`--xl` option does not work with templates

Open Beginner friendly
#1,296 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
cli

Research direction

Start by running the two commands in the reproduction and trace how the CLI handles --xl for a saved template versus an arbitrary prompt. Check the option and template-processing entry points, then verify that the last fenced SVG code block is extracted when using --template pelican --xl without changing the arbitrary-prompt behavior.

Written by the indexing model from the issue text.

Description

The --xl flag should extract the last fenced code block in the LLM response, and it does this successfully when used with an arbitrary prompt. It does not, however, work when used with a prompt template.

Reproduction

llm "Create an SVG of a pelican riding a bicycle." --save pelican
llm --template pelican --xl

The option flag should cause the SVG code block to be extracted from the markdown response, but instead the entire response is printed, and the option flag is ignored.

Dominant language
Python
Stars
12.5k
Forks
998
Avg merge
8d 1h
Merged PRs (30d)
12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from simonw/llm

All issues in simonw/llm

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.