Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/cli-reference.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
| `--repo <owner/repo>` | リポジトリを指定(PR 作成用) |
| `--create-worktree <yes\|no>` | worktree 確認プロンプトをスキップ |
| `-q, --quiet` | 最小出力モード: AI 出力を抑制(CI 向け) |
| `--provider <name>` | エージェント provider を上書き(claude\|codex\|opencode\|mock) |
| `--provider <name>` | エージェント provider を上書き(claude\|codex\|opencode\|cursor\|mock) |
| `--model <name>` | エージェントモデルを上書き |
| `--config <path>` | グローバル設定ファイルのパス(デフォルト: `~/.takt/config.yaml`|

Expand Down
2 changes: 1 addition & 1 deletion docs/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This document provides a complete reference for all TAKT CLI commands and option
| `--repo <owner/repo>` | Specify repository (for PR creation) |
| `--create-worktree <yes\|no>` | Skip worktree confirmation prompt |
| `-q, --quiet` | Minimal output mode: suppress AI output (for CI) |
| `--provider <name>` | Override agent provider (claude\|codex\|opencode\|mock) |
| `--provider <name>` | Override agent provider (claude\|codex\|opencode\|cursor\|mock) |
| `--model <name>` | Override agent model |
| `--config <path>` | Path to global config file (default: `~/.takt/config.yaml`) |

Expand Down
32 changes: 21 additions & 11 deletions docs/configuration.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
language: en # UI 言語: 'en' または 'ja'
default_piece: default # 新規プロジェクトのデフォルト piece
log_level: info # ログレベル: debug, info, warn, error
provider: claude # デフォルト provider: claude, codex, または opencode
provider: claude # デフォルト provider: claude, codex, opencode, または cursor
model: sonnet # デフォルトモデル(省略可、provider にそのまま渡される)
branch_name_strategy: romaji # ブランチ名生成方式: 'romaji'(高速)または 'ai'(低速)
prevent_sleep: false # 実行中に macOS のアイドルスリープを防止(caffeinate)
Expand Down Expand Up @@ -56,10 +56,11 @@ interactive_preview_movements: 3 # インタラクティブモードでの move
# default_permission_mode: edit

# API キー設定(省略可)
# 環境変数 TAKT_ANTHROPIC_API_KEY / TAKT_OPENAI_API_KEY / TAKT_OPENCODE_API_KEY で上書き可能
# 環境変数 TAKT_ANTHROPIC_API_KEY / TAKT_OPENAI_API_KEY / TAKT_OPENCODE_API_KEY / TAKT_CURSOR_API_KEY で上書き可能
# anthropic_api_key: sk-ant-... # Claude(Anthropic)用
# openai_api_key: sk-... # Codex(OpenAI)用
# opencode_api_key: ... # OpenCode 用
# cursor_api_key: ... # Cursor Agent 用(省略時は login セッションにフォールバック)

# Codex CLI パス上書き(省略可)
# Codex SDK が使用する Codex CLI バイナリを上書き(実行可能ファイルの絶対パスが必要)
Expand Down Expand Up @@ -88,7 +89,7 @@ interactive_preview_movements: 3 # インタラクティブモードでの move
| `language` | `"en"` \| `"ja"` | `"en"` | UI 言語 |
| `default_piece` | string | `"default"` | 新規プロジェクトのデフォルト piece |
| `log_level` | `"debug"` \| `"info"` \| `"warn"` \| `"error"` | `"info"` | ログレベル |
| `provider` | `"claude"` \| `"codex"` \| `"opencode"` | `"claude"` | デフォルト AI provider |
| `provider` | `"claude"` \| `"codex"` \| `"opencode"` \| `"cursor"` | `"claude"` | デフォルト AI provider |
| `model` | string | - | デフォルトモデル名(provider にそのまま渡される) |
| `branch_name_strategy` | `"romaji"` \| `"ai"` | `"romaji"` | ブランチ名生成方式 |
| `prevent_sleep` | boolean | `false` | macOS アイドルスリープ防止(caffeinate) |
Expand All @@ -108,6 +109,7 @@ interactive_preview_movements: 3 # インタラクティブモードでの move
| `anthropic_api_key` | string | - | Claude 用 Anthropic API キー |
| `openai_api_key` | string | - | Codex 用 OpenAI API キー |
| `opencode_api_key` | string | - | OpenCode API キー |
| `cursor_api_key` | string | - | Cursor API キー(省略時は login セッションへフォールバック) |
| `codex_cli_path` | string | - | Codex CLI バイナリパス上書き(絶対パス) |
| `enable_builtin_pieces` | boolean | `true` | ビルトイン piece の有効化 |
| `disabled_builtins` | string[] | `[]` | 無効化する特定のビルトイン piece |
Expand Down Expand Up @@ -149,7 +151,7 @@ concurrency: 2 # このプロジェクトでの takt run 並列
| フィールド || デフォルト | 説明 |
|-----------|------|---------|------|
| `piece` | string | `"default"` | このプロジェクトの現在の piece 名 |
| `provider` | `"claude"` \| `"codex"` \| `"opencode"` \| `"mock"` | - | provider 上書き |
| `provider` | `"claude"` \| `"codex"` \| `"opencode"` \| `"cursor"` \| `"mock"` | - | provider 上書き |
| `model` | string | - | モデル名の上書き(provider にそのまま渡される) |
| `auto_pr` | boolean | - | worktree 実行後に PR を自動作成 |
| `verbose` | boolean | - | 詳細出力モード |
Expand All @@ -162,7 +164,7 @@ concurrency: 2 # このプロジェクトでの takt run 並列

## API キー設定

TAKT は3つの provider をサポートしており、それぞれに API キーが必要です。API キーは環境変数または `~/.takt/config.yaml` で設定できます
TAKT は4つの provider をサポートしています。Claude/Codex/OpenCode は API キーを使い、Cursor は API キーまたは `cursor-agent login` セッションで認証できます

### 環境変数(推奨)

Expand All @@ -175,6 +177,9 @@ export TAKT_OPENAI_API_KEY=sk-...

# OpenCode 用
export TAKT_OPENCODE_API_KEY=...

# Cursor Agent 用(cursor-agent login 済みなら省略可)
export TAKT_CURSOR_API_KEY=...
```

### 設定ファイル
Expand All @@ -184,6 +189,7 @@ export TAKT_OPENCODE_API_KEY=...
anthropic_api_key: sk-ant-... # Claude 用
openai_api_key: sk-... # Codex 用
opencode_api_key: ... # OpenCode 用
cursor_api_key: ... # Cursor Agent 用(省略可)
```
### 優先順位
Expand All @@ -195,12 +201,14 @@ opencode_api_key: ... # OpenCode 用
| Claude (Anthropic) | `TAKT_ANTHROPIC_API_KEY` | `anthropic_api_key` |
| Codex (OpenAI) | `TAKT_OPENAI_API_KEY` | `openai_api_key` |
| OpenCode | `TAKT_OPENCODE_API_KEY` | `opencode_api_key` |
| Cursor Agent | `TAKT_CURSOR_API_KEY` | `cursor_api_key` |

### セキュリティ

- `config.yaml` に API キーを記載する場合、このファイルを Git にコミットしないよう注意してください。
- 環境変数の使用を検討してください。
- 必要に応じて `~/.takt/config.yaml` をグローバル `.gitignore` に追加してください。
- Cursor provider は `cursor-agent login` が済んでいれば API キーなしでも動作できます。
- API キーを設定すれば、対応する CLI ツール(Claude Code、Codex、OpenCode)のインストールは不要です。TAKT が対応する API を直接呼び出します。

### Codex CLI パス上書き
Expand All @@ -224,7 +232,7 @@ codex_cli_path: /usr/local/bin/codex

1. **Piece movement の `model`** - piece YAML の movement 定義で指定
2. **グローバル設定の `model`** - `~/.takt/config.yaml` のデフォルトモデル
3. **Provider デフォルト** - provider のビルトインデフォルトにフォールバック(Claude: `sonnet`、Codex: `codex`、OpenCode: provider デフォルト)
3. **Provider デフォルト** - provider のビルトインデフォルトにフォールバック(Claude: `sonnet`、Codex: `codex`、OpenCode: provider デフォルト、Cursor: CLI デフォルト

### Provider 固有のモデルに関する注意

Expand All @@ -234,6 +242,8 @@ codex_cli_path: /usr/local/bin/codex

**OpenCode** は `provider/model` 形式のモデル(例: `opencode/big-pickle`)が必要です。OpenCode provider でモデルを省略すると設定エラーになります。

**Cursor Agent** は `model` を `cursor-agent --model <model>` にそのまま渡します。省略時は Cursor CLI のデフォルトが使用されます。

### 設定例

```yaml
Expand Down Expand Up @@ -261,11 +271,11 @@ Provider プロファイルを使用すると、各 provider にデフォルト

TAKT は provider 非依存の3つのパーミッションモードを使用します。

| モード | 説明 | Claude | Codex | OpenCode |
|--------|------|--------|-------|----------|
| `readonly` | 読み取り専用、ファイル変更不可 | `default` | `read-only` | `read-only` |
| `edit` | 確認付きでファイル編集を許可 | `acceptEdits` | `workspace-write` | `workspace-write` |
| `full` | すべてのパーミッションチェックをバイパス | `bypassPermissions` | `danger-full-access` | `danger-full-access` |
| モード | 説明 | Claude | Codex | OpenCode | Cursor Agent |
|--------|------|--------|-------|----------|--------------|
| `readonly` | 読み取り専用、ファイル変更不可 | `default` | `read-only` | `read-only` | デフォルトフラグ(`--force` なし) |
| `edit` | 確認付きでファイル編集を許可 | `acceptEdits` | `workspace-write` | `workspace-write` | デフォルトフラグ(`--force` なし) |
| `full` | すべてのパーミッションチェックをバイパス | `bypassPermissions` | `danger-full-access` | `danger-full-access` | `--force` |

### 設定方法

Expand Down
32 changes: 21 additions & 11 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Configure TAKT defaults in `~/.takt/config.yaml`. This file is created automatic
language: en # UI language: 'en' or 'ja'
default_piece: default # Default piece for new projects
log_level: info # Log level: debug, info, warn, error
provider: claude # Default provider: claude, codex, or opencode
provider: claude # Default provider: claude, codex, opencode, or cursor
model: sonnet # Default model (optional, passed to provider as-is)
branch_name_strategy: romaji # Branch name generation: 'romaji' (fast) or 'ai' (slow)
prevent_sleep: false # Prevent macOS idle sleep during execution (caffeinate)
Expand Down Expand Up @@ -56,10 +56,11 @@ interactive_preview_movements: 3 # Movement previews in interactive mode (0-10,
# default_permission_mode: edit

# API Key configuration (optional)
# Can be overridden by environment variables TAKT_ANTHROPIC_API_KEY / TAKT_OPENAI_API_KEY / TAKT_OPENCODE_API_KEY
# Can be overridden by environment variables TAKT_ANTHROPIC_API_KEY / TAKT_OPENAI_API_KEY / TAKT_OPENCODE_API_KEY / TAKT_CURSOR_API_KEY
# anthropic_api_key: sk-ant-... # For Claude (Anthropic)
# openai_api_key: sk-... # For Codex (OpenAI)
# opencode_api_key: ... # For OpenCode
# cursor_api_key: ... # For Cursor Agent (optional; login session fallback is also supported)

# Codex CLI path override (optional)
# Override the Codex CLI binary used by the Codex SDK (must be an absolute path to an executable file)
Expand Down Expand Up @@ -88,7 +89,7 @@ interactive_preview_movements: 3 # Movement previews in interactive mode (0-10,
| `language` | `"en"` \| `"ja"` | `"en"` | UI language |
| `default_piece` | string | `"default"` | Default piece for new projects |
| `log_level` | `"debug"` \| `"info"` \| `"warn"` \| `"error"` | `"info"` | Log level |
| `provider` | `"claude"` \| `"codex"` \| `"opencode"` | `"claude"` | Default AI provider |
| `provider` | `"claude"` \| `"codex"` \| `"opencode"` \| `"cursor"` | `"claude"` | Default AI provider |
| `model` | string | - | Default model name (passed to provider as-is) |
| `branch_name_strategy` | `"romaji"` \| `"ai"` | `"romaji"` | Branch name generation strategy |
| `prevent_sleep` | boolean | `false` | Prevent macOS idle sleep (caffeinate) |
Expand All @@ -108,6 +109,7 @@ interactive_preview_movements: 3 # Movement previews in interactive mode (0-10,
| `anthropic_api_key` | string | - | Anthropic API key for Claude |
| `openai_api_key` | string | - | OpenAI API key for Codex |
| `opencode_api_key` | string | - | OpenCode API key |
| `cursor_api_key` | string | - | Cursor API key (optional; login session fallback supported) |
| `codex_cli_path` | string | - | Codex CLI binary path override (absolute) |
| `enable_builtin_pieces` | boolean | `true` | Enable builtin pieces |
| `disabled_builtins` | string[] | `[]` | Specific builtin pieces to disable |
Expand Down Expand Up @@ -149,7 +151,7 @@ concurrency: 2 # Parallel task count for takt run in this project
| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `piece` | string | `"default"` | Current piece name for this project |
| `provider` | `"claude"` \| `"codex"` \| `"opencode"` \| `"mock"` | - | Override provider |
| `provider` | `"claude"` \| `"codex"` \| `"opencode"` \| `"cursor"` \| `"mock"` | - | Override provider |
| `model` | string | - | Override model name (passed to provider as-is) |
| `auto_pr` | boolean | - | Auto-create PR after worktree execution |
| `verbose` | boolean | - | Verbose output mode |
Expand All @@ -162,7 +164,7 @@ Project config values override global config when both are set.

## API Key Configuration

TAKT supports three providers, each with its own API key. API keys can be configured via environment variables or `~/.takt/config.yaml`.
TAKT supports four providers. Claude/Codex/OpenCode use API keys, and Cursor can use either API key or existing `cursor-agent login` session.

### Environment Variables (Recommended)

Expand All @@ -175,6 +177,9 @@ export TAKT_OPENAI_API_KEY=sk-...

# For OpenCode
export TAKT_OPENCODE_API_KEY=...

# For Cursor Agent (optional if cursor-agent login session exists)
export TAKT_CURSOR_API_KEY=...
```

### Config File
Expand All @@ -184,6 +189,7 @@ export TAKT_OPENCODE_API_KEY=...
anthropic_api_key: sk-ant-... # For Claude
openai_api_key: sk-... # For Codex
opencode_api_key: ... # For OpenCode
cursor_api_key: ... # For Cursor Agent (optional)
```
### Priority
Expand All @@ -195,12 +201,14 @@ Environment variables take precedence over `config.yaml` settings.
| Claude (Anthropic) | `TAKT_ANTHROPIC_API_KEY` | `anthropic_api_key` |
| Codex (OpenAI) | `TAKT_OPENAI_API_KEY` | `openai_api_key` |
| OpenCode | `TAKT_OPENCODE_API_KEY` | `opencode_api_key` |
| Cursor Agent | `TAKT_CURSOR_API_KEY` | `cursor_api_key` |

### Security

- If you write API keys in `config.yaml`, be careful not to commit this file to Git.
- Consider using environment variables instead.
- Add `~/.takt/config.yaml` to your global `.gitignore` if needed.
- Cursor provider can run without API key when `cursor-agent login` is already configured.
- If you set an API key, installing the corresponding CLI tool (Claude Code, Codex, OpenCode) is not necessary. TAKT directly calls the respective API.

### Codex CLI Path Override
Expand All @@ -224,7 +232,7 @@ The model used for each movement is resolved with the following priority order (

1. **Piece movement `model`** - Specified in the movement definition in piece YAML
2. **Global config `model`** - Default model in `~/.takt/config.yaml`
3. **Provider default** - Falls back to the provider's built-in default (Claude: `sonnet`, Codex: `codex`, OpenCode: provider default)
3. **Provider default** - Falls back to the provider's built-in default (Claude: `sonnet`, Codex: `codex`, OpenCode: provider default, Cursor: CLI default)

### Provider-specific Model Notes

Expand All @@ -234,6 +242,8 @@ The model used for each movement is resolved with the following priority order (

**OpenCode** requires a model in `provider/model` format (e.g., `opencode/big-pickle`). Omitting the model for the OpenCode provider will result in a configuration error.

**Cursor Agent** forwards `model` directly to `cursor-agent --model <model>`. If omitted, Cursor CLI default is used.

### Example

```yaml
Expand Down Expand Up @@ -261,11 +271,11 @@ Provider profiles allow you to set default permission modes and per-movement per

TAKT uses three provider-independent permission modes:

| Mode | Description | Claude | Codex | OpenCode |
|------|-------------|--------|-------|----------|
| `readonly` | Read-only access, no file modifications | `default` | `read-only` | `read-only` |
| `edit` | Allow file edits with confirmation | `acceptEdits` | `workspace-write` | `workspace-write` |
| `full` | Bypass all permission checks | `bypassPermissions` | `danger-full-access` | `danger-full-access` |
| Mode | Description | Claude | Codex | OpenCode | Cursor Agent |
|------|-------------|--------|-------|----------|--------------|
| `readonly` | Read-only access, no file modifications | `default` | `read-only` | `read-only` | default flags (no `--force`) |
| `edit` | Allow file edits with confirmation | `acceptEdits` | `workspace-write` | `workspace-write` | default flags (no `--force`) |
| `full` | Bypass all permission checks | `bypassPermissions` | `danger-full-access` | `danger-full-access` | `--force` |

### Configuration

Expand Down
5 changes: 4 additions & 1 deletion docs/testing/e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ E2Eテストを追加・変更した場合は、このドキュメントも更
## 前提条件
- `gh` CLI が利用可能で、対象GitHubアカウントでログイン済みであること。
- `takt-testing` リポジトリが対象アカウントに存在すること(E2Eがクローンして使用)。
- 必要に応じて `TAKT_E2E_PROVIDER` を設定すること(例: `claude` / `codex` / `opencode`)。
- 必要に応じて `TAKT_E2E_PROVIDER` を設定すること(例: `claude` / `codex` / `cursor` / `opencode`)。
- `TAKT_E2E_PROVIDER=cursor` の場合は `cursor-agent` CLI が利用可能で、認証済みであること。
- `TAKT_E2E_PROVIDER=opencode` の場合は `TAKT_E2E_MODEL` が必須(例: `opencode/big-pickle`)。
- 実行時間が長いテストがあるため、タイムアウトに注意すること。
- E2Eは `e2e/helpers/test-repo.ts``gh` でリポジトリをクローンし、テンポラリディレクトリで実行する。
Expand All @@ -28,10 +29,12 @@ E2Eテストを追加・変更した場合は、このドキュメントも更
- `npm run test:e2e:provider`: `claude``codex` の両方で実行。
- `npm run test:e2e:provider:claude`: `TAKT_E2E_PROVIDER=claude` で実行。
- `npm run test:e2e:provider:codex`: `TAKT_E2E_PROVIDER=codex` で実行。
- `npm run test:e2e:provider:cursor`: `TAKT_AUTO_PR=false TAKT_E2E_PROVIDER=cursor` で実行(Cursor専用スイート: `add-and-run` / `worktree`)。
- `npm run test:e2e:provider:opencode`: `TAKT_E2E_PROVIDER=opencode` で実行(`TAKT_E2E_MODEL` 必須)。
- `npm run test:e2e:all`: `mock` + `provider` を通しで実行。
- `npm run test:e2e:claude`: `test:e2e:provider:claude` の別名。
- `npm run test:e2e:codex`: `test:e2e:provider:codex` の別名。
- `npm run test:e2e:cursor`: `test:e2e:provider:cursor` の別名。
- `npm run test:e2e:opencode`: `test:e2e:provider:opencode` の別名。
- `npx vitest run e2e/specs/add-and-run.e2e.ts`: 単体実行の例。

Expand Down
3 changes: 3 additions & 0 deletions e2e/fixtures/config.e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ notification_sound_events:
piece_abort: false
run_complete: true
run_abort: false
provider_profiles:
cursor:
default_permission_mode: full
Loading