---
id: "arquivos-referencia-cli"
titulo: "Files command reference"
resumo: "The command-line commands that open files, open diffs and open every changed file in a workspace."
idioma: "en"
tipo: "referencia"
categoria: "arquivos-git"
aplicavelDesde: "0.0.16"
capabilities: ["file.open", "file.diff", "file.open-changed"]
estadoEditorial: "aprovado"
nivelEvidencia: "artefato-distribuido"
refFonte: "27574c339b58316408f6be2d62169d59041d07bf"
revisaoFonte: "2026-09-24"
revisor: "mantenedor (v1, 2026-10-03)"
rota: "/docs/en/ferramentas/arquivos/referencia-cli/"
fonte: "pt-br/ferramentas/arquivos/referencia-cli.md"
caminhoPublico: "docs/publica/en/ferramentas/arquivos/referencia-cli.md"
hashFonte: "sha256:d69a6c55544ba21c3c50a12c7b453f0c2e7cbe920e2b548408da15f6f6644452"
hashDestaPagina: "sha256:d01c31b78b132ed2cc1ebbc8f6958f2bfdd4a965f270e07d87b69bb8563b4fcd"
traducaoAssistidaPorIA: true
traducaoDesatualizada: false
corpoRetido: false
---
<!-- traducao-assistida-por-ia: idioma=EN fonte=pt-br/ferramentas/arquivos/referencia-cli.md fonteHash=sha256:d69a6c55544ba21c3c50a12c7b453f0c2e7cbe920e2b548408da15f6f6644452 estado=atual -->

Commands, flags and values are **literal** — they are not translated.

## Selectors and global flags

- **`--workspace <selector>`** — chooses the workspace. Accepts `id:<id>`, `name:<name>`, `path:<path>`, `active`/`current` and `focused`.
- **`--worktree`** is a compatibility alias of `--workspace`.
- **`--json`** returns structured output.

## Open a file

```
elyra file open <path> [--workspace <selector>] [--json]
```

- The path is **relative to the selected worktree**.
- **Without `--workspace`, the local call infers the worktree from the current directory.** Remote calls require `--workspace`.
- If there is no resolvable worktree and no `--workspace`, the call **fails** instead of opening.
- **Binary files do not open as text**: the response indicates they were not opened and which type was recognized.

Examples:

```
elyra file open src/App.tsx
elyra file open --path docs/readme.md --workspace active
```

## Open a file's diff

```
elyra file diff <path> [--staged] [--workspace <selector>] [--json]
```

- **The default is the diff of unstaged differences.** `--staged` opens the index diff.
- It requires the path and a resolvable worktree.
- **A binary file produces no text diff**: the response indicates the type instead of comparing content.

Examples:

```
elyra file diff src/App.tsx
elyra file diff --path package.json --staged --workspace name:feature
```

## Open every changed file

```
elyra file open-changed [--mode edit|diff|both] [--workspace <selector>] [--json]
```

- The source of the changes, in this version, is the selected worktree's **git status**.
- **The default mode is `diff`.** `--mode` accepts `edit`, `diff` or `both`; any other value is an argument error.
- **In `edit` mode, deleted files are skipped** — there is no editing target.
- **Unresolved conflicts are skipped**, both in `edit` and in `diff`.
- With no changed files, the output says there are no changed files.
- The result aggregates **opened**, **skipped** and **total changed**.

Examples:

```
elyra file open-changed
elyra file open-changed --mode both
elyra file open-changed --mode diff --workspace active
```
