

Amazon CodeCatalyst は新規のお客様には提供されなくなりました。既存のお客様は、通常どおりサービスを引き続き使用できます。詳細については、「[CodeCatalyst から移行する方法](migration.md)」を参照してください。

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# Devfile コマンド
<a name="devenvironment-devfile-commands"></a>

現在、CodeCatalyst は devfile 内の`exec`コマンドのみをサポートしています。詳細については、Devfile.io ドキュメントの「Adding commands」を参照してください。

次の例は、devfile で `exec` コマンドを指定する方法を示しています。

```
commands:
  - id: setupscript
    exec:
      component: test
      commandLine: "chmod +x script.sh"
      workingDir: /projects/devfiles
  - id: executescript
    exec:
      component: test
      commandLine: "./projects/devfiles/script.sh"
  - id: updateyum
    exec:
      component: test
      commandLine: "yum -y update --security"
```

開発環境に接続したら、ターミナルから定義済みのコマンドを実行できます。

```
/aws/mde/mde command <command-id>
/aws/mde/mde command executescript
```

長時間実行されるコマンドの場合、ストリーミングフラグ `-s` を使用してコマンドの実行をリアルタイムで出力できます。

```
/aws/mde/mde -s command <command-id>
```

**注記**  
`command-id` には小文字を使用する必要があります。

## CodeCatalyst でサポートされている Exec パラメータ
<a name="devenvironment-exec-support"></a>

CodeCatalyst は、devfile バージョン 2.0.0 で次の `exec` パラメータをサポートしています。
+ `commandLine`
+ `component`
+ `id`
+ `workingDir`