> For the complete documentation index, see [llms.txt](https://docs.keeper.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keeper.io/keeperpam/jp/secrets-manager/secrets-manager-command-line-interface/shell-command.md).

# shellコマンド

対話型シェルでのCLI実行

**説明:** 対話型シェル (REPL) でCLIを実行します。シェル内では `ksm` を付けずにコマンド名だけを入力でき、コマンドごとに再認証する必要はありません。

形式: **`ksm shell`**

**例:**

```
$ ksm shell

██╗  ██╗███████╗███╗   ███╗     ██████╗██╗     ██╗
██║ ██╔╝██╔════╝████╗ ████║    ██╔════╝██║     ██║
█████╔╝ ███████╗██╔████╔██║    ██║     ██║     ██║
██╔═██╗ ╚════██║██║╚██╔╝██║    ██║     ██║     ██║
██║  ██╗███████║██║ ╚═╝ ██║    ╚██████╗███████╗██║
╚═╝  ╚═╝╚══════╝╚═╝     ╚═╝     ╚═════╝╚══════╝╚═╝

Current Version: 1.5.0

Running in shell mode. Type 'quit' to exit.

KSM Shell (? for help) > secret list

 UID                     Record Type  Title
 ----------------------- ------------ -----------
 A_ok8pstlrCr5o84Ac9-hg  login        My Login

KSM Shell (? for help) > quit
```

{% hint style="info" %}
シェル内では `secret list`、`folder list`、`profile list` のように、コマンド名だけで実行します。`ksm` は付けないでください。
{% endhint %}

***

## サブコマンド (シェル内で利用可能) <a href="#sub-commands-available-inside-the-shell" id="sub-commands-available-inside-the-shell"></a>

| サブコマンド | 説明                                          |
| ------ | ------------------------------------------- |
| `quit` | シェルを終了してターミナルに戻る                            |
| `help` | トップレベルのコマンド一覧とオプションを表示 (`ksm --help` と同じ出力) |

{% hint style="info" %}
シェルのプロンプトで `?` と入力すると、`help` および `ksm --help` と同じコマンド一覧とオプションが表示されます。
{% endhint %}

***

## セッション全体のオプション <a href="#session-wide-options" id="session-wide-options"></a>

シェル起動時に渡したグローバルオプション (`--ini-file`、`--profile-name`/`-p`、`--output`/`-o`、`--color`/`--no-color`、`--cache`/`--no-cache`、`--log-level`) は、そのセッション内のすべてのコマンドで使われます。コマンドごとに繰り返す必要はありません。シェル内の1行にオプションを付けた場合は、その行だけ上書きされます。

**例:**

```
$ ksm --profile-name production shell

KSM Shell (? for help) > secret list
# uses the "production" profile

KSM Shell (? for help) > secret list --profile-name staging
# uses "staging" for this line only

KSM Shell (? for help) > secret list
# back to "production"
```

***

## プラットフォームに関する注記 <a href="#platform-notes" id="platform-notes"></a>

{% hint style="info" %}
Windowsでは、バックスラッシュを含むファイルパス (例: `--ini-file C:\keeper\keeper.ini`) や、`#` を含むシークレット値・引数も、シェル内で正しく解析されます。
{% endhint %}

{% hint style="info" %}
ターミナルがバナーの罫線文字を表示できない場合 (出力をパイプしたときなど) は、プレーンテキストのバナーに切り替わります。コマンドの動作には影響しません。
{% endhint %}

***


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.keeper.io/keeperpam/jp/secrets-manager/secrets-manager-command-line-interface/shell-command.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
