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

# nora foundry

> pipelines나 connectors 아래 안 맞는 파운더리 유틸리티

`foundry`가 [`pipelines`](/ko/cli/pipelines)(CRUD + 실행 + 로그)나 [`connectors`](/ko/cli/connectors)(자격증명) 아래 안 들어가는 파운더리 범위 명령 모음. 지금은 하나. 자연어 → import-conditions 컴파일러.

## 명령

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

## `foundry compile-conditions`

자연어 필터(한국어나 영어)를 Cloud Source 노드가 실행하는 구조화 룰로 바꿈. 파운더리 UI가 돌리는 것과 같은 컴파일러. 스크립트로 파이프라인을 세울 때 룰을 프로그램으로 만들 수 있게 CLI 명령으로 노출.

```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) 파이프라인 소스 개념.
