# struere status

> Compare local vs remote state

The `status` command compares your local file definitions against the current remote state in Convex, showing what would change on the next sync.

## Usage

```bash
bunx struere status
bunx struere status --json
```

## Flags

| Flag | Description |
|------|-------------|
| `--json` | Output raw JSON with classified resources |

## What It Does

The `status` command:

1. Auto-regenerates the `.struere/` virtual module shim to ensure resource loading uses the latest SDK exports
2. Loads all resource definitions from your local directories (`agents/`, `entity-types/`, `roles/`, `triggers/`, `routers/`, `tools/`)
3. Fetches the current remote state for both development and production via `getSyncState`
4. Compares each resource and displays the differences

## Output Sections

The status output displays five resource categories:

### Agents

Shows all agents with their sync and deployment status. Agents synced to development show a green dot. Agents not yet deployed to production show a yellow dot.

### Data Types

Shows all entity types with their sync status.

### Roles

Shows all roles with their sync status.

### Routers

Shows all routers with their sync status and mode.

### Custom Tools

Shows all custom tools with their sync status.

Each section categorizes resources as:

- **Synced** (green dot) — Exists locally and remotely
- **Not in production** (yellow dot) — Synced to dev but not deployed to production
- **New** (blue +) — Exists locally but not remotely (will be created on sync)
- **Will be deleted** (red -) — Exists remotely but not locally (will be removed on sync)

## Example Output

```
Agents
────────────────────────────────────────────────────────────
  ● scheduler (scheduler) - v1.0.0
  ○ support-agent (support-agent) - v1.2.0
      Not deployed to production
  + onboarding-agent (onboarding-agent) - new

Data Types
────────────────────────────────────────────────────────────
  ● customer (customer)
  + invoice (invoice) - new

Roles
────────────────────────────────────────────────────────────
  ● admin (2 policies)
  - legacy-role - will be deleted

Routers
────────────────────────────────────────────────────────────
  ● main-router (main-router) - rules
  No routers

Custom Tools
────────────────────────────────────────────────────────────
  ● calculate-price
  + send-invoice - new
```

## JSON Output

Use `--json` for machine-readable output:

```bash
bunx struere status --json
```

Returns a JSON object with `agents`, `entityTypes`, `roles`, and `routers`, each containing `synced`, `new`, and `deleted` arrays.

## When to Use Status

- **Before deploying** — Review what will change before running `struere deploy`
- **After pulling** — Verify that your local state matches remote after a `pull`
- **Debugging sync issues** — Identify resources that are out of sync
- **Code review** — See at a glance what a set of file changes will do to the remote state

## Workflow Integration

A safe deployment workflow using `status`:

```bash
bunx struere status

bunx struere dev

bunx struere status

bunx struere deploy
```

1. Check what will change
2. Sync to development and test
3. Verify the state is clean
4. Deploy to production

## Relationship with Other Commands

| Command | What it does |
|---------|-------------|
| `struere status` | Read-only comparison, changes nothing |
| `struere dev` | Syncs local to remote (development environment) |
| `struere pull` | Syncs remote to local (overwrites local files) |
| `struere deploy` | Syncs local files to production |
