Skip to content

Commit 607f3a4

Browse files
hubwriterCopilotCopilotcrwaters16sophietheking
authored
[2026-04-09] Copilot CLI: Access sessions remotely from GitHub Mobile or github.com (#60661)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Claire W <78226508+crwaters16@users.noreply.github.com> Co-authored-by: Sophie <29382425+sophietheking@users.noreply.github.com>
1 parent d62855b commit 607f3a4

File tree

9 files changed

+264
-10
lines changed

9 files changed

+264
-10
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
title: About remote access to {% data variables.copilot.copilot_cli %} sessions
3+
shortTitle: About remote access
4+
intro: 'Access a running {% data variables.copilot.copilot_cli_short %} session from {% data variables.product.prodname_dotcom_the_website %} or {% data variables.product.prodname_mobile %} to monitor and steer the session when you are away from the machine where the session is running.'
5+
versions:
6+
feature: copilot
7+
contentType: concepts
8+
category:
9+
- Learn about Copilot # Copilot discovery page
10+
- Learn about Copilot CLI # Copilot CLI bespoke page
11+
docsTeamMetrics:
12+
- copilot-cli
13+
---
14+
15+
This article explains the concepts around remote access to {% data variables.copilot.copilot_cli_short %} sessions. For instructions on how to enable remote access, see [AUTOTITLE](/copilot/how-tos/copilot-cli/steer-remotely).
16+
17+
## Introduction
18+
19+
When you start a {% data variables.copilot.copilot_cli %} session on your local machine, the session is normally only accessible from the terminal where you started it. However, you can enable remote access to the session from {% data variables.product.prodname_dotcom_the_website %} and {% data variables.product.prodname_mobile %}, allowing you to view the progress of a task that {% data variables.product.prodname_copilot_short %} is working on, and respond to prompts for more information, or requests for permissions.
20+
21+
This is useful in scenarios such as:
22+
23+
* **Leaving your workstation**: You started a session on your laptop and were then called away, or you finished work for the day, but you want to continue interacting with {% data variables.product.prodname_copilot_short %} without having to return to the machine.
24+
25+
* **Monitoring a long-running task**: You started a complex task that will take time to complete, but didn't give {% data variables.product.prodname_copilot_short %} full permission to carry out every action. You need to periodically assess and respond to permission requests to allow a task to continue.
26+
27+
To ensure the stability of the remote access feature there is a 60 MB limit on size of session output that is passed to the remote interface. As a result, very long-running sessions that generate large amounts of output may experience reduced performance in the remote interface. The local terminal session is unaffected.
28+
29+
* **Quick access from a mobile device**: You're working on something else now but you're using {% data variables.product.prodname_mobile %} to provide an at-a-glance view of progress on a task you started in {% data variables.copilot.copilot_cli_short %}.
30+
31+
{% data reusables.cli.public-preview-remote-access %}
32+
33+
## Prerequisites
34+
35+
Remote access requires:
36+
37+
* **Policy enablement**: For users who have a {% data variables.product.prodname_copilot_short %} seat from an organization, remote access access is governed by policies set at the organization and enterprise level. The "Remote Control" policy is off by default but can be enabled by an enterprise or organization owner. See [Administering remote access](#administering-remote-access).
38+
* **A {% data variables.product.github %} repository**: The working directory where you started the CLI must contain a Git repository hosted on {% data variables.product.prodname_dotcom_the_website %}. If you attempt to enable remote access outside of a {% data variables.product.prodname_dotcom %} repository, the CLI displays the message: "Remote session disabled: not in a {% data variables.product.github %} repository"
39+
* **The machine must be online**: The CLI session must be actively running in a terminal on a machine with an internet connection. If the machine goes to sleep or loses its connection, remote access is unavailable until the machine is back online. See [Reconnection](#reconnection) later in this article.
40+
* **An interactive session**: Remote access is only available for interactive sessions. It is not available when you use the CLI programmatically with the `--prompt` command-line option, for example when you use the CLI in a script.
41+
42+
## Accessing a session remotely
43+
44+
When you enable remote access for a {% data variables.copilot.copilot_cli_short %} session, you can go to {% data variables.product.prodname_dotcom_the_website %} or {% data variables.product.prodname_mobile %} and find the session in the list of your recent agent sessions. The remote interface is updated in real time, allowing you to monitor ongoing output from the session and respond to prompts and permission requests as they come in.
45+
46+
Both the local terminal and the remote interface are active at the same time. You can enter commands in either interface. {% data variables.copilot.copilot_cli_short %} uses the first response it receives to any prompt or permission request.
47+
48+
Your session continues to run on your local machine. The remote interface provides a way to interact with the session, but the CLI itself—and all the tools, shell commands, and file operations it runs—remain on the machine where you started the session.
49+
50+
## What you can do remotely
51+
52+
When connected to a session remotely from {% data variables.product.prodname_dotcom_the_website %} or {% data variables.product.prodname_mobile %}, you can:
53+
54+
* **Respond to permission requests**: Approve or deny tool, file path, and URL permission requests.
55+
* **Respond to questions**: Answer when {% data variables.product.prodname_copilot_short %} asks you to supply more information or make a decision.
56+
* **Approve or reject plans**: Respond to plan approval prompts when {% data variables.product.prodname_copilot_short %} is in plan mode.
57+
* **Submit new prompts**: Enter questions or instructions, just as you would in the terminal.
58+
* **Switch modes**: Change the session mode—for example, between interactive and plan mode.
59+
* **End the current operation**: Cancel the agent's current work.
60+
61+
{% data reusables.cli.remote-access-slash-commands %}
62+
63+
## Reconnection
64+
65+
If the connection between your local machine and {% data variables.product.prodname_dotcom %} is temporarily lost—for example, due to a network interruption—you can continue using the session remotely as soon as the connection is restored.
66+
67+
You can use the `/keep-alive` slash command to prevent your machine from going to sleep. See [Preventing your machine from going to sleep](/copilot/how-tos/copilot-cli/steer-remotely#preventing-your-machine-from-going-to-sleep).
68+
69+
If you closed a session that had remote access enabled, when you resume the session—either using `copilot --continue` or `copilot --resume=ID`—you must re-enable remote access. For more information, see [AUTOTITLE](/copilot/how-tos/copilot-cli/steer-remotely#resuming-a-session-with-remote-access).
70+
71+
## Visibility of remote access sessions
72+
73+
Remote access is only available to you—the person who is signed in to {% data variables.product.prodname_dotcom %} with the same account that started the CLI session. No one else can view or interact with your session remotely.
74+
75+
### Points to note
76+
77+
When you enable remote access:
78+
79+
* Session events are sent from your local machine to {% data variables.product.prodname_dotcom %}. This includes conversation messages, tool execution events, and permission requests.
80+
* Remote commands are polled by {% data variables.copilot.copilot_cli_short %} from {% data variables.product.prodname_dotcom %} and injected into your local session.
81+
* The CLI itself continues to run locally. All shell commands, file operations, and tool executions happen on your machine—remote access does not grant any direct access to your local machine beyond what the CLI agent can do within the session.
82+
83+
The remote session link (displayed in the CLI when you enable remote access) points to a session-specific URL on {% data variables.product.prodname_dotcom_the_website %}. Only authenticated users with the correct account can access this URL.
84+
85+
## Administering remote access
86+
87+
The ability for users enable remote access to their {% data variables.copilot.copilot_cli_short %} sessions can be controlled by policies in the enterprise or organization settings. Users who get {% data variables.product.prodname_copilot_short %} from an organization will not be able to use remote access if it has been disabled at the organization or enterprise level.
88+
89+
The "Remote Control" policy is off by default, so it must be enabled by an enterprise or organization owner before users can start monitoring and steering their CLI sessions remotely.
90+
91+
For more information about setting policies for your enterprise or organization, see [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-organization/manage-policies) and [AUTOTITLE](/copilot/how-tos/copilot-cli/administer-copilot-cli-for-your-enterprise).

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ docsTeamMetrics:
1717

1818
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.
1919

20-
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+
This article gives an overview of the `/fleet` slash command. For details of how to use it, see [AUTOTITLE](/copilot/how-tos/copilot-cli/speed-up-task-completion).
2121

2222
## How `/fleet` works
2323

@@ -70,6 +70,6 @@ For more information about autopilot mode, see [AUTOTITLE](/copilot/concepts/age
7070

7171
## Further reading
7272

73-
* [AUTOTITLE](/copilot/how-tos/copilot-cli/speeding-up-task-completion)
73+
* [AUTOTITLE](/copilot/how-tos/copilot-cli/speed-up-task-completion)
7474
* [AUTOTITLE](/copilot/how-tos/copilot-cli)
7575
* [AUTOTITLE](/copilot/how-tos/use-copilot-agents/use-copilot-cli)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ versions:
77
feature: copilot
88
children:
99
- /about-copilot-cli
10+
- /comparing-cli-features
11+
- /about-remote-access
1012
- /about-custom-agents
1113
- /about-cli-plugins
12-
- /comparing-cli-features
1314
- /autopilot
1415
- /fleet
1516
- /research

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,20 @@ children:
1818
- /cli-best-practices
1919
- /set-up-copilot-cli
2020
- /allowing-tools
21+
- /steer-remotely
2122
- /automate-copilot-cli
2223
- /customize-copilot
2324
- /connecting-vs-code
2425
- /use-copilot-cli-agents
2526
- /administer-copilot-cli-for-your-enterprise
26-
- /speeding-up-task-completion
27+
- /speed-up-task-completion
2728
- /chronicle
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/about-agent-skills
3132
- /content/copilot/concepts/agents/copilot-cli/about-cli-plugins
3233
- /content/copilot/concepts/agents/copilot-cli/autopilot
34+
- /content/copilot/concepts/agents/copilot-cli/about-remote-access
3335
- /content/copilot/concepts/agents/copilot-cli/fleet
3436
- /content/copilot/concepts/agents/copilot-cli/research
3537
- /content/copilot/concepts/agents/copilot-cli/chronicle

content/copilot/how-tos/copilot-cli/speeding-up-task-completion.md renamed to content/copilot/how-tos/copilot-cli/speed-up-task-completion.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
---
22
title: Speeding up task completion with the `/fleet` command
3-
shortTitle: Speeding up task completion
3+
shortTitle: Speed up task completion
44
intro: Learn how you can speed up the completion of a multi-step implementation plan by using the `/fleet` slash command.
55
versions:
66
feature: copilot
77
contentType: how-tos
8+
redirect_from:
9+
- /copilot/how-tos/copilot-cli/speeding-up-task-completion
810
category:
911
- Author and optimize with Copilot # Copilot discovery page
1012
- Build with Copilot CLI # Copilot CLI bespoke page
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
---
2+
title: Steering a {% data variables.copilot.copilot_cli %} session from another device
3+
shortTitle: Steer a session remotely
4+
allowTitleToDifferFromFilename: true
5+
intro: 'Enable remote access to a {% data variables.copilot.copilot_cli_short %} session so you can monitor progress, respond to prompts, and continue working from {% data variables.product.prodname_dotcom_the_website %} or {% data variables.product.prodname_mobile %}.'
6+
versions:
7+
feature: copilot
8+
contentType: how-tos
9+
category:
10+
- Author and optimize with Copilot # Copilot discovery page
11+
- Build with Copilot CLI # Copilot CLI bespoke page
12+
docsTeamMetrics:
13+
- copilot-cli
14+
---
15+
16+
Remote access lets you connect to a running {% data variables.copilot.copilot_cli_short %} session from any browser or from {% data variables.product.prodname_mobile %}. You can view session output, respond to permission requests, and continue working in the session without being at the machine where the session is running.
17+
18+
This article explains how to enable and use remote access. For more conceptual information, see [AUTOTITLE](/copilot/concepts/agents/copilot-cli/about-remote-access).
19+
20+
{% data reusables.cli.public-preview-remote-access %}
21+
22+
## Prerequisites
23+
24+
* The machine where the CLI session is running must be online, with the session actively running in a terminal.
25+
26+
> [!TIP]
27+
> Use the `/keep-alive` slash command to prevent your machine from going to sleep while you're away. See [Preventing your machine from going to sleep](#preventing-your-machine-from-going-to-sleep).
28+
29+
* The working directory must contain a Git repository hosted on {% data variables.product.prodname_dotcom_the_website %}. If you are not in a {% data variables.product.prodname_dotcom %} repository, the CLI displays: "Remote session disabled: not in a {% data variables.product.github %} repository."
30+
31+
## Enabling remote access for a session
32+
33+
You can enable remote access in three ways:
34+
35+
* With a slash command during an interactive session.
36+
* With a command-line option when you start {% data variables.copilot.copilot_cli_short %}.
37+
* By configuring the CLI to enable remote access by default for all interactive sessions.
38+
39+
### Using the `/remote` slash command
40+
41+
If you are already in an interactive session and want to enable remote access, enter:
42+
43+
```copilot copy
44+
/remote
45+
```
46+
47+
The CLI connects to {% data variables.product.prodname_dotcom_the_website %} and displays details for accessing the session remotely—see [Accessing a session from {% data variables.product.prodname_dotcom_the_website %}](#accessing-a-session-from-githubcom) and [Accessing a session from {% data variables.product.prodname_mobile %}](#accessing-a-session-from-github-mobile) later in this article.
48+
49+
### Using the `--remote` command-line option
50+
51+
If you think you may want to access a session remotely, you can start the CLI with the `--remote` command-line option. This avoids the need to remember to use the `/remote` slash command during the session.
52+
53+
```bash copy
54+
copilot --remote
55+
```
56+
57+
Details for accessing the session remotely are displayed when the interactive session starts and can be displayed again at any time by using the `/remote` slash command.
58+
59+
### Configuring remote access to always be enabled
60+
61+
If you always want your interactive CLI sessions to be remotely accessible, add the following to your {% data variables.product.prodname_copilot_short %} configuration file (typically located at `~/.copilot/config.json`):
62+
63+
```json copy
64+
{
65+
"steerableSessions": true
66+
}
67+
```
68+
69+
To override this setting for a particular session, use the `--no-remote` option when you start the session:
70+
71+
```bash copy
72+
copilot --no-remote
73+
```
74+
75+
> [!NOTE]
76+
> The command-line options `--remote` and `--no-remote` always take precedence over the `remoteSessions` setting in the configuration file.
77+
78+
## Accessing a session from {% data variables.product.prodname_dotcom_the_website %}
79+
80+
When remote access is enabled, the CLI displays a link in the format:
81+
82+
```text
83+
https://github.com/OWNER/REPO/tasks/TASK_ID
84+
```
85+
86+
Use this link to access the session in a web browser. You must be signed in to {% data variables.product.prodname_dotcom %} with the same account that started the CLI session.
87+
88+
You can also access the session from your list of recent agent sessions on {% data variables.product.prodname_dotcom_the_website %}:
89+
90+
1. In the top-left corner of {% data variables.product.prodname_dotcom %}, click {% octicon "three-bars" aria-label="Open menu" %}.
91+
1. Click **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %} {% data variables.product.prodname_copilot_short %}**.
92+
1. Under "Recent agent sessions", click your {% data variables.copilot.copilot_cli_short %} session to open it.
93+
94+
> [!IMPORTANT]
95+
> Sessions are user-specific: you can only access your own {% data variables.copilot.copilot_cli_short %} sessions. Other {% data variables.product.github %} users cannot access your sessions.
96+
97+
## Accessing a session from {% data variables.product.prodname_mobile %}
98+
99+
A {% data variables.copilot.copilot_cli_short %} session is available in {% data variables.product.prodname_mobile %} as soon as you enable remote access. To find your session in {% data variables.product.prodname_mobile %}:
100+
101+
1. Tap the **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %} {% data variables.product.prodname_copilot_short %}** button in the bottom right corner of the screen.
102+
103+
The session is listed under "Agent sessions."
104+
105+
1. Tap the session to open it.
106+
107+
### Use a QR code to quickly open a session on your phone
108+
109+
1. In an interactive session, enter the `/remote` slash command to redisplay the remote session details.
110+
1. Press <kbd>Ctrl</kbd>+<kbd>E</kbd> to toggle on/off display of a QR code.
111+
112+
> [!NOTE]
113+
> This keyboard shortcut expands/collapses all details in the session conversation, not just the QR code. It only works if the input field is currently empty.
114+
115+
1. Scan the QR code with your phone to go directly to the session in {% data variables.product.prodname_mobile %}.
116+
117+
## Preventing your machine from going to sleep
118+
119+
You can use the `/keep-alive` slash command to prevent your machine from going to sleep. This allows you to maintain the remote connection and continue interacting with the session from {% data variables.product.prodname_dotcom_the_website %} or {% data variables.product.prodname_mobile %}.
120+
121+
In an interactive session, enter `/keep-alive OPTION`, where `OPTION` is one of:
122+
123+
* `on`: Prevents the machine from going to sleep while the CLI session is active.
124+
* `off`: Allows the machine to go to sleep as normal.
125+
* `busy`: Prevents the machine from going to sleep only while {% data variables.product.prodname_copilot_short %} is working on a task. Once the agent completes a task the machine can go to sleep as normal. The machine will not go to sleep if {% data variables.product.prodname_copilot_short %} is waiting for you to respond to a request for input from you.
126+
* `NUMBERm`, `NUMBERh`, or `NUMBERd` (for example, `30m`, `8h`, `1d`): Prevents the machine from going to sleep for a specific number of minutes, hours, or days. If a bare number is provided without a suffix, it is treated as minutes.
127+
128+
Without passing an `OPTION`, the `/keep-alive` command displays the current keep-alive status.
129+
130+
## Resuming a session with remote access
131+
132+
When you shut down a session that has remote access enabled, the CLI displays a resume command that includes `--remote`:
133+
134+
```bash
135+
copilot --resume=SESSION_ID --remote
136+
```
137+
138+
Use this command to restart the session with remote access enabled.
139+
140+
Similarly, adding `--remote` to a `copilot --continue` command resumes the most recent session with remote access enabled.
141+
142+
If you have `"remoteSessions": true` in your {% data variables.product.prodname_copilot_short %} configuration file, resumed sessions will have remote access enabled automatically and you do not need to use the `--remote` option.
143+
144+
## Preventing remote access
145+
146+
Remote access is disabled by default, but may be enabled in your {% data variables.product.prodname_copilot_short %} configuration file. You can ensure a session is not remotely accessible by:
147+
148+
* **For a single session**: Start the CLI with `--no-remote` to prevent remote access for that session, regardless of your configuration file setting.
149+
* **Permanently**: Remove the `"remoteSessions": true` setting from your {% data variables.product.prodname_copilot_short %} configuration file (or set it to `false`).

0 commit comments

Comments
 (0)