> For the complete documentation index, see [llms.txt](https://help.autify.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.autify.com/nocode-web/autify-university/integrations/autify-command-line-interface.md). Agents can also search and read this documentation through its [MCP server](https://help.autify.com/~gitbook/mcp).

# Autify Command Line Interface (CLI)

Autify Command Line Interface (CLI) はテキストベースのコマンドラインによってAutify のサービス達とやりとりするためのソフトウェアです。このAutify CLI によって、ブラウザを立ち上げることなくAutify を操作できるので、CI/CD 連携といった自動連携を簡単に行うことができます。

このドキュメントでは、Autify CLI の基礎からコマンドの一覧について解説しています。

![](https://50135409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fof7cb8AGXhWvWThq3R0w%2Fuploads%2Fgit-blob-a04e6a1dce394f8ab6bba99b0d8c3dc3120df639%2FAutify_CLI_ogp\(1\).png?alt=media)

## はじめてみよう <a href="#getting-started" id="getting-started"></a>

### 要約

Autify CLI はAutify のシステムに対してブラウザUI 以外のもう一つのインターフェースを提供します。テキストベースのコマンドラインインターフェースによって、Autify との自動連携を容易に行うことができます。

Autify CLI を利用するためには、まずお使いのプラットフォームにAutify CLI をインストールする必要があります。次に、Autify のパーソナルアクセストークンを使ってCLI をログインさせると、Autify CLI が提供する"テストシナリオを実行して終了するまで待つ" といった便利なコマンドを使うことができるようになります。次のいくつかのセクションでこのプロセスを実際に試してみましょう。

### インストール

Autify CLI はHomebrew (Linux/macOS)、shell installer (Linux/macOS)、またはnative installer (macOS/Windows) を使ってインストール可能です。また、tarball を直接インストールすることも可能です。

#### Homebrew

Linux と macOS では、[Homebrew](https://brew.sh/) とAutify の[tap](https://github.com/autifyhq/homebrew-tap) を使うことで、`autify-cli` をインストールできます:

```shell
brew install autifyhq/tap/autify-cli
```

または

```shell
brew tap autifyhq/tap
brew install autify-cli
```

出力例:

```sh-session
$ brew install autifyhq/tap/autify-cli
==> Tapping autifyhq/tap
Cloning into '/usr/local/Homebrew/Library/Taps/autifyhq/homebrew-tap'...
remote: Enumerating objects: 19, done.
remote: Counting objects: 100% (19/19), done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 19 (delta 1), reused 19 (delta 1), pack-reused 0
Receiving objects: 100% (19/19), done.
Resolving deltas: 100% (1/1), done.
Tapped 1 formula (16 files, 12.9KB).
==> Cloning https://github.com/autifyhq/autify-cli
Cloning into '/Users/runner/Library/Caches/Homebrew/autify-cli--git'...
==> Checking out revision b03bec6
HEAD is now at b03bec6 Release 0.2.0
==> Installing autify-cli from autifyhq/tap
==> curl https://autify-cli-assets.s3.amazonaws.com/autify-cli/versions/0.2.0/b03bec6/autify-v0.2.0-b03bec6-darwin-arm64.tar.gz | tar xz
🍺  /usr/local/Cellar/autify-cli/0.2.0: 10,082 files, 98.7MB, built in 29 seconds
```

#### Shell installer

Linux と macOS では、shell installer を以下のコマンドで利用できます:

```shell
curl https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-standalone.sh | sh
```

出力例:

```sh-session
$ curl https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-standalone.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2049  100  2049    0     0  10784      0 --:--:-- --:--:-- --:--:-- 10784
This script requires superuser access.
You will be prompted for your password by sudo.
Installing CLI from https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/autify-linux-x64.tar.xz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 21.9M  100 21.9M    0     0  2157k      0  0:00:10  0:00:10 --:--:-- 2588k
v16.15.0
autify installed to /usr/local/bin/autify
autify-cli/0.1.0 linux-x64 node-v16.15.0
```

#### Native installer <a href="#native-installer" id="native-installer"></a>

macOS と Windows では、native installer を提供しています。

注: これらは現時点では正しく署名されていません。そのため、インストール時にいくつかの警告が出ます。適切に署名したものを近いうちに出す予定です。

| OS      | Architecture | Package type | Download Link                                                                                                | Note                     |
| ------- | ------------ | ------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------ |
| macOS   | Intel 64bit  | Installer    | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-x64.pkg)   | Not properly signed yet. |
| macOS   | Arm 64bit    | Installer    | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-arm64.pkg) | Not properly signed yet. |
| Windows | Intel 64bit  | Installer    | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-x64.exe)   | Not properly signed yet. |
| Windows | Intel 32bit  | Installer    | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-x86.exe)   | Not properly signed yet. |

