feat: clone GitHub repo into a workspace (#1331)
* feat: clone GitHub repo into a workspace Add an end-to-end "clone a GitHub repo and register it as a Paseo workspace" flow: a new workspace.github.clone RPC, daemon handler, client method, CLI `paseo clone` command, and a GitHub-repo mode in the project picker modal. Gated behind the workspaceGithubClone server capability flag. - protocol: workspace.github.clone request/response schemas + feature flag - server: handleWorkspaceGithubCloneRequest, normalizeCloneRepository - client: DaemonClient.cloneGithubWorkspace - cli: `paseo clone <repo> --dir <path> [--protocol https|ssh]` - app: GitHub-repo mode, clone-protocol picker, error surfacing Review fixes: - CLI clone now checks the workspaceGithubClone capability and fails fast with a clear "update the host" error instead of hanging for the full request timeout against an older daemon. - Replace the duplicated client-side URL-detection regex (app + CLI) with a shared isCompleteGitRemote() in @getpaseo/protocol/git-remote, backed by parseGitRemoteLocation so clients classify remotes identically to the daemon (fixes confusing errors for git://, ftp://, file:// inputs). - Add git-remote.test.ts covering the shared classifier. * Fix GitHub clone failure handling --------- Co-authored-by: Mohamed Boudra <boudra.moha@gmail.com>
This commit is contained in:
co-authored by
Mohamed Boudra
parent
bac302626f
commit
218097b7cc
@@ -25,6 +25,7 @@ import { addArchiveOptions, runArchiveCommand } from "./commands/agent/archive.j
|
||||
import { addAttachOptions, runAttachCommand } from "./commands/agent/attach.js";
|
||||
import { addImportOptions, runImportCommand } from "./commands/agent/import.js";
|
||||
import { withOutput } from "./output/index.js";
|
||||
import { runCloneCommand } from "./commands/clone.js";
|
||||
import { onboardCommand } from "./commands/onboard.js";
|
||||
import {
|
||||
addDaemonHostOption,
|
||||
@@ -66,6 +67,20 @@ export function createCli(): Command {
|
||||
withOutput(runImportCommand),
|
||||
);
|
||||
|
||||
addJsonAndDaemonHostOptions(
|
||||
program
|
||||
.command("clone")
|
||||
.description("Clone a GitHub repo and register it as a Paseo workspace")
|
||||
.argument("<repo>", "GitHub repo in owner/repo format or a full git remote URL")
|
||||
.requiredOption("--dir <path>", "Parent directory to clone into (for example: ~/workspace)"),
|
||||
)
|
||||
.addOption(
|
||||
new Option("--protocol <protocol>", "Protocol for owner/repo shorthand repositories").choices(
|
||||
["https", "ssh"],
|
||||
),
|
||||
)
|
||||
.action(withOutput(runCloneCommand));
|
||||
|
||||
addDaemonHostOption(addAttachOptions(program.command("attach"))).action(runAttachCommand);
|
||||
|
||||
addDaemonHostOption(addLogsOptions(program.command("logs"))).action(runLogsCommand);
|
||||
|
||||
Reference in New Issue
Block a user