4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Copilot CLIでsubagentの並列実行が可能に!!

4
Last updated at Posted at 2026-01-09

version 0.0.375からsubagentの並列実行ができるようになっていました!!
ずっと待ち望んでた機能なので嬉しいです。
ちなみに通常のgithub copilotではsubagentの並列実行はまだ非対応のようです。

Copilot CLIとは

Github Copilot版 claude codeです。

インストール

  1. GithubリポジトリにアクセスしてCopilot CLIをインストール

  2. とりあえず起動

copilot

初回起動はかっこいいバナーが表示されるみたい

コマンド一覧

copilot --help 
Usage: copilot [options] [command]

GitHub Copilot CLI - An AI-powered coding assistant

Options:
  --add-dir <directory>               Add a directory to the allowed list for file access (can be used multiple times)
  --add-github-mcp-tool <tool>        Add a tool to enable for the GitHub MCP server instead of the default CLI subset (can be used multiple times). Use "*" for all tools.
  --add-github-mcp-toolset <toolset>  Add a toolset to enable for the GitHub MCP server instead of the default CLI subset (can be used multiple times). Use "all" for all toolsets.
  --additional-mcp-config <json>      Additional MCP servers configuration as JSON string or file path (prefix with @) (can be used multiple times; augments config from ~/.copilot/mcp-config.json for this
                                      session)
  --agent <agent>                     Specify a custom agent to use, only in prompt mode
  --allow-all-paths                   Disable file path verification and allow access to any path
  --allow-all-tools                   Allow all tools to run automatically without confirmation; required for non-interactive mode (env: COPILOT_ALLOW_ALL)
  --allow-all-urls                    Allow access to all URLs without confirmation
  --allow-tool [tools...]             Tools the CLI has permission to use; will not prompt for permission
  --allow-url [urls...]               Allow access to specific URLs or domains
  --available-tools [tools...]        Only these tools will be available to the model
  --banner                            Show the startup banner
  --continue                          Resume the most recent session
  --deny-tool [tools...]              Tools the CLI does not have permission to use; will not prompt for permission
  --deny-url [urls...]                Deny access to specific URLs or domains, takes precedence over --allow-url
  --disable-builtin-mcps              Disable all built-in MCP servers (currently: github-mcp-server)
  --disable-mcp-server <server-name>  Disable a specific MCP server (can be used multiple times)
  --disable-parallel-tools-execution  Disable parallel execution of tools (LLM can still make parallel tool calls, but they will be executed sequentially)
  --disallow-temp-dir                 Prevent automatic access to the system temporary directory
  --enable-all-github-mcp-tools       Enable all GitHub MCP server tools instead of the default CLI subset. Overrides --add-github-mcp-toolset and --add-github-mcp-tool options.
  --excluded-tools [tools...]         These tools will not be available to the model
  -h, --help                          display help for command
  -i, --interactive <prompt>          Start interactive mode and automatically execute this prompt
  --log-dir <directory>               Set log file directory (default: ~/.copilot/logs/)
  --log-level <level>                 Set the log level (choices: "none", "error", "warning", "info", "debug", "all", "default")
  --model <model>                     Set the AI model to use (choices: "claude-sonnet-4.5", "claude-haiku-4.5", "claude-opus-4.5", "claude-sonnet-4", "gpt-5.1-codex-max", "gpt-5.1-codex", "gpt-5.2",
                                      "gpt-5.1", "gpt-5", "gpt-5.1-codex-mini", "gpt-5-mini", "gpt-4.1", "gemini-3-pro-preview")
  --no-auto-update                    Disable downloading CLI update automatically
  --no-color                          Disable all color output
  --no-custom-instructions            Disable loading of custom instructions from AGENTS.md and related files
  -p, --prompt <text>                 Execute a prompt in non-interactive mode (exits after completion)
  --plain-diff                        Disable rich diff rendering (syntax highlighting via diff tool specified by git config)
  --resume [sessionId]                Resume from a previous session (optionally specify session ID)
  -s, --silent                        Output only the agent response (no stats), useful for scripting with -p
  --screen-reader                     Enable screen reader optimizations
  --share [path]                      Share session to markdown file after completion in non-interactive mode (default: ./copilot-session-<id>.md)
  --share-gist                        Share session to a secret GitHub gist after completion in non-interactive mode
  --stream <mode>                     Enable or disable streaming mode (choices: "on", "off")
  -v, --version                       show version information

Commands:
  help [topic]                        Display help information

Help Topics:
  config       Configuration Settings
  commands     Interactive Mode Commands
  environment  Environment Variables
  logging      Logging
  permissions  Tool Permissions

