Skip to content

Commit 41f6c67

Browse files
hubwriterCopilot
andauthored
Copilot CLI: document the /fleet slash command (#59767)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent d660b89 commit 41f6c67

10 files changed

Lines changed: 159 additions & 23 deletions

File tree

content/copilot/concepts/agents/copilot-cli/autopilot.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ In autopilot mode, {% data variables.product.prodname_copilot_short %} keeps on
3030

3131
To switch into autopilot mode during an interactive session, press <kbd>Shift</kbd>+<kbd>Tab</kbd> and cycle through the available modes until you reach autopilot mode, then enter your prompt. Use the same keypress to switch from autopilot mode back to the standard interactive mode.
3232

33-
### Benefits of autopilot mode
33+
## Benefits of autopilot mode
3434

3535
* **Hands-off automation:** {% data variables.product.prodname_copilot_short %} completes tasks without needing your input after the initial instruction.
3636
* **Efficiency:** Ideal for well-defined tasks like writing tests, refactoring files, or fixing CI failures. Autopilot is particularly suited for large tasks that require long-running, multi-step sessions.
3737
* **Batch operations:** Useful for scripting and CI workflows where you want {% data variables.product.prodname_copilot_short %} to run to completion.
3838
* **Safety:** Autopilot mode allows {% data variables.product.prodname_copilot_short %} to take multiple self-directed steps to finish your task. `--max-autopilot-continues` limits how many steps it can take before stopping, to avoid infinite loops. Also, in autopilot mode, {% data variables.product.prodname_copilot_short %} cannot carry out any actions that require permission unless you explicitly grant it full permissions.
3939

40-
### Things to consider
40+
## Things to consider
4141

4242
* **Task suitability:** Autopilot mode is best for well-defined tasks. It is not ideal for open-ended exploration, feature development without a clear goal, or tasks where you want to guide the ongoing work.
4343

@@ -47,11 +47,11 @@ To switch into autopilot mode during an interactive session, press <kbd>Shift</k
4747

4848
* **Cost:** Autopilot mode uses premium requests in the same way that these are used when you are working in the standard interactive interface. In the standard mode, one premium request is used when you submit your initial prompt, and then an additional premium request is used each time you reply to a question in the CLI and the agent uses your response to interact with the AI model. The same applies in autopilot mode, except that you are not involved in initiating the next step, so the use of additional premium requests happens without your direct involvement.
4949

50-
The billable premium request usage is determined using a multiplier. The multiplier varies, depending on which model you use. Use the `/model` slash command to see the currently selected model and its multiplier, and change the model if required. For more information, see [AUTOTITLE](/copilot/concepts/billing/copilot-requests) and [AUTOTITLE](/copilot/concepts/billing/billing-for-individuals#about-premium-requests).
50+
{% data reusables.cli.billable-prus %}
5151

5252
Each time the agent continues autonomously it will display a message in the CLI telling you how many premium requests have been used by that continuation step—taking account of the model multiplier—for example: `Continuing autonomously (3 premium requests)`.
5353

54-
### Permissions
54+
## Permissions
5555

5656
When entering autopilot mode, if you have not already granted {% data variables.product.prodname_copilot_short %} all permissions, a message is displayed prompting you to choose between three options:
5757

@@ -63,7 +63,7 @@ When entering autopilot mode, if you have not already granted {% data variables.
6363

6464
You will get the best results from autopilot mode if you enable all permissions. If you choose to continue with limited permissions, {% data variables.product.prodname_copilot_short %} will automatically deny any tool requests that require approval, which may prevent it from completing certain tasks. You can change your mind later and grant full permissions, during an autopilot session, by using the `/allow-all` command (or its alias `/yolo`).
6565

66-
### Comparing autopilot mode, `--allow-all`, and `--no-ask-user`
66+
## Comparing autopilot mode, `--allow-all`, and `--no-ask-user`
6767

6868
`--allow-all`, and its alias `--yolo`, are permissions-related options that you can pass to the `copilot` command when you start an interactive session. For a full list of available options, see [AUTOTITLE](/copilot/reference/cli-command-reference#command-line-options).
6969

@@ -82,7 +82,7 @@ Autopilot mode is ideal for implementing a large, detailed plan of work. Often y
8282

8383
For example:
8484

85-
* Ctart an interactive {% data variables.copilot.copilot_cli_short %} session.
85+
* Start an interactive {% data variables.copilot.copilot_cli_short %} session.
8686

8787
Optionally, you can include the `--allow-all` option to grant permissions, and the `--max-autopilot-continues` option to set a maximum continuation limit for autopilot mode during the session. For example, you could start the session with `copilot --allow-all --max-autopilot-continues 10` to give the agent permission to use all tools, paths, and URLs, and set a maximum continuation limit for autopilot to 10.
8888

@@ -104,10 +104,11 @@ Example usage:
104104
{% data reusables.cli.autopilot-programmatic-prompt %}
105105
```
106106

107-
### Summary
107+
## Summary
108108

109109
Use autopilot mode when you want {% data variables.product.prodname_copilot_short %} to take over a task and work to completion without your involvement. It's best for clear, well-defined tasks where you trust {% data variables.product.prodname_copilot_short %} to make reasonable decisions.
110110

111111
## Further reading
112112

113113
* [AUTOTITLE](/copilot/how-tos/copilot-cli/use-copilot-cli#get-copilot-to-work-autonomously)
114+
* [AUTOTITLE](/copilot/concepts/agents/copilot-cli/fleet)
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
title: Running tasks in parallel with the `/fleet` command
3+
shortTitle: Parallel task execution
4+
allowTitleToDifferFromFilename: true
5+
intro: 'The `/fleet` slash command lets {% data variables.copilot.copilot_cli_short %} break down a complex request into smaller tasks and run them in parallel, maximizing efficiency and throughput.'
6+
versions:
7+
feature: copilot
8+
topics:
9+
- CLI
10+
contentType: concepts
11+
category:
12+
- Learn about Copilot CLI
13+
---
14+
15+
## Introduction
16+
17+
The `/fleet` slash command in {% data variables.copilot.copilot_cli_short %} is designed to take an implementation plan and break it down into smaller, independent tasks that can be executed in parallel by subagents. This allows for faster completion of complex requests that involve multiple steps.
18+
19+
This article gives an overview of the `/fleet` slash command. For details of how to use it, see [AUTOTITLE](/copilot/how-tos/copilot-cli/speeding-up-task-completion).
20+
21+
## How `/fleet` works
22+
23+
When you use the `/fleet` command, the main {% data variables.product.prodname_copilot_short %} agent analyzes the prompt and determines whether it can be divided into smaller subtasks. It will assess, based on the nature of the subtasks and their dependencies, whether these can be efficiently executed by subagents. If it decides to assign some or all of the subtasks to subagents, it will act as orchestrator, managing the workflow and dependencies between the subtasks. Where possible, the orchestrator agent will run the subagents in parallel, allowing the whole task to be completed more quickly.
24+
25+
## Benefits of using `/fleet`
26+
27+
* **Speed of task completion**: The main benefit of using the `/fleet` command is that a large, multi-part task can be completed more quickly by running subtasks in parallel. Whether parts of a large task can be worked on in parallel will be determined by the dependencies between the subtasks. Some tasks, such as creating a suite of tests for a new feature, are well suited to parallelization and will typically complete faster when you use the `/fleet` slash command.
28+
29+
* **Specialization**: If you've defined custom agents that are specialized for certain types of work, these may be used by the subagents. This allows for specialization, with the subagents using the custom agents best suited to the specific subtask they are working on.
30+
31+
By default, subagents use a low-cost AI model. However, you can tell {% data variables.product.prodname_copilot_short %} to use a specific model for part of the work. For example, within a larger prompt, you could specify `... Use GPT-5.3-Codex, to create ... Use Claude Opus 4.5, to analyze ...`. If a subagent uses a custom agent profile that specifies a particular AI model, then that model will be used by the subagent. Using a specific model may produce better quality results for particular types of subtask.
32+
33+
If custom agents are available, {% data variables.product.prodname_copilot_short %} will decide whether to use one to complete a particular subtask. However, if you know that a specific custom agent is well-suited to a particular subtask, you can specify this in your prompt by using `@CUSTOM-AGENT-NAME`. For example, within a larger prompt: `... Use @test-writer to create comprehensive unit tests for ...`.
34+
35+
For more information, see [AUTOTITLE](/copilot/how-tos/copilot-cli/customize-copilot/create-custom-agents-for-cli).
36+
37+
* **Context window**: Each subagent has its own context window, separate from the main agent and other subagents. This allows each subagent to focus on its specific task without being overwhelmed by the full context of the larger task.
38+
39+
## When should you use `/fleet`?
40+
41+
* **Large or complex tasks**: When your request involves multiple independent steps, such as refactoring several files, updating dependencies, or running tests across modules.
42+
* **Parallelizable work**: If your task can be split into subtasks that don’t depend on each other.
43+
* **Automated workflows**: When you want the quickest possible completion of a large task—for example, when you're using autopilot mode to allow {% data variables.product.prodname_copilot_short %} to work autonomously.
44+
45+
## Points to consider
46+
47+
* **Premium request usage**: When you submit a prompt in the CLI and {% data variables.product.prodname_copilot_short %} interacts with the selected large language model (LLM) to generate a response, this consumes premium requests. The number of premium requests consumed depends on the model that's currently selected. More interactions with the LLM result in more premium requests being consumed.
48+
49+
Each subagent can interact with the LLM independently of the main agent, so splitting work up into smaller tasks that are run by subagents may result in more LLM interactions than if the work was handled by the main agent. Using `/fleet` in a prompt may therefore cause more premium requests to be consumed.
50+
51+
{% data reusables.cli.billable-prus %}
52+
53+
* **Task composition**: Work is best suited to execution by multiple subagents if it can be decomposed into independent subtasks. If your request is inherently sequential, using the `/fleet` slash command mode may not provide any benefit.
54+
55+
## Relationship between `/fleet` and autopilot mode
56+
57+
The `/fleet` slash command is often used in autopilot mode, but these are distinct features that can be used independently:
58+
59+
* **Autopilot mode** allows {% data variables.product.prodname_copilot_short %} to continue working autonomously until a task is complete, auto-responding to requests that would otherwise require user intervention.
60+
* **`/fleet`** is all about using subagents to execute tasks in parallel, while the main agent manages the overall workflow. You can use the `/fleet` slash command in interactive sessions independently of autopilot mode.
61+
62+
A typical workflow for using `/fleet` in autopilot mode might look like this:
63+
64+
1. Press <kbd>Shift</kbd>+<kbd>Tab</kbd> to switch into plan mode and work with {% data variables.copilot.copilot_cli_short %} to create an implementation plan.
65+
1. Recognize that the completed plan contains multiple elements and looks like a good candidate for `/fleet`.
66+
1. Select the **Accept plan and build on autopilot + /fleet** option that's displayed when the plan is complete.
67+
68+
For more information about autopilot mode, see [AUTOTITLE](/copilot/concepts/agents/copilot-cli/autopilot).
69+
70+
## Further reading
71+
72+
* [AUTOTITLE](/copilot/how-tos/copilot-cli/speeding-up-task-completion)

content/copilot/concepts/agents/copilot-cli/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ children:
1212
- /about-cli-plugins
1313
- /comparing-cli-features
1414
- /autopilot
15+
- /fleet
1516
contentType: concepts
1617
---

content/copilot/how-tos/copilot-cli/cli-best-practices.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,12 @@ Run the linter and write all errors to `migration-checklist.md` as a checklist.
414414
Then fix each issue one by one, checking them off as you go.
415415
```
416416

417+
### Autonomous task completion
418+
419+
Switch into autopilot mode to allow {% data variables.product.prodname_copilot_short %} to work autonomously on a task until it is complete. This is ideal for long-running tasks that don't require constant supervision. For more information, see [AUTOTITLE](/copilot/concepts/agents/copilot-cli/autopilot).
420+
421+
Optionally, you can usually speed up large tasks by using the `/fleet` slash command at the start of your prompt to allow {% data variables.product.prodname_copilot_short %} to break the task into parallel subtasks that are run by subagents. For more information, see [AUTOTITLE](/copilot/concepts/agents/copilot-cli/fleet).
422+
417423
## 7. Team guidelines
418424

419425
### Recommended repository setup

content/copilot/how-tos/copilot-cli/customize-copilot/add-custom-instructions.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,7 @@ You can also set the `COPILOT_CUSTOM_INSTRUCTIONS_DIRS` environment variable to
7575

7676
{% data reusables.copilot.custom-instructions-note %}
7777

78-
{% data variables.copilot.copilot_cli_short %} caches instructions after they have been read. If you edit an instructions file, and you want to ensure that the changes are used, you must do one of the following:
79-
80-
* Restart {% data variables.copilot.copilot_cli_short %}.
81-
* Use `/resume SESSION-ID`. You can use the `/session` command to find the ID of the current session.
78+
If you make changes to your custom instructions during a CLI session, your changes are available for use by {% data variables.product.prodname_copilot_short %} the next time you submit a prompt in the current, or future, sessions.
8279

8380
## Further reading
8481

content/copilot/how-tos/copilot-cli/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ introLinks:
1616
overview: /copilot/concepts/agents/copilot-cli/about-copilot-cli
1717
quickstart: /copilot/how-tos/copilot-cli/cli-getting-started
1818
children:
19-
# Top-level articles and sub-categories in the Copilot How-to's are listed at the top of this list.
19+
# Top-level articles and sub-categories in the Copilot How-to's are listed at the top of this list.
2020
# This sets the order we show them in the side nav.
2121
# All content from other directories and in any sub-directories can be added in any order underneath.
2222
- /cli-getting-started
@@ -25,10 +25,12 @@ children:
2525
- /customize-copilot
2626
- /use-copilot-cli
2727
- /automate-with-actions
28+
- /speeding-up-task-completion
2829
- /content/copilot/concepts/agents/copilot-cli/about-copilot-cli
2930
- /content/copilot/concepts/agents/copilot-cli/comparing-cli-features
3031
- /content/copilot/concepts/agents/copilot-cli/about-cli-plugins
3132
- /content/copilot/concepts/agents/copilot-cli/autopilot
33+
- /content/copilot/concepts/agents/copilot-cli/fleet
3234
- /set-up-copilot-cli/install-copilot-cli
3335
- /set-up-copilot-cli/configure-copilot-cli
3436
- /customize-copilot/add-custom-instructions
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: Speeding up task completion with the `/fleet` command
3+
shortTitle: Speeding up task completion
4+
intro: Learn how you can speed up the completion of a multi-step implementation plan by using the `/fleet` slash command.
5+
versions:
6+
feature: copilot
7+
topics:
8+
- Copilot
9+
- CLI
10+
contentType: how-tos
11+
category:
12+
- Author and optimize with Copilot # Copilot discovery page
13+
- Build with Copilot CLI # Copilot CLI bespoke page
14+
---
15+
16+
Where a task involves multiple operations, some or all of which can be worked on in parallel, the `/fleet` slash command can speed up task completion. When you use this command, {% data variables.product.prodname_copilot_short %} assigns separate parts of the work to subagents.
17+
18+
For more information, see [AUTOTITLE](/copilot/concepts/agents/copilot-cli/fleet).
19+
20+
## Using the `/fleet` slash command
21+
22+
To use the `/fleet` slash command, enter the command followed by your prompt.
23+
24+
### Typical workflow
25+
26+
Typically, you'll use the `/fleet` slash command after creating an implementation plan.
27+
28+
1. In an interactive CLI session, press <kbd>Shift</kbd>+<kbd>Tab</kbd> to switch into plan mode.
29+
1. Enter a prompt describing the feature you want to add or the change you want to make.
30+
1. Work with {% data variables.product.prodname_copilot_short %} in plan mode to create an implementation plan.
31+
1. Once the plan is complete, select one of the following options:
32+
33+
* **Accept plan and build on autopilot + /fleet** to allow {% data variables.product.prodname_copilot_short %} to use subagents and work autonomously to implement the plan without any further input.
34+
* **Exit plan mode and I will prompt myself** and then enter a prompt such as `/fleet implement the plan`. {% data variables.product.prodname_copilot_short %} will start working on the plan, using subagents to run parts of the work in parallel where possible. It may ask you to answer questions or make decisions as it works through the plan.
35+
36+
### Monitoring progress
37+
38+
Use the `/tasks` slash command to see a list of background tasks relating to the current session. This will include any subtasks handled by subagents when you use the `/fleet` command.
39+
40+
Use up and down keyboard keys to navigate through the list of background tasks. For each subagent task, you can:
41+
42+
* Press <kbd>Enter</kbd> to view details. When the subtask is complete, you will see a summary of what was done.
43+
* Press <kbd>k</kbd> to kill the process.
44+
* Press <kbd>r</kbd> to remove completed or killed subtasks from the list.
45+
46+
Press <kbd>Esc</kbd> to exit the task list and return to the main CLI prompt.
47+
48+
## Further reading
49+
50+
* [AUTOTITLE](/copilot/reference/cli-command-reference#slash-commands-in-the-interactive-interface)

content/copilot/how-tos/copilot-cli/use-copilot-cli.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,14 @@ Alternatively, prefix a prompt with `&` to delegate it:
157157

158158
### Resume an interactive session
159159

160-
You can use the `--resume` command line option or the `/resume` slash command to cycle through and resume local and remote interactive sessions, allowing you to pick up right where you left off with your existing context. You can kick off a {% data variables.copilot.copilot_coding_agent %} session on {% data variables.product.github %}, and then use {% data variables.copilot.copilot_cli %} to bring that session to your local environment.
161-
162-
You can quickly resume the most recently closed local session by using the `--continue` command line option.
160+
You can use the `--resume` command-line option or the `/resume` slash command to select and resume an interactive CLI session, allowing you to pick up right where you left off, with the saved context. You can kick off a {% data variables.copilot.copilot_coding_agent %} session on {% data variables.product.github %}, and then use {% data variables.copilot.copilot_cli %} to bring that session to your local environment.
161+
162+
> [!TIP]
163+
> To quickly resume the most recently closed local session, enter this in your terminal:
164+
>
165+
> ```shell
166+
> copilot --continue
167+
> ```
163168
164169
### Use custom instructions
165170

0 commit comments

Comments
 (0)