> ## 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

> pipelines 나 connectors 아래 맞지 않는 Foundry 유틸리티.

`foundry` 가 [`pipelines`](/ko/cli/pipelines) (CRUD + 실행 + 로그) 나 [`connectors`](/ko/cli/connectors) (자격증명) 아래 속하지 않는 Foundry 스코프 verb 모음. 오늘: 하나 — 자연어 → import-conditions 컴파일러.

## 명령

| 명령                                    | 설명                           |
| ------------------------------------- | ---------------------------- |
| `foundry compile-conditions <prompt>` | 자연어 파일 필터를 구조화 파이프라인 룰로 컴파일. |

## `foundry compile-conditions`

자연어 필터 (한국어나 영어) 를 Cloud Source 노드가 실행하는 구조화 룰로 전환. Foundry UI 가 실행하는 같은 컴파일러 — 스크립트 파이프라인 셋업이 룰을 프로그래매틱하게 생성할 수 있도록 CLI verb 로 노출.

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

워크스페이스의 Ask AI 모델 사용.

### 입력 모드

프롬프트가 위치 문자열이지만 표준 파이핑 관례도 수용:

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

# 파일에서
nora foundry compile-conditions @filter.txt
```

### 기존 룰과 병합

`--existing` (JSON 배열, 또는 `@file`) 넘겨 이미 있는 룰 세트에 병합. 서버가 중복 제거:

```bash theme={null}
# 노드에 이미 있는 것에 새 룰 병합
nora foundry compile-conditions "그리고 archive 폴더는 skip" \
  --existing "$(nora pipelines nodes list p_docs | jq '.[] | select(.id=="n_source") | .config.conditions')"
```

병합된 룰 목록 (기본) 또는 원시 `{conditions, added}` 응답을 `--json` 으로 인쇄.

## 레시피

### 자연어에서 Cloud Source 노드 부트스트랩

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

# 2. 파이프라인 노드에 설정
nora pipelines nodes update n_gdrive_source \
  --set-config "$(echo '{"conditions":'$rules'}' | jq -c .)"

# 3. dry-run 으로 테스트
nora pipelines run folder p_docs --tag inbox --max-documents 10
```

### 필터 반복

```bash theme={null}
# 빈 룰 세트로 시작
rules='[]'

# 한 번에 하나씩 룰 추가, 각 병합 리뷰
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 .
```

각 패스가 전체 병합 세트와 새로 추가된 룰 반환.

## 관련

* [`nora pipelines`](/ko/cli/pipelines) — 컴파일된 룰이 착지하는 곳 (Cloud Source 노드의 `config.conditions`).
* [Source 블록](/ko/build/foundry/ingest) — 파이프라인 소스 개념.