Examples:
  # Start interactive mode
  $ copilot

  # Start interactive mode and automatically execute a prompt
  $ copilot -i "Fix the bug in main.js"

  # Execute a prompt in non-interactive mode (exits after completion)
  $ copilot -p "Fix the bug in main.js" --allow-all-tools

  # Start with a specific model
  $ copilot --model gpt-5

  # Resume the most recent session
  $ copilot --continue

  # Resume a previous session using session picker
  $ copilot --resume

  # Resume with auto-approval
  $ copilot --allow-all-tools --resume

  # Allow access to additional directory
  $ copilot --add-dir /home/user/projects

  # Allow multiple directories
  $ copilot --add-dir ~/workspace --add-dir /tmp

  # Disable path verification (allow access to any path)
  $ copilot --allow-all-paths

  # Allow all git commands except git push
  $ copilot --allow-tool 'shell(git:*)' --deny-tool 'shell(git push)'

  # Allow all file editing
  $ copilot --allow-tool 'write'

  # Allow all but one specific tool from MCP server with name "MyMCP"
  $ copilot --deny-tool 'MyMCP(denied_tool)' --allow-tool 'MyMCP'

  # Allow GitHub API access (defaults to HTTPS)
  $ copilot --allow-url github.com

  # Deny access to specific domain over HTTPS
  $ copilot --deny-url https://malicious-site.com
  $ copilot --deny-url malicious-site.com

  # Allow all URLs without confirmation
  $ copilot --allow-all-urls

実際に試す

copilot

バージョンが表示される

Welcome to GitHub Copilot CLI
 Version 0.0.376 · Commit 958afaa
  ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 >  Enter @ to mention files or / for commands
 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 Ctrl+c Exit · Ctrl+r Expand recent

Ctrl+cを2回押すと終了できます

/modelでモデル選択できます
Claude Sonnet 4.5がデフォルトのようですね

/model
Select Model

 Choose the AI model to use for Copilot CLI. The selected model will be persisted and used for future sessions.

 ❯  1. Claude Sonnet 4.5 (default)        1x
    2. Claude Haiku 4.5 ✓              0.33x
    3. Claude Opus 4.5                    3x
    4. Claude Sonnet 4                    1x
    5. GPT-5.1-Codex-Max                  1x
    6. GPT-5.1-Codex                      1x
    7. GPT-5.2                            1x
    8. GPT-5.1                            1x
    9. GPT-5                              1x
   10. GPT-5.1-Codex-Mini              0.33x
   11. GPT-5 mini                         0x
   12. GPT-4.1                            0x
   13. Gemini 3 Pro (Preview)             1x

 Confirm with number keys or ↑↓ keys and Enter, Cancel with Esc

プロンプトはざっくりこんな感じでOK

並列で必要な数のsubagentを使用しリファクタリングを行ってください。
subagentはopus4.5だけを使用

モデル指定も可能

並列で5つのopus4.5 subagentを使用しリファクタリングを行ってください。

複数モデルの指定も可能

並列でsubagentを使用しリファクタリングを行ってください。
複雑なタスクの場合はopus4.5を使用
それ以外の場合はGPT5.2を使用

実行するとこんな感じで並列で実行されます。