#### Tarball

以下のtarball を提供しています:

<table data-search="false"><thead><tr><th>OS</th><th>Architecture</th><th>Package type</th><th>Download Link</th><th>Note</th></tr></thead><tbody><tr><td>Linux</td><td>Intel 64bit</td><td>tar.gz</td><td><a href="https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-linux-x64.tar.gz"><code>stable</code></a></td><td></td></tr><tr><td>Linux</td><td>Intel 64bit</td><td>tar.xz</td><td><a href="https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-linux-x64.tar.xz"><code>stable</code></a></td><td></td></tr><tr><td>Linux</td><td>Arm 32bit</td><td>tar.gz</td><td><a href="https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-linux-arm.tar.gz"><code>stable</code></a></td><td></td></tr><tr><td>Linux</td><td>Arm 32bit</td><td>tar.xz</td><td><a href="https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-linux-arm.tar.xz"><code>stable</code></a></td><td></td></tr><tr><td>Linux</td><td>Arm 64bit</td><td>tar.gz</td><td><a href="https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-linux-arm64.tar.gz"><code>stable</code></a></td><td></td></tr><tr><td>Linux</td><td>Arm 64bit</td><td>tar.xz</td><td><a href="https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-linux-arm64.tar.xz"><code>stable</code></a></td><td></td></tr><tr><td>macOS</td><td>Intel 64bit</td><td>tar.gz</td><td><a href="https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-darwin-x64.tar.gz"><code>stable</code></a></td><td></td></tr><tr><td>macOS</td><td>Intel 64bit</td><td>tar.xz</td><td><a href="https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-darwin-x64.tar.xz"><code>stable</code></a></td><td></td></tr><tr><td>macOS</td><td>Arm 64bit</td><td>tar.gz</td><td><a href="https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-darwin-arm64.tar.gz"><code>stable</code></a></td><td></td></tr><tr><td>macOS</td><td>Arm 64bit</td><td>tar.xz</td><td><a href="https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-darwin-arm64.tar.xz"><code>stable</code></a></td><td></td></tr><tr><td>Windows</td><td>Intel 64bit</td><td>tar.gz</td><td><a href="https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-win32-x64.tar.gz"><code>stable</code></a></td><td></td></tr><tr><td>Windows</td><td>Intel 64bit</td><td>tar.xz</td><td><a href="https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-win32-x64.tar.xz"><code>stable</code></a></td><td></td></tr><tr><td>Windows</td><td>Intel 32bit</td><td>tar.gz</td><td><a href="https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-win32-x86.tar.gz"><code>stable</code></a></td><td></td></tr><tr><td>Windows</td><td>Intel 32bit</td><td>tar.xz</td><td><a href="https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-win32-x86.tar.xz"><code>stable</code></a></td><td></td></tr></tbody></table>

こちらが、Linux (Intel 64bit) で`tag.gz` ファイルをダウンロードして展開するコマンドの例です:

```sh-session
$ curl -O https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-linux-x64.tar.gz

$ tar -xzf ./autify-linux-x64.tar.gz

$ ./autify/bin/autify --version
autify-cli/0.1.0 linux-x64 node-v16.15.0
```

以下の様にして、`/path/to/autify/bin/autify` を `PATH` 環境変数内のどこかにリンクすることをお勧めします:

```sh-session
$ sudo ln -s /path/to/autify/bin/autify /usr/local/bin/autify
```

注: `/path/to/autify/bin` は `node` 実行ファイルを含んでいます。従って、 `/path/to/autify/bin` を `PATH` 環境変数に追加すると、既存の`node` 実行ファイルよりも優先されてしまう可能性があります。 そのため、`/path/to/autify/bin/autify` だけをリンクすることをお勧めしていますし、shell installer はまさにそれを実行しています。

### 利用方法

