> For the complete documentation index, see [llms.txt](https://manual.dxable.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manual.dxable.com/1password/read.md).

# read

シークレット参照によって指定された 1Password 内のフィールドの値を読み取ります。

[シークレット参照とクエリ パラメータの詳細について説明します。](https://developer.1password.com/docs/cli/secret-reference-syntax/)

```
op read <reference> [flags]
```

#### **Flags** <a href="#wryrpje4rv88" id="wryrpje4rv88"></a>

```
    --file-mode filemode   Set filemode for the output file. It is ignored without the --out-file flag. (default 0600)
-f, --force                Do not prompt for confirmation.
-n, --no-newline           Do not print a new line after the secret.
-o, --out-file string      Write the secret to a file instead of stdout.
```

#### [**例**](https://developer.1password.com/docs/cli/reference/commands/read/#examples) <a href="#sxrv06lvssn5" id="sxrv06lvssn5"></a>

`password`アイテムのフィールドにSaveされている秘密を`db`金庫内に 出力します`app-prod`:

```
$ op read op://app-prod/db/password
```

クエリ パラメータを含むシークレット参照を使用して、ワンタイム パスワードを取得します。

```
$ op read "op://app-prod/db/one-time password?attribute=otp"
```

クエリ パラメータ付きのシークレット参照を使用して、OpenSSH 形式で SSH鍵の秘密キーを取得します。

```
$ op read "op://app-prod/ssh key/private key?ssh-format=openssh"
```

ssh保管庫内のアイテムで見つかった `SSH`鍵をコンピューターに`server`新しい`key.pem`ファイルとしてSaveします。

```
$ op read --out-file ./key.pem op://app-prod/server/ssh/key.pem
```

`op read`プレーンテキストのシークレットの代わりにシークレット参照を使うコマンドで使用します。

```
$ docker login -u $(op read op://prod/docker/username) -p $(op read op://prod/docker/password)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://manual.dxable.com/1password/read.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
