> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squarecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Commit と Upload

> このセクションでは、Client、Application、CLI を使って commit と upload を行う方法を学びます。

commit と upload は Client または Application を使って行えます。
`squarecloud.File` オブジェクトを用意し、
zip ファイルのパスを渡すだけです。

## commit を行う

<Tabs>
  <Tab title="Client を使う">
    ```python theme={null}
    import squarecloud as square

    client = square.Client('API_KEY')

    async def example():
        file = square.File('path/to/you/file.zip')
        await client.commit(file=file, app_id='application_id')
    ```
  </Tab>

  <Tab title="Application を使う">
    ```python theme={null}
    import squarecloud as square

    client = square.Client('API_KEY')

    async def example():
        app = await client.app(app_id='application_id')
        file = square.File('path/to/you/file.zip')
        await app.commit(file=file)
    ```
  </Tab>
</Tabs>

## upload を行う

アプリケーションを upload するには、\[Client] のみを使えます。

<Tabs>
  <Tab title="Client を使う">
    ```python theme={null}
    import squarecloud as square

    client = square.Client(...)

    async def example():
        file = square.File('path/to/you/file.zip')
        await client.upload_app(file=file)
    ```
  </Tab>
</Tabs>

**アプリケーションを upload するには、（少なくとも）以下のファイルを含む zip が必要であることを忘れないでください:**

* メインファイル: アプリケーションの起動を担当します
* 依存関係ファイル: どの依存関係が必要かに関する情報を含みます
* 設定ファイル (squarecloud.app): 名前、
  説明、
  メインファイル名、バージョンなどを指定する設定ファイルです。設定ファイルの
  詳細については、この[ガイド](https://docs.squarecloud.app/ja/getting-started/config-file)をご覧ください。

<Tip>
  利便性のため、この設定ファイルを作成するクラスが追加されています:
  `squarecloud.utils.ConfigFile`。
</Tip>
