# uip agent config

> Syntax and options for `uip agent config`, which reads and updates individual keys in an agent project's `agent.json`.

`uip agent config` reads and updates individual keys in an agent project's `agent.json`. It is a convenience for automation and scripts: everything it does can also be accomplished by hand-editing `agent.json`, but the verbs understand the file's structure (settings, metadata, messages) and expose a flat key namespace.

## Synopsis

```
uip agent config get [key] [--path <dir>]
uip agent config set <key> <value> [--path <dir>]
```

All `uip agent config` subcommands honor the [global options](./global-options.md) (`--output`, `--output-filter`, `--log-level`, `--log-file`). Exit codes follow the [standard contract](./exit-codes.md).

## uip agent config get

Read a single key (or the full curated summary) from `agent.json`.

### Arguments

- `[key]` *(optional)* — Config key. Known keys include `model`, `name`, `systemPrompt`, and any other nested path that `agent.json` supports (run `uip agent config get` without a key for a curated summary). Omit to print that summary.

### Options

| Flag | Default | Purpose |
|---|---|---|
| `--path <path>` | `.` | Path to the agent project directory. |

### Examples

```bash
# Read a single key
uip agent config get model --path ./my-agent

# Dump the curated summary for the current directory
uip agent config get
```

### Data shape (--output json)

**Single key** (`Code: "AgentConfigGet"`):

```json
{
  "Code": "AgentConfigGet",
  "Data": {
    "Key": "model",
    "Value": "gpt-4o-2024-11-20"
  }
}
```

**Summary** (no key):

```json
{
  "Code": "AgentConfigGet",
  "Data": {
    "Name": "my-agent",
    "Description": "-",
    "Model": "gpt-4o-2024-11-20",
    "Engine": "advanced",
    "MaxTokens": "-",
    "Temperature": "-",
    "SystemPrompt": "You are…",
    "UserPrompt": "-"
  }
}
```

`SystemPrompt` and `UserPrompt` are the `content` fields of the `system` and `user` entries in `agent.json`'s `messages[]` array, truncated to 120 characters. Any missing value renders as `-`.

## uip agent config set

Update a key in `agent.json`. The value is written verbatim — no type coercion beyond the CLI's built-in normalization.

### Arguments

- `<key>` *(required)* — Config key to write. Same namespace as `get`.
- `<value>` *(required)* — New value.

### Options

| Flag | Default | Purpose |
|---|---|---|
| `--path <path>` | `.` | Path to the agent project directory. |

### Examples

```bash
# Swap the model on a scaffolded agent
uip agent config set model gpt-4o-2024-11-20 --path ./my-agent

# Rename the agent (metadata.name)
uip agent config set name "Invoice Triage" --path ./my-agent
```

### Data shape (--output json)

```json
{
  "Code": "AgentConfigSet",
  "Data": {
    "Key": "model",
    "Value": "gpt-4o-2024-11-20",
    "Status": "Updated"
  }
}
```

The CLI does not re-validate `agent.json` after a `set`. Run [`uip agent validate`](./uip-agent-validate.md) afterwards to confirm the project is still internally consistent (contentTokens, entry-points.json sync, etc.).

## Related

- [`uip agent validate`](./uip-agent-validate.md) — run static checks and schema migration after a batch of `config set` calls.
- [`uip agent init`](./uip-agent-init.md) — scaffold a new project; many of the values `config get` exposes are written at init time.
- [`uip agent input`](./uip-agent-io-manage.md#uip-agent-input) / [`uip agent output`](./uip-agent-io-manage.md#uip-agent-output) — these verbs write the agent's I/O schemas, which `config` does not manage.

## See also

- [Global options](./global-options.md), [Exit codes](./exit-codes.md).
