Skip to main content

Steering a GitHub Copilot CLI session from another device

Enable remote access to a Copilot CLI session so you can monitor progress, respond to prompts, and continue working from GitHub.com or GitHub Mobile.

Remote access lets you connect to a running Copilot CLI session from any browser or from GitHub 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.

This article explains how to enable and use remote access. For more conceptual information, see About remote access to GitHub Copilot CLI sessions.

참고

  • Remote access to Copilot CLI sessions is in 공개 미리 보기 and subject to change.
  • Mobile access is currently only available in the latest beta release of GitHub Mobile. You can join the test program for GitHub Mobile via Apple TestFlight for iOS and Google Play for Android.

Prerequisites

  • The machine where the CLI session is running must be online, with the session actively running in a terminal.

    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.

  • The working directory must contain a Git repository hosted on GitHub.com. If you are not in a GitHub repository, the CLI displays: "Remote session disabled: not in a GitHub repository."

Enabling remote access for a session

You can enable remote access in three ways:

  • With a slash command during an interactive session.
  • With a command-line option when you start Copilot CLI.
  • By configuring the CLI to enable remote access by default for all interactive sessions.

Using the /remote slash command

If you are already in an interactive session and want to enable remote access, enter:

Copilot prompt
/remote

The CLI connects to GitHub.com and displays details for accessing the session remotely—see Accessing a session from GitHub.com and Accessing a session from GitHub Mobile later in this article.

Using the --remote command-line option

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.

Bash
copilot --remote

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.

Configuring remote access to always be enabled

If you always want your interactive CLI sessions to be remotely accessible, add the following to your Copilot configuration file (typically located at ~/.copilot/config.json):

JSON
{
  "remoteSessions": true
}

To override this setting for a particular session, use the --no-remote option when you start the session:

Bash
copilot --no-remote

참고

The command-line options --remote and --no-remote always take precedence over the remoteSessions setting in the configuration file.

Accessing a session from GitHub.com

When remote access is enabled, the CLI displays a link in the format:

https://github.com/OWNER/REPO/tasks/TASK_ID

Use this link to access the session in a web browser. You must be signed in to GitHub with the same account that started the CLI session.

You can also access the session from your list of recent agent sessions on GitHub.com:

  1. In the top-left corner of GitHub, click .
  2. Click Copilot.
  3. Under "Recent agent sessions", click your Copilot CLI session to open it.

중요

Sessions are user-specific: you can only access your own Copilot CLI sessions. Other GitHub users cannot access your sessions.

Accessing a session from GitHub Mobile

A Copilot CLI session is available in GitHub Mobile as soon as you enable remote access. To find your session in GitHub Mobile:

  1. Tap the Copilot button in the bottom right corner of the screen.

    The session is listed under "Agent sessions."

  2. Tap the session to open it.

Use a QR code to quickly open a session on your phone

  1. In an interactive session, enter the /remote slash command to redisplay the remote session details.

  2. Press Ctrl+E to toggle on/off display of a QR code.

    참고

    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.

  3. Scan the QR code with your phone to go directly to the session in GitHub Mobile.

Preventing your machine from going to sleep

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 GitHub.com or GitHub Mobile.

In an interactive session, enter /keep-alive OPTION, where OPTION is one of:

  • on: Prevents the machine from going to sleep while the CLI session is active.
  • off: Allows the machine to go to sleep as normal.
  • busy: Prevents the machine from going to sleep only while Copilot 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 Copilot is waiting for you to respond to a request for input from you.
  • 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.

Without passing an OPTION, the /keep-alive command displays the current keep-alive status.

Resuming a session with remote access

When you shut down a session that has remote access enabled, the CLI displays a resume command that includes --remote:

copilot --resume=SESSION_ID --remote

Use this command to restart the session with remote access enabled.

Similarly, adding --remote to a copilot --continue command resumes the most recent session with remote access enabled.

If you have "remoteSessions": true in your Copilot configuration file, resumed sessions will have remote access enabled automatically and you do not need to use the --remote option.

Preventing remote access

Remote access is disabled by default, but may be enabled in your Copilot configuration file. You can ensure a session is not remotely accessible by:

  • For a single session: Start the CLI with --no-remote to prevent remote access for that session, regardless of your configuration file setting.
  • Permanently: Remove the "remoteSessions": true setting from your Copilot configuration file (or set it to false).