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

# base44 functions deploy

> ローカルの関数定義を Base44 にデプロイします。

<Warning>
  このページは AI コーディングエージェントスキルの一部で、人間ではなくエージェント向けに書かれています。人間向けの Base44 ドキュメントは [デベロッパードキュメント](/developers) を参照してください。
</Warning>

# base44 functions deploy

ローカルの関数定義を Base44 にデプロイします。

## 構文

```bash theme={null}
npx base44 functions deploy [names...] [options]
```

## オプション

| オプション        | 説明                                          | 必須  |
| ------------ | ------------------------------------------- | --- |
| `[names...]` | デプロイする 1 つ以上の関数名 (省略時はすべてデプロイ)              | いいえ |
| `--force`    | ローカルに存在しないリモート関数を削除 (`[names...]` と組み合わせ不可) | いいえ |

## 認証

**必須**: はい。認証されていない場合は、先にログインを求められます。

## 動作

1. `base44/functions/` ディレクトリを関数定義でスキャンします
2. `entry.ts`/`entry.js` ファイルから関数を検出します
3. デプロイする関数の数を表示します
4. 関数コードを Base44 に順次アップロードします
5. デプロイ、変更なし、失敗の数を報告します
6. `--force` を使用した場合: ローカルに存在しないリモート関数も削除します

## 前提条件

* Base44 プロジェクトディレクトリから実行する必要があります
* プロジェクトの `base44/functions/` フォルダーに関数定義が存在する必要があります
* 各関数は `entry.ts` または `entry.js` を含むフォルダーである必要があります

## 例

```bash theme={null}
# Deploy all functions
npx base44 functions deploy

# Deploy specific functions
npx base44 functions deploy process-order send-notification

# Deploy all and delete functions removed locally
npx base44 functions deploy --force
```

## 出力

```bash theme={null}
$ npx base44 functions deploy

◆ Found 2 functions to deploy
◇ [1/2] Deploying process-order...
✓ process-order               deployed
◇ [2/2] Deploying send-notification...
✓ send-notification           deployed

└ 2 deployed
```

`--force` 付き:

```bash theme={null}
$ npx base44 functions deploy --force

◆ Found 2 functions to deploy
...

◆ Found 1 remote function to delete
◇ [1/1] Deleting old-function...
✓ old-function                deleted

◆ 1 deleted

└ 2 deployed
```

## 終了コード

* **終了コード 0**: すべての関数が正常にデプロイされた (または変更なし)
* **終了コード 1**: 1 つ以上の関数のデプロイが失敗

いずれかの関数が失敗した場合、コマンドは完全なデプロイサマリーを出力し、終了コード 1 で終了します。これにより、部分的な失敗がビルドをブロックすべき CI パイプラインで安全に使用できます。

## エラー処理

プロジェクトに関数が見つからない場合:

```bash theme={null}
$ npx base44 functions deploy
No functions found. Create functions in the 'functions' directory.
```

`--force` が関数名と組み合わされた場合:

```bash theme={null}
$ npx base44 functions deploy my-func --force
error: --force cannot be used when specifying function names
```

指定した関数名がローカルに存在しない場合:

```bash theme={null}
$ npx base44 functions deploy nonexistent
error: Function not found in project: nonexistent
```

## ユースケース

* プロジェクトで新しい関数を作成した後
* 既存の関数コードを変更するとき
* テスト前に関数の変更を同期するために
* バックエンドロジックが変わる開発ワークフローの一部として
* ローカルで削除されたリモート関数をクリーンアップするために `--force` を使用

## 注意事項

* このコマンドは関数コードをデプロイします
* 変更は Base44 プロジェクトに即座に適用されます
* 関数ごとのデプロイ結果: `deployed`, `unchanged`, または `error`
* `--force` は特定の関数名と組み合わせることはできません
* まず開発環境で関数をテストしてください
* 関数定義は `base44/functions/` ディレクトリにあります
* 関数には `entry.ts` または `entry.js` を使用します
* 関数の作成方法については [functions-create.md](https://docs.base44.com/developers/skills/base44-cli/references/functions-create.md) を参照

<Note>このページは AI を使用して翻訳されました。最も正確で最新の情報については、[英語版](/) を参照してください。 </Note>
