Add a dispatch new command to start a fresh session from the CLI#228
Open
jongio wants to merge 1 commit into
Open
Add a dispatch new command to start a fresh session from the CLI#228jongio wants to merge 1 commit into
jongio wants to merge 1 commit into
Conversation
Add a 'dispatch new [dir]' subcommand that starts a brand-new Copilot session directly from the command line, mirroring the TUI launch path. It reuses the existing resume builders, which treat an empty session ID as a new session, and honors the configured agent, model, and launch mode. Supports an optional directory argument and a --mode override. Wired into handleArgs, the three shell completion scripts, and usage output. Documented in the README. Closes #223 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
dispatch new [dir]subcommand that starts a brand-new Copilot session directly from the command line, without opening the TUI.Today the only way to start a fresh session is to launch the TUI or invoke the Copilot CLI by hand. This adds a first-class command that mirrors the TUI's launch behavior for new sessions.
What it does
dispatch newstarts a new session in the current directorydispatch new <dir>starts a new session in the given directorydispatch new --mode <mode>overrides the launch mode (inplace, tab, window, pane)The session reuses the configured agent, model, custom command, terminal, and launch mode. It relies on the existing resume builders, which treat an empty session ID as a new session (no
--resumeflag).Changes
cmd/dispatch/new.gowithrunNew,parseNewArgs,resolveNewDir, anddefaultNewLaunch. Reuses the launch helpers fromopen.go.newcase intohandleArgsand addednewto the bash, zsh, and PowerShell completion scripts and to usage output.cmd/dispatch/new_test.gocover arg parsing, directory resolution, and the launch seam.Testing
go build ./...go test ./cmd/dispatch/... -count=1go vet ./...golangci-lint run ./cmd/dispatch/...Closes #223