まず、パーソナルアクセストークンを生成する必要があります。 [Autify NoCode Web](https://help.autify.com/nocode-web/autify-university/integrations/integrate-with-api.md#issue-a-personal-access-token) または[Autify NoCode Mobile](https://help.autify.com/nocode-mobile/using-autify-nocode-mobile/integrations/api-integration.md#api-authentication-token-generation-method) のドキュメントをご覧ください。

そうしたら、Autify CLI でログインできます。以下のコマンドを実行し、パーソナルアクセストークンを入力してください:

```sh-session
## Autify NoCode Web
$ autify web auth login
? Enter Access Token **********

## Autify NoCode Mobile
$ autify mobile auth login
? Enter Access Token **********
```

#### Autify NoCode Web

では、すでにお持ちのテストシナリオを実行してみましょう。今から実行したいテストシナリオのURLをコピーしてください。(この様な形式のはずです: `https://app.autify.com/projects/000/scenarios/00000`) その後に以下を実行してください:

```shell
autify web test run --wait <コピーしたテストシナリオURL>
```

出力例:

```sh-session
$ autify web test run --wait https://app.autify.com/projects/000/scenarios/00000
✅ Successfully started: https://app.autify.com/projects/000/results/000000 (Capability is Linux Chrome 101.0)
🕐 Waiting for the test result: https://app.autify.com/projects/000/results/000000
  ✔ Waiting... (timeout: 300 s)
✅ Test passed!: https://app.autify.com/projects/000/results/000000

$ echo $?
0
```

このコマンドは、そのテストシナリオをデフォルト環境 (Linux/Chrome) で実行し、(デフォルトでは5分の)タイムアウトをするまでテストが終了するのを待ちます。もしパスしていたら、コマンドは終了コード`0` で終了します。そうでなければ、`0` 以外の終了コードで終了します。結果は上の`$?`の出力で見ることができます。

#### Autify NoCode Mobile

もしAutify NoCode Mobile をご利用でしたら、Autify NoCode Webとほぼ同じ様にテストプランを実行することができます。今から実行したいテストプランのURL をコピーして (この様な形式のはずです: `https://mobile-app.autify.com/projects/AAA/test_plans/BBB`)、テストしたいアプリケーションのビルドファイルのファイルパス(iOS なら`*.ipa`、Android なら`*.apk` )もコピーして下さい。その後に以下を実行してください:

```shell
autify mobile test run --wait --build-path <コピーしたビルドファイルパス> <コピーしたテストプランURL>
```

```sh-session
$ autify mobile test run --wait --build-path /path/to/android.apk https://mobile-app.autify.com/projects/AAA/test_plans/BBB
✅ Successfully uploaded android.apk (ID: CCC). See https://mobile-app.autify.com/projects/AAA/builds?os=android&selectedBuildId=CCC&page=1
✅ Successfully started: https://mobile-app.autify.com/projects/AAA/results/DDD
🕐 Waiting for the test result: https://mobile-app.autify.com/projects/AAA/results/DDD
  ✔ Waiting... (timeout: 300 s)
✅ Test passed!: https://mobile-app.autify.com/projects/AAA/results/DDD

$ echo $?
0
```

このコマンドは、指定したビルドファイルをアップロードし、そのアップロードしたビルドを使ってテストプランを実行し、(デフォルトでは5分の)タイムアウトをするまでテストが終了するのを待ちます。もしパスしていたら、コマンドは終了コード`0` で終了します。そうでなければ、`0` 以外の終了コードで終了します。結果は上の`$?`の出力で見ることができます。

## 更新

Autify CLI はチャンネルリリースで更新していて、都度再インストールする必要がありません。デフォルトで`stable` チャンネルが使われていて、以下を実行することでAutify CLI を最新にすることができます:

```sh-session
$ autify update
autify-cli: Updating CLI from 0.0.0-aaaaaa to 0.1.0-bbbbbb... done
```

注: Homebrew をお使いの方はこのコマンドを使わずにHomebrew に更新させた方が良いです。全ての`stable` リリースは[tap](https://github.com/autifyhq/homebrew-tap) にも自動的に反映されるので、以下のコマンドだけで最新に更新することができます:

```sh-session
$ brew upgrade autify-cli
```

注: `beta` チャンネルとリリース候補のチャンネルも存在して、リリース前のバージョンを試すことができますが、多くの場合`stable` チャンネルで十分です。

## 設定

設定ファイルは`~/.config/autify/config.env` (macOS or Linux) / `%LOCALAPPDATA%\autify\config.env` (Windows) に保存されます。設定ファイルのベースディレクトリは`XDG_CONFIG_HOME` 環境変数で変更することも可能です。

全ての設定は環境変数の形をしているので、同じ名前の環境変数を実行時に与えることでいつでも別の設定を利用して実行できます。例: `AUTIFY_WEB_ACCESS_TOKEN=mytoken autify web test run ...`

4つの設定が利用できます:

### AUTIFY\_WEB\_ACCESS\_TOKEN

Autify NoCode Web に認証するためのパーソナルアクセストークン。

### AUTIFY\_WEB\_BASE\_PATH

Autify NoCode Web と通信する際のAPI ベースパス。デフォルトは `https://app.autify.com/api/v1`

### AUTIFY\_MOBILE\_ACCESS\_TOKEN

Autify NoCode Mobile に認証するためのパーソナルアクセストークン。

### AUTIFY\_MOBILE\_BASE\_PATH

Autify NoCode Mobile と通信する際のAPI ベースパス。デフォルトは `https://mobile-app.autify.com/api/v1`

## コマンド

こちらがコマンドの一覧になります。これらは、Autify のAPI 仕様を知る必要なく簡単に使えるように設計されています。多くのユースケースをサポートしていて、今後もコマンドや機能の追加を続けて改善していきます。特定のユースケースに対する新しいコマンドが必要でしたら、[GitHub Issues](https://github.com/autifyhq/autify-cli/issues) で自由にリクエストをお願いします。

### Autify NoCode Web

#### `autify web auth login`

このコマンドは、対話的または非対話的にCLI をAutify NoCode Web にログインさせます。

より詳しい情報は [GitHub](https://github.com/autifyhq/autify-cli#autify-web-auth-login) をご覧ください。

#### `autify web test run`

このコマンドは作成済のテストシナリオかテストプランを、環境やURL 置換などの多数のオプションを指定して実行できます。更に、テストが終了するまで待つ`--wait` オプションもサポートしています。

より詳しい情報は [GitHub](https://github.com/autifyhq/autify-cli#autify-web-test-run-scenario-or-test-plan-url) をご覧ください。

#### `autify web test wait`

このコマンドは既にリクエスト済みのテストシナリオかテストプランを、終了するまで待ちます。ただし、ほとんどの場合は`autify web test run --wait` を代わりに使うことになるでしょう。

より詳しい情報は [GitHub](https://github.com/autifyhq/autify-cli#autify-web-test-wait-test-result-url) をご覧ください。

### Autify NoCode Mobile

#### `autify mobile auth login`

このコマンドは、対話的または非対話的にCLI をAutify NoCode Mobile にログインさせます。

より詳しい情報は [GitHub](https://github.com/autifyhq/autify-cli#autify-mobile-auth-login) をご覧ください。

#### `autify mobile build upload`

このコマンドは新しいビルドファイルをAutify NoCode Mobile にアップロードして、ビルドID を返してくれます。

より詳しい情報は [GitHub](https://github.com/autifyhq/autify-cli#autify-mobile-build-upload-build-path) をご覧ください。

#### `autify mobile test run`

このコマンドは作成済のテストプランを、新しいビルドファイルか既にアップロード済みのビルドID をオプションで指定して実行できます。更に、テストが終了するまで待つ`--wait` オプションもサポートしています。

より詳しい情報は [GitHub](https://github.com/autifyhq/autify-cli#autify-mobile-test-run-test-plan-url) をご覧ください。

#### `autify mobile test wait`

このコマンドは既にリクエスト済みのテストプランを、終了するまで待ちます。ただし、ほとんどの場合は`autify mobile test run --wait` を代わりに使うことになるでしょう。

より詳しい情報は [GitHub](https://github.com/autifyhq/autify-cli#autify-mobile-test-wait-test-result-url) をご覧ください。

### API コマンド

`api` という名前空間以下にあるコマンド(`autify web api` と`autify mobile api`)は、Autify のAPI 仕様から自動生成されたものなのでここには意図的に表示していません。もし詳細を知りたければ、[GitHub](https://github.com/autifyhq/autify-cli) をご覧ください。`api` コマンドを使って複数のAPI を組み合わせるユースケースがあれば、他のユーザも同じロジックを利用できるように、ぜひそれをユースケース特化したコマンドとして`autify web test run` の様に実装したいと考えています。皆さんのアイデアを[GitHub Issues](https://github.com/autifyhq/autify-cli/issues) でぜひ共有してください。

## CI/CD 連携

Autify CLI をベースにしたAutify 公式のCI/CD 連携に関するドキュメントがいくつかあります。CI/CD 連携とはどんなもので、どういった連携をAutify が持っているかについて理解するには、[Autify でCI/CD](https://help.autify.com/nocode-web/autify-university/integrations/cicd-with-autify.md) をご覧下さい。

## 貢献

Autify CLI はオープンソースソフトウェアとして [GitHub](https://github.com/autifyhq/autify-cli) でホストしています。貢献方法についてのガイダンスを近いうちに出す予定です。


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.autify.com/nocode-web/autify-university/integrations/autify-command-line-interface.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
