Skip to content

feat(cli): support MARKITDOWN_CU_ENDPOINT / MARKITDOWN_DOCINTEL_ENDPOINT - #2358

Merged
Adam Fourney (afourney) merged 3 commits into
microsoft:mainfrom
seenws:fix/2326-endpoint-end-vars
Sep 1, 2026
Merged

Adam Fourney (afourney) merged 3 commits into
microsoft:mainfrom
seenws:fix/2326-endpoint-end-vars

Conversation

@seenws

@seenws Sinan Olsson-Pasic (seenws) commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2326.

--cu-endpoint and -e/--endpoint now fall back to MARKITDOWN_CU_ENDPOINT and
MARKITDOWN_DOCINTEL_ENDPOINT, matching how AZURE_API_KEY is already read from
the environment. This lets the operator configure the endpoint at deploy time
instead of every caller passing it on the command line.

  • Explicit flags still take precedence over the environment.
  • An empty variable is treated as unset, so it cannot reach Azure as "".
  • Both "endpoint is required" errors now name the flag and the variable.
  • README documents both.

Tests: TestEndpointEnvVars in packages/markitdown/tests/test_cu_converter.py

…CINTEL_ENDPOINT. Lets an operator configure the Azure endpoint once in the environment, so callers only need --use-cu or -d. Explicit flags still take precedence, and an empty variable is treated as unser. Fixes microsoft#2326.
@seenws

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

packages/markitdown/src/markitdown/main.py:222

  • The adjacent literals concatenate without whitespace, producing --use-cu.Pass --cu-endpoint... in the error output. Add a separating space.
                "Content Understanding Endpoint (--cu-endpoint) is required when using --use-cu."
                "Pass --cu-endpoint or set MARKITDOWN_CU_ENDPOINT."

Comment thread packages/markitdown/src/markitdown/__main__.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@afourney
Adam Fourney (afourney) merged commit f618f47 into microsoft:main Sep 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support MARKITDOWN_CU_ENDPOINT / MARKITDOWN_DOCINTEL_ENDPOINT env vars so the endpoint is operator-configured, not caller-supplied

3 participants