Limai Docs
CLI Reference

classify

Document classification commands

$limai classify <subcommand>

Manage classifiers and their routes, and upload and classify documents.

Options
--jsonOutput raw JSON
--verboseEnable debug logging

Subcommands

limai classify list

Without a classifier ID, list the classifiers visible in a project, including the global classifiers that route into it.

$limai classify list --project-id <id>

List the classifiers visible in a project.

Options
--project-id <id>Project ID (required in this form)

With a classifier ID, list that classifier's classifications, newest first (GET /classifications).

$limai classify list <classifierId>

List a classifier's classifications.

Options
--label <idOrName>Only classifications with this label. Takes a label ID or a name, matched case-insensitively; an unknown label is an error
--status <status>PENDING, PROCESSING, CLASSIFIED, UNCLASSIFIED or FAILED
--unroutedOnly classifications that were not routed
--page <n>Page number (default 1)
--limit <n>Classifications per page (1-200, default 20)

The table shows ID, status, file, route, label, confidence and creation time. Pass a classifier ID or --project-id, not both.

limai classify labels <classifierId>

List a classifier's labels, most used first. A label names a document type. Every route has one, and documents that match no route still get one, so UNCLASSIFIED means classified but not routed.

$limai classify labels <classifierId>

List a classifier's labels.

Options
--include-archivedInclude archived labels

The table shows name, documents (how many classifications carry it), route (route when the label belongs to a route), and ID.

limai classify add-label <classifierId>

Create a label, so the classifier uses your name for a document type from the first document on. Requires edit permission.

$limai classify add-label <classifierId>

Create a label on a classifier.

Options
--name <name>Label name, e.g. "Purchase Order" (required)
--description <desc>One-line description the classifier reads when choosing a label

limai classify settings <classifierId>

Change a classifier's settings. Requires edit permission.

$limai classify settings <classifierId>

Change a classifier's settings.

Options
--allow-new-labels <true|false>Whether the classifier may create labels for new document types (required)

limai classify create

Create a classifier. Classifiers are always created project-scoped; making one global is a separate action in the app.

$limai classify create

Create a project-scoped classifier.

Options
--name <name>Classifier name (required)
--project-id <id>Project ID (required)

limai classify add-route <classifierId>

Add a route from a classifier to a model. A global classifier may route to a model in any project you can access.

$limai classify add-route <classifierId>

Add a route from a classifier to a model.

Options
--deployment-id <id>ID of the model to route to (required)
--name <name>Route name (required)
--description <desc>Route description (required)

limai classify file <classifierId> <file>

Upload a file and classify it. By default, runs synchronously and returns the classification result immediately. Either way the command prints the routed model's name and its extraction schema ID, or reports the file as UNCLASSIFIED.

$limai classify file <classifierId> <file>

Upload and classify a file.

Options
--asyncClassify with the async endpoint, which also queues extraction
--allow-duplicatesUpload the file again even when this classifier already has the same bytes
--context <text>Free-text context for the classifier, such as an email subject or a folder path (max 8000 characters)

Supported file types: PDF, PNG, JPG, JPEG.

The result includes the document's label, such as Invoice or Purchase Order (new) when the classifier created it during this run. A routed document carries its route's label.

--context is supporting evidence the classifier reads alongside the file; the document wins when the two disagree. A context longer than 8000 characters fails before anything is uploaded, with context must be at most 8000 characters (got N).

The command hashes the file and the platform looks for the same bytes already sent to this classifier. On a match nothing is uploaded: if that file is already classified the CLI prints the existing verdict and skips the classification too, and otherwise it classifies the file that is already there. --allow-duplicates skips detection and uploads the file as a new one, which is how you re-classify the same bytes on purpose. With --json the result carries isDuplicate, existingFileId, classificationId, and cached.

limai classify status <classifierId>

Check the status of a classification, by run or by file.

$limai classify status <classifierId>

Check classification status.

Options
--classification-id <id>Classification ID
--file-id <id>File ID; returns the latest classification of that file

Pass exactly one of the two. The output includes the label and the context the run used.

Examples

Classify a file synchronously

limai classify file cls_abc123 ./document.pdf

Classify and queue extraction in one call

limai classify file cls_abc123 ./document.pdf --async

Check a classification's status

limai classify status cls_abc123 --classification-id clsf_xyz789

List the classifiers routing into a project

limai classify list --project-id proj_abc123

Route a classifier to a model

limai classify add-route cls_abc123 --deployment-id dep_xyz789 --name "Invoices" --description "Supplier invoices"

Look up what a file was classified as

limai classify status cls_abc123 --file-id file_abc123

Re-classify the same document on purpose

limai classify file cls_abc123 ./document.pdf --allow-duplicates

Classify with context

limai classify file cls_abc123 ./document.pdf --context "Email subject: PO 4411 from Acme"

See which document types a classifier has seen

limai classify labels cls_abc123

List the unrouted purchase orders

limai classify list cls_abc123 --label "Purchase Order" --unrouted

Stop the classifier from creating labels

limai classify settings cls_abc123 --allow-new-labels false

Get classification result as JSON

limai classify file cls_abc123 ./document.pdf --json

On this page