> ## Documentation Index
> Fetch the complete documentation index at: https://docs.platform.nora.my/llms.txt
> Use this file to discover all available pages before exploring further.

# nora foundry

> Foundry utilities that don't fit under pipelines or connectors.

`foundry` collects the odd Foundry-scoped verbs that don't belong under [`pipelines`](/cli/pipelines) (CRUD + runs + logs) or [`connectors`](/cli/connectors) (credentials). Today: one — a natural-language → import-conditions compiler.

## Commands

| Command                               | Description                                                          |
| ------------------------------------- | -------------------------------------------------------------------- |
| `foundry compile-conditions <prompt>` | Compile a plain-language file filter into structured pipeline rules. |

## `foundry compile-conditions`

Turns a natural-language filter (Korean or English) into the structured rules a Cloud Source node executes. Same compiler the Foundry UI runs — surfaced as a CLI verb so scripted pipeline setup can produce the rules programmatically.

```bash theme={null}
nora foundry compile-conditions "PDF 만, 5MB 미만, filename 이 draft- 로 시작하는 것 제외"
```

Uses the workspace's Ask AI model.

### Input modes

The prompt is a positional string but also accepts the standard piping conventions:

```bash theme={null}
# From stdin
echo "PDFs only under 5MB" | nora foundry compile-conditions -

# From file
nora foundry compile-conditions @filter.txt
```

### Merging with existing rules

Pass `--existing` (JSON array, or `@file`) to merge into a rule set you already have. The server de-dupes:

```bash theme={null}
# Merge new rules into whatever's already on the node
nora foundry compile-conditions "그리고 archive 폴더는 skip" \
  --existing "$(nora pipelines nodes list p_docs | jq '.[] | select(.id=="n_source") | .config.conditions')"
```

Prints the merged rule list (default) or the raw `{conditions, added}` response with `--json`.

## Recipes

### Bootstrap a Cloud Source node from natural language

```bash theme={null}
# 1. Compile the filter
rules=$(nora foundry compile-conditions "Google Docs 와 PDF, 500KB 초과, 지난 30일 안 수정" --json | jq '.conditions')

# 2. Set them on the pipeline node
nora pipelines nodes update n_gdrive_source \
  --set-config "$(echo '{"conditions":'$rules'}' | jq -c .)"

# 3. Test with a dry-run
nora pipelines run folder p_docs --tag inbox --max-documents 10
```

### Iterate on a filter

```bash theme={null}
# Start with an empty rule set
rules='[]'

# Add one rule at a time, review each merge
rules=$(nora foundry compile-conditions "PDF 만" --existing "$rules" --json | jq '.conditions')
rules=$(nora foundry compile-conditions "5MB 미만" --existing "$rules" --json | jq '.conditions')

echo "$rules" | jq .
```

Each pass returns the full merged set plus which rules were newly added.

## Related

* [`nora pipelines`](/cli/pipelines) — where the compiled rules land (`config.conditions` on a Cloud Source node).
* [Source blocks](/build/foundry/ingest) — the concept behind pipeline sources.