すべての改善を並列で実装します。

 ✓ general-purpose(claude-opus-4.5):  Install all dependencies

  ✓ Install runtime and dev dependencies
  $ cd dashboard && npm install zod react-router-dom react-error-boundary && npm install -D @testing-library/react @testing-library/user-event @testing-library/jest-dom vitest @vitest/ui jsdom
     └ 18 lines...

 ✓ general-purpose(claude-opus-4.5):  Fix Vite security vulnerability

  ✓ Type-check the updated vite config
  $ cd /<HOME>/Documents/code/<PROJECT>/dashboard && npx tsc --noEmit vite.config.ts 2>&1 | head -20
     └ 18 lines...
  ✓ Build the dashboard to verify changes
  $ cd /<HOME>/Documents/code/<PROJECT>/dashboard && npm run build 2>&1 | tail -15
     └ 16 lines...

 ✓ general-purpose(claude-opus-4.5):  Create config module

  ✓ Create dashboard/src/config/index.ts
  ✓ Type check config file
  $ cd /<HOME>/Documents/code/<PROJECT>/dashboard && npx tsc --noEmit src/config/index.ts 2>&1 || true
     └ 2 lines...

 ✓ general-purpose(claude-opus-4.5):  Split dataLoader module

  ✓ Run tests with --run flag
  $ cd /<HOME>/Documents/code/<PROJECT>/dashboard && npm test -- --run 2>&1
     └ 48 lines...
  ✓ Read dashboard/src/utils/dataLoader.ts
    └ 9 lines read

 ✓ general-purpose(claude-opus-4.5):  Add Zod schemas

  ✓ Run tests
  $ cd /<HOME>/Documents/code/<PROJECT>/dashboard && npm test 2>&1 | head -60
     └ 19 lines...
  Stop shell
     └ 1 line...

 ✓ general-purpose(claude-opus-4.5):  Create data service layer

  ✓ Verify TypeScript compiles
  $ cd /<HOME>/Documents/code/<PROJECT>/dashboard && npm run build 2>&1 | head -30
    No Content
  ✓ Type-check the project
  $ cd /<HOME>/Documents/code/<PROJECT>/dashboard && npx tsc --noEmit 2>&1
     └ 2 lines...

 ✓ general-purpose(claude-opus-4.5):  Create custom data hook

  ✓ Type-check the hook
  $ cd /<HOME>/Documents/code/<PROJECT>/dashboard && npx tsc --noEmit 2>&1 | head -50
     └ 1 line...
  ✓ Read dashboard/src/hooks/useDashboardData.ts
    └ 124 lines read

 ✓ general-purpose(claude-opus-4.5):  Improve CSS accessibility

  ✓ Read dashboard/src/App.tsx:124-130
    └ 7 lines read
  ✓ Edit dashboard/src/App.tsx

 ✓ general-purpose(claude-opus-4.5):  Setup Vitest configuration

  ✓ Clean reinstall dependencies
  $ cd /<HOME>/Documents/code/<PROJECT>/dashboard && rm -rf node_modules package-lock.json && npm install 2>&1 | tail -5
     └ 5 lines...
  ✓ Verify vitest configuration
  $ cd /<HOME>/Documents/code/<PROJECT>/dashboard && npm test -- --run 2>&1 | head -15
     └ 15 lines...

 ✓ general-purpose(claude-opus-4.5):  Add unit tests

  ✓ Edit dashboard/src/utils/parsers.test.ts
  ✓ Run vitest tests
  $ cd /<HOME>/Documents/code/<PROJECT>/dashboard && npx vitest run 2>&1
     └ 43 lines...

 ● 完璧です!第一段階が完了しました。次にコンポーネント改善を並列で実行します。

 ✓ general-purpose(claude-opus-4.5):  Update App.tsx with new architecture

  ✓ Type check App.tsx only
  $ cd /<HOME>/Documents/code/<PROJECT>/dashboard && npx tsc --noEmit src/App.tsx 2>&1 | head -20
     └ 21 lines...
  ✓ update_todo
    └ TODO list updated

 ✓ general-purpose(claude-opus-4.5):  Optimize RequestContentViewer

  ✓ update_todo
    └ TODO list updated
  ✓ Read dashboard/src/components/RequestContentViewer.tsx:1-50
    └ 50 lines read

 ✓ general-purpose(claude-opus-4.5):  Optimize chart components

  ✓ update_todo
    └ TODO list updated
  ✓ Run tests
  $ cd /<HOME>/Documents/code/<PROJECT>/dashboard && npm test -- --run 2>&1 | tail -30
     └ 16 lines...

 ✓ general-purpose(claude-opus-4.5):  Improve UsageHistoryTable

  ✓ Check UsageHistoryTable for errors
  $ cd /<HOME>/Documents/code/<PROJECT>/dashboard && npx tsc --noEmit 2>&1 | grep -E "UsageHistoryTable|error" | head -20
     └ 1 line...
  ✓ Read dashboard/src/components/UsageHistoryTable.tsx
    └ 196 lines read

 ✓ general-purpose(claude-opus-4.5):  Improve ModelCacheView

...

claude系のモデルでsubagentを並列実行することが確認できましたが、gpt5-miniではうまく動作しないようでした。

subagentを試してわかったこと

  • 並列実行は最大10個くらい?
  • 実行するモデルを自由に選べて複数のモデルを組み合わせることもできる(gpt5.2とopus4.5など)
  • Premium requestは最初に使ったモデル分だけ消費されてるように見える
    例えば Sonnet 4.5 が「1ユーザープロンプトで1 Premium request」でsubagent を何個並列で走らせても Premium requestが追加で増えてないように見えた。
  • subagentは上位のモデルを指定でき、例えばhaiku4.5でopus4.5のsubagentを並列実行できる(実際に私が試したときはsonet4.5でopus4.5のsubagentを10個並列実行できた、正直、1 Premium requestでこれが出来てしまうのは想定されてない気がするので申し訳ない気持ちもある)
  • コスト的にずっとこのままはあんまり現実的じゃなさそうなので、制限や仕様変更は入りそう
4
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?