Skip to content

Start a new session in programmatic modeΒ #442

@gridsandspaces

Description

@gridsandspaces

Describe the feature or problem you'd like to solve

Add a command for starting a new session --start-session and return the ID

Proposed solution

When using the CLI we currently have the ability to --resume {id} or --continue, but there is no programmatic way to start a new session or easily capture the most recent session ID.

When using the CLI in an application it would be very convenient to start a new session, capture the ID and then use --resume {id} on all subsequent prompts.

Pseudo Code:

let session_id = copilot --start-session
copilot -p "review the README.md contents and make them sound more professional" --resume {session_id}
copilot -p "review the README.md contents and make them sound more professional" --continue

In its current form, users must look at the .copilot/logs or .copilot/session-state to locate a session GUID and apply it.

Example prompts or workflows

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions