# Flat lookup flags (`open`, `resolve`, `nav open`)

cms-edit resolves entries using **explicit flags** — not positional slugs. Provide **exactly one** primary lookup flag per command. Scope flags (for example `--tag-type-name` with `--tag-name`) do not count as a second primary.

Run `cms-edit index sync` once per space (or let commands auto-sync) so catalog types resolve from the local index.

## Commands

| Command | Purpose |
|---------|---------|
| `cms-edit open` | Start an editing session |
| `cms-edit peek` | Preview tree + root fields without a session |
| `cms-edit resolve` | Print entry summary or `--json` (no session) |
| `cms-edit nav open` | Open a `navigation` entry session |

## Entry ID

```bash
cms-edit open --id 4xKj2abcDefGhijK
cms-edit resolve --id 4xKj2abcDefGhijK
```

## Pages

| Flag | Contentful field |
|------|------------------|
| `--page-slug` | `slug` (leading/trailing `/` stripped) |
| `--page-title` | `title` |
| `--page-cms-label` | `cmsLabel` |

**Homepage (SE Studio standard):** Contentful slug is `index`; public URL is `/`. These are equivalent:

```bash
cms-edit open --page-slug /
cms-edit open --page-slug /index
```

`list --type page` shows slugs as stored in Contentful. Non-standard homepage slugs (e.g. Pedestal `home`) are documented in the editor-pack `routing` resource; open with `--page-slug /` or the CMS slug from routing.

```bash
cms-edit open --page-slug /pricing/
cms-edit peek --page-slug /pricing/
cms-edit open --page-cms-label "Hepatology Solutions Page"
cms-edit resolve --page-title "Test page for nick"
```

## Articles

| Flag | Contentful field |
|------|------------------|
| `--article-slug` | `slug` |
| `--article-title` | `title` |
| `--article-cms-label` | `cmsLabel` |

```bash
cms-edit open --article-slug resources/publications/my-post
cms-edit list --type article --article-type-name "Publications"
```

## Page variants

| Flag | Contentful field |
|------|------------------|
| `--page-variant-slug` | `slug` |
| `--page-variant-title` | `title` |
| `--page-variant-cms-label` | `cmsLabel` |

## Taxonomy

| Type | Slug | Name | cmsLabel |
|------|------|------|----------|
| tag | `--tag-slug` | `--tag-name` | `--tag-cms-label` |
| tagType | `--tag-type-slug` | `--tag-type-name` | — |
| articleType | `--article-type-slug` | `--article-type-name` | — |

Scope tags under a tag type (optional):

```bash
cms-edit resolve --tag-name "Hepatology" --tag-type-name "Therapeutic Area"
cms-edit list --type tag --tag-type-slug therapeutic-area
```

Templates use **cmsLabel** only:

```bash
cms-edit open --template-label "Default page template"
cms-edit resolve --label "Default page template"   # alias for --template-label
```

## Navigation

Navigation entries use the **`name`** field (not slug).

| Flag | Resolves |
|------|----------|
| `--nav-id` | `navigation` entry ID |
| `--nav-name` | `navigation.fields.name` |
| `--nav-item-id` | `navigationItem` entry ID |
| `--nav-item-title` | `navigationItem.fields.title` |

When multiple nav items share a title, add **`--nav-id`** to scope:

```bash
cms-edit nav open --nav-name "Main header"
cms-edit resolve --nav-item-title "Contact" --nav-id <navigation-entry-id>
```

## List filters (index)

```bash
cms-edit list --type page
cms-edit list --type article --article-type-slug resources/publications
cms-edit list --type tag --tag-type-name "Therapeutic Area"
cms-edit list --type navigation
cms-edit list --type navigationItem
```

Use `--force-cma` to paginate via the Management API instead of the catalog.

## Breaking changes (1.x → catalog flags)

| Old | New |
|-----|-----|
| `cms-edit open /pricing` | `cms-edit open --page-slug pricing` |
| `cms-edit peek /pricing` | `cms-edit peek --page-slug pricing` |
| `cms-edit open <id> --id` | `cms-edit open --id <id>` |
| `cms-edit nav open footer` | `cms-edit nav open --nav-name "Footer"` |
| `cms-edit resolve --type tag --slug x` | `cms-edit resolve --tag-slug x` |

## Ambiguity

If two entries share the same slug, title, or cmsLabel in the index, cms-edit prints all matching IDs and exits with an error. Fix duplicates in Contentful or resolve by `--id`.
