This release is a pre-release and may not be stable for production use.
CU CLI
cu is the preview command-line interface for Azure Content Understanding in
Foundry Tools. Use it to provision the required Microsoft Foundry resource,
optionally deploy selected supported large language models (LLMs) and embeddings
models, configure Content Understanding defaults, analyze local files, manage
analyzers, and manage local configuration. Analyze inputs can also be supplied
as HTTPS or Azure Blob SAS URLs.
Content Understanding concepts
Content Understanding processes unstructured content, including documents, images, audio, and video, into structured output for automation, analytics, and search workflows. It is a Foundry Tool that you access through a Microsoft Foundry resource in Azure.
The Content Understanding documentation uses these terms:
- A file is the input. It can be a document, image, audio file, video, or other supported file type.
- An analyzer defines how Content Understanding processes a file and extracts content and structured fields.
- An analyzer result is the output from processing a file. It can include extracted Markdown content, structured fields, and modality-specific details.
- A prebuilt analyzer is a ready-to-use analyzer supplied by Content Understanding for common content extraction, search, and domain scenarios.
- A custom analyzer is an analyzer you define for your scenario. It uses a base analyzer for a content type and a field schema that describes the structured fields to extract.
CU CLI lets you configure a Microsoft Foundry resource, select an analyzer, submit local files or HTTPS URLs, and save analyzer results without calling the REST API directly.
Further reading:
Install
Requirements:
- Python 3.10 or later
- Azure CLI for login and resource discovery
- Azure Developer CLI only when using
cu infra generate
python -m pip install cu-cli
cu --version
cu --help
macOS includes an unrelated system command named cu. Use the equivalent
cu-cli executable on macOS:
cu-cli --help
Connect to Microsoft Foundry and check setup
You need a Microsoft Foundry resource endpoint. LLM-based prebuilt analyzers and custom analyzers also need supported LLM and embeddings deployments plus Content Understanding defaults. If any of these are missing, follow the complete Microsoft Foundry provisioning guide.
A CU CLI profile is local configuration for one Microsoft Foundry resource. It
stores the endpoint, authentication method, API version, and optional model
deployment mappings; it is not an Azure resource. For a ready resource,
configure the automatically available default profile. With Microsoft Entra
ID authentication:
cu profile set endpoint https://<resource-name>.services.ai.azure.com/
cu profile set auth_mode login
az login
cu doctor
Alternatively, use a resource key:
cu profile set endpoint https://<resource-name>.services.ai.azure.com/
cu profile set api_key <key>
cu doctor
The API key is redacted by cu profile get and cu profile show. cu doctor
checks the API version, endpoint, authentication, service connectivity, and
Content Understanding defaults. It exits nonzero when a required check fails,
so it can serve as a readiness gate.
Use cu and az cu interchangeably
The standalone CU CLI and the Azure CLI extension are two frontends over the
same cu-cli-core operations. Install either frontend, or install both and move
between them for the same analyzer, analysis, defaults, profile, diagnostics,
and infrastructure-generation workflows.
Both frontends read and write the same [cu] profile settings in the active
Azure CLI configuration file (~/.azure/config by default, or the file under
AZURE_CONFIG_DIR). An endpoint, API version, default analyzer, active profile,
or model-deployment mapping saved with one frontend is immediately available to
the other. For example:
# Save the endpoint with the standalone frontend.
cu profile set endpoint https://<resource-name>.services.ai.azure.com/
# Use the same default profile with the Azure CLI extension.
az cu analyzer list --output table
# Change the default analyzer with the Azure CLI extension.
az cu profile set --key default_analyzer --value prebuilt-layout
# Use that setting with the standalone frontend.
cu analyze ./document.pdf
The command names and capabilities overlap, but frontend conventions differ:
| Standalone CU CLI | Azure CLI extension |
|---|---|
Starts commands with cu (cu-cli on macOS). |
Starts commands with az cu. |
| Supports standalone positional shortcuts and Rich/JSON output options. | Uses explicit options plus global Azure CLI --output, --query, and --subscription. |
Uses the profile's auth_mode and can use a saved API key. |
Always uses the active az login identity; shared API keys and auth_mode do not override Azure CLI host authentication. |
Run cu <command> --help or az cu <command> --help when translating a command
between frontends. Profile values are shared; authentication sessions are not,
so sign in with az login before using az cu. For Azure CLI-specific
installation and command examples, see the
Azure Content Understanding extension README.
Supported Content Understanding API versions
Content Understanding API version. Known versions: 2025-11-01 (GA) and 2026-06-01-preview (preview); any YYYY-MM-DD-preview version is also accepted.
CU CLI defaults to 2025-11-01. Override the version with cu profile set api_version <version>, the --api-version flag, or the CU_API_VERSION
environment variable; run cu profile show to see the active profile's
configured version.
The preview API adds capabilities beyond the GA version. CU CLI returns
result-based capabilities, such as document metadata and signatures, through
the normal analysis result without dedicated CLI options. Inline analysis is
the only preview capability that requires a new CU CLI option:
cu analyze --inline runs supported analysis synchronously and returns the
result directly instead of using the default long-running-operation (LRO)
polling flow.
cu analyze --inline --api-version 2026-06-01-preview document.pdf --analyzer prebuilt-layout
Save the preview version to a profile to avoid passing --api-version on every
call: cu profile set api_version 2026-06-01-preview. Pin to 2025-11-01 for
production workloads that don't need preview capabilities.
Further reading:
- What's new in the
2026-06-01-previewAPI - Run
cu analyze --helpfor all analyze options.
Use prebuilt analyzers
List the prebuilt analyzers available to the configured resource:
cu analyzer list
Start with the prebuilt-layout content extraction analyzer. It extracts text,
paragraphs, tables, figures, and document structure without requiring a language
model or embeddings model. -a is the short form of --analyzer:
# Generate Markdown from the analyzer result with the CU SDK's to_llm_input().
cu analyze ./document.pdf -a prebuilt-layout
Analyze a remote file with --url without downloading it through the CLI.
Quote URLs that contain SAS query parameters so the shell preserves & characters:
cu analyze --url "https://storage.example.net/container/video.mp4?sv=<version>&sp=r&sig=<signature>" \
--analyzer prebuilt-videoSearch
Repeat --url for multiple URLs and specify --output-dir for their results.
--url cannot be combined with positional inputs, --file, or --source.
Positional URLs remain available as a standalone shortcut.
Remote inputs require HTTPS. Use a short-lived, read-only SAS and avoid placing production SAS URLs in shared shell history. CU CLI removes URL query strings from its status output and reports, while sending the original URL to Content Understanding unchanged.
Markdown generated by the Content Understanding SDK's to_llm_input() helper is
the default output format. The helper formats field extraction results as
Markdown with YAML frontmatter so they can be used as generative AI model input.
Use --llm-input to select this default view explicitly, or use --json to
return the complete analyzer result as JSON. See the
Content Understanding SDK to_llm_input() helper.
Domain-specific prebuilt analyzers, such as prebuilt-invoice, extract a
defined set of structured fields. They require the model setup described in
Deploy models and configure defaults:
cu analyze ./invoice.pdf --analyzer prebuilt-invoice --json
The command returns an analyzer result. Use --json when you want the
structured result as JSON.
Analyze several files into one output directory. --pattern requires
--source, because a positional path can be either a file or a directory and
--pattern only makes sense once a directory is named explicitly:
cu analyze --source ./documents --pattern "*.pdf" --output-dir ./results
Each result is written under ./results and keeps the input path relative to
./documents. For example, ./documents/invoice-01.pdf produces
./results/invoice-01.pdf.result.md. Markdown results use the
.result.md suffix; adding --json produces .result.json files instead.
Further reading:
- Prebuilt analyzers
- Supported input files and service limits
- Run
cu analyze --helpfor input, output, overwrite, concurrency, and reporting options.
Create a custom analyzer
A custom analyzer lets you define the structured fields needed by your application. Its analyzer schema identifies a base analyzer for the content type and includes a field schema that describes the field names, value types, and generation methods.
Custom analyzers require supported model deployments and configured Content Understanding defaults. Confirm the model-to-deployment mappings before creating the analyzer:
# Show the Content Understanding defaults configured on the resource.
cu defaults show
If the required mappings are missing, follow Configure defaults manually to configure them. Then generate a starter analyzer schema from a representative file:
# Generate a schema from a representative document.
cu analyzer schema create \
--from-sample ./invoice.pdf \
--output-file ./invoice-schema.json
# Review and update the generated schema for your extraction requirements,
# then create the analyzer.
cu analyzer create --name invoice_v1 --schema ./invoice-schema.json
# Run the analyzer against the sample and summarize whether fields were returned
# and any confidence values supplied by the service. This is not an accuracy
# benchmark and does not compare the result with labeled ground truth.
cu analyzer test invoice_v1 ./invoice.pdf
cu analyze ./invoice.pdf --analyzer invoice_v1 --json
Schema generation preserves existing files by default. Pass --force only when
you intentionally want to replace the selected --output-file.
Further reading:
- Create a custom analyzer
- Supported generative models
- Run
cu analyzer --helpfor analyzer management and testing commands.
Command overview
| Command | Purpose |
|---|---|
cu analyze |
Analyze local files or HTTPS URLs and return analyzer results. |
cu analyzer |
List, show, create, copy, delete, and test analyzers; create and validate local analyzer schemas. |
cu defaults |
Read or configure Content Understanding defaults that map models to deployments. |
cu profile |
Manage local CU CLI endpoint, authentication, API, and model settings. |
cu infra generate |
Generate an azd/Bicep project used to provision a Microsoft Foundry resource and configure Content Understanding. Run azd up to provision it. |
cu doctor |
Verify the active CU CLI profile, authentication, and model readiness. |
cu env-var |
Inspect supported environment-variable overrides. |
Every command provides examples:
cu profile --help
cu analyzer copy --help
cu infra generate --help
CU CLI usage guide
Use this README for installation, resource connection, and the first successful analysis. For Azure provisioning, see the Microsoft Foundry provisioning guide. For detailed operational guidance, see the CU CLI usage guide. It explains:
- CU CLI profile resolution and environment-variable overrides
- safe batch previews, output handling, and machine-readable reports
- analyzer schema, lifecycle, testing, and cross-resource copy workflows
- Content Understanding defaults and troubleshooting
More information
The standalone distribution is cu-cli. It depends on the separately built
cu-cli-core implementation package in this same product tree. cu-cli-core
is an internal implementation boundary for official CU command-line frontends;
install and use cu-cli rather than importing the core package directly.
Telemetry
CU CLI adds cu-cli/<version> to the standard Azure SDK User-Agent header on
requests to the Azure Content Understanding service. Microsoft uses this
identifier to understand CU CLI adoption. CU CLI does not add customer content
or separate usage and analytics events to this telemetry.
To remove the cu-cli/<version> identifier, set CU_TELEMETRY=off (also
accepts 0, false, or no) before running CU CLI. The Azure SDK continues to
send its standard User-Agent as part of service requests. See the repository
data collection notice
for more information.
Use multiple profiles
If you work with multiple resources, create named profiles and either activate one or select it per command:
cu profile create dev
cu profile set endpoint https://<dev-resource>.services.ai.azure.com/ --name dev
cu profile create prod
cu profile set endpoint https://<prod-resource>.services.ai.azure.com/ --name prod
cu profile set-active dev
cu analyzer list
cu analyzer list --profile prod
cu doctor --profile prod
See the CU CLI profile usage guide for profile resolution and environment-variable overrides.
Metadata
Release files for cu-cli 0.1.0b2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cu_cli-0.1.0b2.tar.gz | 79.9 kB | With provenance | Details for cu_cli-0.1.0b2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cu_cli-0.1.0b2-py3-none-any.whl | Python 3 | none | any | Details for cu_cli-0.1.0b2-py3-none-any.whl |
Total release size: 171.1 kB
Release files / cu_cli-0.1.0b2.tar.gz
| Download URL | cu_cli-0.1.0b2.tar.gz |
|---|---|
| Size | 79.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73b9528d6f5f88cae8d76edf18338d1353cadba2e32bfb9134e1b35945324030
|
|
BLAKE2b-256 checksum How to use checksums |
c12e2bfa970287657d0b23b145c5e52d1f8f9de67008bd775f8d8cdc5bee5cf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.
Transparency logRelease files / cu_cli-0.1.0b2-py3-none-any.whl
| Download URL | cu_cli-0.1.0b2-py3-none-any.whl |
|---|---|
| Size | 91.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
04c72323aa86b258b51e5bb41bdab1930346d47fa9da5d06b44a6bd3416fcced
|
|
BLAKE2b-256 checksum How to use checksums |
b03a4e162e3aafe34137d9020f20c2c561090fb2c9402db7e2280a2a282d67f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.
Transparency logSecurity for cu-cli 0.1.0b2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for cu_cli-0.1.0b2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.