# コマンドラインインターフェース

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/ja-jp/help/clion/llms.txt).

コマンドラインから CLion の機能を使用します: ファイルとプロジェクトを開き、差分を表示し、ファイルをマージし、コードスタイルを適用し、フォーマットし、ソースコードをインスペクションします。

> **Tip:**
> For more information about running command-line tools from inside CLion, refer to [ターミナルエミュレーター](terminal-emulator.html).

## スタンドアロンインスタンスのランチャー

Windows:

The [installation directory](directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html) contains batch scripts and executables for launching CLion, formatting the source code, and running inspections. To use them from the Command Prompt  `cmd.exe` , add the location of the CLion  `bin`  folder to the  `PATH`  environment variable. For example, if you installed CLion to  `C:\Program Files\JetBrains\%instance%` , you can use the following command:

```CONSOLE
set PATH=%PATH%;C:\Program Files\JetBrains\CLion\bin

```

このコマンドは、現在のシェル（  `cmd.exe`  の現在のインスタンス）の  `PATH`  環境変数のみを変更します。

この変更を永続化するには:

* CLion をインストールする場合は、 "bin" フォルダーをパスに追加する を [インストーラー](installation-guide.html#standalone_windows)で選択します。

* または、Windows 環境変数 ダイアログを使用して、IDE の bin ディレクトリを `パス` ユーザー環境変数に追加します。

* それ以外でコマンドラインで解決したい場合は、PowerShell を使用できます: ```POWERSHELL [Environment]::SetEnvironmentVariable('PATH', $env:PATH + ';C:\Program Files\JetBrains\IntelliJ IDEA\bin', 'User') ```

`PATH`  変数を構成した後、コマンドプロンプトの任意の作業ディレクトリから実行可能ファイルを実行できます。

```CONSOLE
clion64.exe

```

または、バッチスクリプトを使用できます:

```CONSOLE
clion.bat

```

macOS:

To run CLion from the shell, use the  `open`  command with the following options:

`-a`
: アプリケーションを指定します。

`-n`
: アプリケーションがすでに実行中でも、新しいインスタンスを開きます。

`--args`
: アプリケーションに渡す追加の引数を指定します。

例: 次のコマンドで  `CLion.app`  を実行できます。

```SHELL
open -na "CLion.app"

```

> **Note:**
> If CLion is not in the default  `/Applications`  directory, specify the full path to it.

`PATH`  環境変数のディレクトリにこのコマンドを使用してシェルスクリプトを作成できます。 例: 次の内容のファイル  `/usr/local/bin/clion`  を作成します。

```PLAINTEXT
#!/bin/sh

open -na "CLion.app" --args "$@"

```

スクリプトを実行する権限があることを確認してください。デフォルトでは  `/usr/local/bin` が  `PATH` 環境変数にあるはずなので、シェルのどこからでも  `clion` を実行できるはずです。

スクリプトを実行する権限がない場合は、次を実行します:

```SHELL
chmod +x /usr/local/bin/clion

```

Linux:

Linux では、 [インストールディレクトリ](directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html)の  `bin`  にランチャーシェルスクリプト  `clion.sh`  が含まれています。 For example, if you installed CLion to  `/opt/clion` , you can run the script using the following command:

```SHELL
/opt/clion/bin/clion.sh

```

`PATH`  環境変数からディレクトリ内のランチャースクリプトへのシンボリックリンクを作成できます。 例:  `/usr/local/bin`  内に  `clion`  という名前のリンクを作成する場合は、次のコマンドを実行します。

```SHELL
ln -s /opt/clion/bin/clion.sh /usr/local/bin/clion

```

`/usr/local/bin`  はデフォルトで  `PATH`  環境変数にあるはずなので、シェルのどこからでも  `clion`  コマンドを実行できるはずです。

## Toolbox Appによって生成されたシェルスクリプト

JetBrains 製品のインストールと管理に [Toolbox App](https://www.jetbrains.com/ja-jp/toolbox/app/) を使用している場合は、シェルスクリプトを使用してコマンドラインから IDE を起動できます。

Toolbox App はシェルスクリプトを自動的に生成し、次のフォルダーに配置します:

Windows:

```GENERIC
%LOCALAPPDATA%\JetBrains\Toolbox\scripts
```

By default, the Toolbox App puts shell scripts in a directory from the system  `PATH`  environment variable, so you can run the name of the script as a command to launch CLion from any working directory.

Procedure: シェルスクリプトの場所を変更する

1. Toolbox App を開き、右上の   Toolbox App メニュー   アイコンをクリックして、   設定   を選択します。

![Toolbox App メニューアイコン](https://resources.jetbrains.com/help/img/idea/2026.3/toolbox_app_menu_icon.png)

2. 設定   タブで、   ツール   セクションを展開し、   シェルスクリプトの場所   フィールドで別のフォルダーを指定します。

![シェルスクリプトの場所の変更](https://resources.jetbrains.com/help/img/idea/2026.3/toolbox_app_shellscript_location_win.png)

Procedure: シェルスクリプトの名前を変更する

同じ IDE のバージョンが複数ある場合、Toolbox App はバージョンごとに一意の名前を持つシェルスクリプトを生成します。 この特定のインスタンスの設定で、IDE インスタンスのシェルスクリプトの名前を変更できます。

1. Toolbox App を開きます。

2. IDE インスタンスの横にある ![ツールアクション](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.more.svg) をクリックし、   設定   を選択します。

3. 構成   セクションの下部にある   シェルスクリプト名   フィールドを変更します。

![Toolbox App CLion 設定](https://resources.jetbrains.com/help/img/idea/2026.3/cl_toolbox_app_instance_settings_win.png)

macOS:

```GENERIC
/usr/local/bin
```

または

```GENERIC
~/Library/Application Support/JetBrains/Toolbox/scripts
```

By default, the Toolbox App puts shell scripts in a directory from the system  `PATH`  environment variable, so you can run the name of the script as a command to launch CLion from any working directory.

Procedure: シェルスクリプトの場所を変更する

1. Toolbox App を開き、右上の   Toolbox App メニュー   アイコンをクリックして、   設定   を選択します。

![Toolbox App メニューアイコン](https://resources.jetbrains.com/help/img/idea/2026.3/toolbox_app_menu_icon.png)

2. 設定   タブで、   ツール   セクションを展開し、   シェルスクリプトの場所   フィールドで別のフォルダーを指定します。

![シェルスクリプトの場所の変更](https://resources.jetbrains.com/help/img/idea/2026.3/toolbox_app_shellscript_location.png)

Procedure: シェルスクリプトの名前を変更する

同じ IDE のバージョンが複数ある場合、Toolbox App はバージョンごとに一意の名前を持つシェルスクリプトを生成します。 この特定のインスタンスの設定で、IDE インスタンスのシェルスクリプトの名前を変更できます。

1. Toolbox App を開きます。

2. IDE インスタンスの横にある ![ツールアクション](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.more.svg) をクリックし、   設定   を選択します。

3. 構成   セクションの下部にある   シェルスクリプト名   フィールドを変更します。

![Toolbox App CLion 設定](https://resources.jetbrains.com/help/img/idea/2026.3/cl_toolbox_app_instance_settings.png)

Linux:

```GENERIC
~/.local/share/JetBrains/Toolbox/scripts
```

By default, the Toolbox App puts shell scripts in a directory from the system  `PATH`  environment variable, so you can run the name of the script as a command to launch CLion from any working directory.

Procedure: シェルスクリプトの場所を変更する

1. Toolbox App を開き、右上の   Toolbox App メニュー   アイコンをクリックして、   設定   を選択します。

![Toolbox App メニューアイコン](https://resources.jetbrains.com/help/img/idea/2026.3/toolbox_app_menu_icon.png)

2. 設定   タブで、   ツール   セクションを展開し、   シェルスクリプトの場所   フィールドで別のフォルダーを指定します。

![シェルスクリプトの場所の変更](https://resources.jetbrains.com/help/img/idea/2026.3/toolbox_app_shellscript_location_linux.png)

Procedure: シェルスクリプトの名前を変更する

同じ IDE のバージョンが複数ある場合、Toolbox App はバージョンごとに一意の名前を持つシェルスクリプトを生成します。 この特定のインスタンスの設定で、IDE インスタンスのシェルスクリプトの名前を変更できます。

1. Toolbox App を開きます。

2. IDE インスタンスの横にある ![ツールアクション](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.more.svg) をクリックし、   設定   を選択します。

3. 構成   セクションの下部にある   シェルスクリプト名   フィールドを変更します。

![Toolbox App CLion 設定](https://resources.jetbrains.com/help/img/idea/2026.3/cl_toolbox_app_instance_settings_linux.png)

## コマンドライン引数

ランチャースクリプトは、コマンド、オプション、その他の引数を受け入れて、その動作を変更します。 Without any arguments, the script launches CLion. If you specify the path to a file or directory, CLion will open the specified file or directory. 詳細については、 [コマンドラインからファイルを開く](opening-files-from-command-line.html)を参照してください。

### コマンド

`diff`
: 差分ビューアーを開いて、指定された 2 つのファイルの違いを確認します。
:
:
:
: 詳細については、 [コマンドラインからファイルを比較する](command-line-differences-viewer.html)を参照してください。

`merge`
: マージします   ダイアログを開いて、指定したファイルをマージします。
:
:
:
: 詳細については、 [コマンドラインからファイルをマージする](command-line-merge-tool.html)を参照してください。

`format`
: 指定したファイルにコードスタイルのフォーマットを適用します。
:
:
:
: 詳細については、 [コマンドラインからファイルをフォーマットする](command-line-formatter.html)を参照してください。

`inspect`
: 指定したプロジェクトでコードインスペクションを実行します。
:
:
:
: 詳細については、 [コマンドラインからコードインスペクションを実行する](command-line-code-inspector.html)を参照してください。

`installPlugins`
: [JetBrains Marketplace](https://plugins.jetbrains.com/) または [カスタムプラグインリポジトリ](managing-plugins.html#repos) からプラグイン ID でプラグインをインストールします。
:
:
:
: 詳細については、 [コマンドラインからプラグインをインストールする](install-plugins-from-the-command-line.html)を参照してください。

### オプション

`nosplash`
: CLion のロード時にスプラッシュ画面を表示しません。

`dontReopenProjects`
: プロジェクトを再度開かず、ようこそ画面を表示します。 This can help if a project that was open crashes CLion.

`disableNonBundledPlugins`
: Launch CLion without loading manually installed plugins. このオプションでは、プラグインが削除されたり、永久に無効になったりすることはありません。 This can help if a plugin that you installed crashes CLion. IDE を起動して、問題のあるプラグインを無効にするかアンインストールすることができます。

`--wait`
: コマンドプロンプトに戻る前に、ファイルが閉じられるのを待ちます。
:
:
:
: 例: 次のコマンドで  `file.txt`  を開くことができます。
:
: `clion --wait file.txt`
:
: シェルは  `file.txt`  が閉じられるまで待機します。

