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

# ingest

> Ingest signals from a file or stdin.

```bash theme={null}
kremis ingest [-f <FILE>] [-t <FORMAT>] [--from-stdin] [--strict]
```

Read signals from a file or stdin and ingest them into the graph.

`--file` and `--from-stdin` are mutually exclusive. One must be provided.

## Options

| Option           | Short | Description                                                         | Default                           |
| ---------------- | ----- | ------------------------------------------------------------------- | --------------------------------- |
| `--file <path>`  | `-f`  | Path to the input file                                              | (required without `--from-stdin`) |
| `--format <fmt>` | `-t`  | Input format: `json` or `text` (file only)                          | `json`                            |
| `--from-stdin`   |       | Read signals from stdin as JSON Lines                               | `false`                           |
| `--strict`       |       | Fail with exit code 1 if any lines are skipped (`text` format only) | `false`                           |

## Input Formats

### JSON (file)

Array of signal objects:

```json theme={null}
[
  {"entity_id": 1, "attribute": "name", "value": "Alice"},
  {"entity_id": 2, "attribute": "name", "value": "Bob"}
]
```

### Text (file)

Colon-separated `entity_id:attribute:value` per line:

```text theme={null}
1:name:Alice
2:name:Bob
```

### JSON Lines (stdin)

One signal object per line. No array wrapper. `--format` is ignored when using `--from-stdin`.

```
{"entity_id": 1, "attribute": "name", "value": "Alice"}
{"entity_id": 2, "attribute": "name", "value": "Bob"}
```

## Limits

| Limit                         | Value  |
| ----------------------------- | ------ |
| Maximum signals per ingestion | 10,000 |

## Examples

```bash theme={null}
# Ingest JSON signals from file
kremis ingest -f examples/sample_signals.json -t json

# Ingest text signals from file
kremis ingest -f examples/sample_signals.txt -t text

# Pipe a single signal from another command
echo '{"entity_id": 1, "attribute": "name", "value": "Alice"}' | kremis ingest --from-stdin

# Pipe multiple signals (JSON Lines)
generate-signals | kremis ingest --from-stdin

# Heredoc (useful for scripting)
kremis ingest --from-stdin <<EOF
{"entity_id": 1, "attribute": "name", "value": "Alice"}
{"entity_id": 2, "attribute": "name", "value": "Bob"}
EOF

# Strict mode: fail if any lines are malformed (CI/CD pipelines)
kremis ingest -f data.txt -t text --strict
```
