simonw / simonw/llm

Trouble embedding multiple files [Windows]

Open
#277 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
12.5k
Forks
998
Avg merge
3d 13h
Merged PRs (30d)
10

Description

I have a folder docs with a few .txt files in it. (a.txt, b.txt, c.txt)

When I run llm embed-multi text_collection --files docs 'docs/*.txt' (with the wildcards quoted)
it works as expected on Linux but not on Windows.

On windows I get an error message:

Error: Got unexpected extra arguments (b.txt c.txt)

It seems that click on Windows is expanding the wildcards before passing the arguments to the embed_multi function.

On PowerShell you can escape a single character using backtick. This doesn't help in this case, the wildcard is still expanded.

I looked at using click.UNPROCESSED but I think it would require the UI to change:

llm embed-multi text_collection --files docs --glob "docs/*.txt"

(with the 'glob' argument click.UNPROCESSED).

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.

Research direction

Start at the embed_multi command entry point and reproduce the quoted wildcard command on Windows and Linux. Trace how the --files argument reaches embed_multi, then verify that the Windows invocation handles multiple matched files without reporting unexpected extra arguments while preserving the existing Linux behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.