Skip to content

[FEATURE]: support cloning repositories from URL in new project flow #29723

@Ekaanth

Description

@Ekaanth
  • I have verified this feature I'm about to request hasn't been suggested before.

Note: This overlaps with #18241 but is scoped differently — #18241 focuses on replacing GitHub Desktop with a desktop-only clone flow. This request covers the new project/import flow across all platforms (desktop and web), adding a dialog with both GitHub URL import and local folder import as first-class options in the home screen.

Describe the enhancement you want to request

When adding a new project in OpenCode, users can only select an existing local directory. There is no way to clone a repository directly from a URL. Users must manually clone elsewhere (terminal, GitHub Desktop, etc.) and then import the folder into OpenCode.

Add a New Project dialog that offers two import paths:

  1. Import from GitHub — Paste a repository URL (e.g. `https://github.com/org/repo\` or shorthand `org/repo`), choose a destination directory, and OpenCode clones and opens it as a project.
  2. Import from folder — The existing directory picker flow (unchanged).

User Flow

  • When the user clicks New Project, a dialog appears with the two import options.
  • Selecting Import from GitHub shows a URL input field and a destination directory picker (native picker on desktop, server-side browser on web).
  • OpenCode runs `git clone` to the chosen destination and registers the cloned directory as a project.
  • Selecting Import from folder keeps the current directory picker behavior unchanged.

Implementation Areas

Area File(s)
Backend clone endpoint `packages/opencode/src/server/routes/instance/httpapi/groups/project.ts`
Backend clone service `packages/opencode/src/project/project.ts`
New project dialog (new file) `packages/app/src/components/dialog-new-project.tsx`
Home page integration `packages/app/src/pages/home.tsx`

Existing utilities to reuse: `AppProcess.run()` for executing git commands, `DialogSelectDirectory` for destination browsing on web, `platform.openDirectoryPickerDialog` for native desktop picker, `RepositoryCache` as reference for clone logic.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions