Skip to content

feat: support non-git directories as local workspaces#825

Merged
natllian merged 10 commits into
dohooo:mainfrom
JRBusiness:feat/non-git-directories
Jun 23, 2026
Merged

feat: support non-git directories as local workspaces#825
natllian merged 10 commits into
dohooo:mainfrom
JRBusiness:feat/non-git-directories

Conversation

@JRBusiness

Copy link
Copy Markdown
Contributor

Summary

Adds opt-in support for attaching sessions to plain local folders that are not git repositories, so Helmor can be used in a directory without initializing git.

  • New Non-git directories toggle (Settings → General). When enabled, Open project can attach a session to any local folder; these run as local-mode sessions with no branch/worktree actions.
  • Repository/workspace layer (models/repos.rs, workspace/lifecycle.rs, repository_commands.rs) resolves a non-git root when the toggle is on and the folder isn't a git repo, instead of failing.
  • Hardens agent process environment resolution so the bundled CLIs find their PATH reliably — Windows PATH is rebuilt from the registry (agent-path-env.ts, used by the Claude/Codex/OpenCode session managers) — and resolves git pointer-file paths correctly for Windows absolute and UNC paths (git-access.ts). Both are platform-guarded and no-op off Windows.

Testing

  • bun run typecheck (frontend + sidecar): clean
  • Sidecar tests: agent-path-env, git-access, codex-app-server, claude-session-manager — pass
  • Frontend tests: App.add-repo, settings round-trip — pass
  • Rust: cargo clippy -- -D warnings clean; repository/repos unit tests pass

A changeset is included (minor).

@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

@jerryluong94-create is attempting to deploy a commit to the Caspian's Team Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 13, 2026
@dosubot

dosubot Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

📄 Knowledge review

✏️ Documentation updates

4 pages were updated by changes in this PR.

Page Library Status
01 - Repository Helmor ✅ Updated
02 - Workspace Helmor ✅ Updated
03 - Add a Repository Helmor ✅ Updated
04 - Create a Workspace Helmor ✅ Updated
📝 01 - Repository — changes
@@ -1,15 +1,17 @@
 # 01 - Repository
 
-A repository is the foundational object in Helmor. It represents the source project — the file tree, Git history, branches, and context that agents use to perform coding tasks.
+A repository is the foundational object in Helmor. It represents the source project — the file tree and context that agents use to perform coding tasks. Most repositories are Git projects with history, branches, and a default branch. When the **Non-git directories** setting is enabled (Settings → General), Helmor can also attach to plain local folders without Git.
 
 ## What a repository provides
 
-When you add a repository, Helmor gains access to:
+When you add a Git repository, Helmor gains access to:
 
 - **File tree** — browse, search, and open any file in the project.
 - **Git history** — view commits, branches, and tags.
 - **Branch context** — workspaces branch from the repository's default or target branch.
 - **Diff baseline** — agent changes are compared against the repository state.
+
+Non-git directories (when enabled) provide file tree access only, without version control features.
 
 ## Local vs. GitHub-connected
 
@@ -22,7 +24,11 @@
 
 ## Adding a repository
 
-Open Helmor, click **Add Repository**, and choose either a local folder or a GitHub import. Helmor detects the default branch and indexes the project. See [Add a Repository](https://app.dosu.dev/9207e853-a462-496b-ac67-bc8e8fde3782/documents/cbe4cfca-a0c7-4df6-a09a-8098e64ad12a) for the step-by-step guide.
+Open Helmor, click **Add Repository**, and choose either a local folder or a GitHub import. For Git repositories, Helmor detects the default branch and indexes the project.
+
+When **Non-git directories** is enabled (Settings → General), you can add any local folder, even if it's not a Git project. Non-git directories have no Git history, branches, or default branch — they provide access to the file tree only, without version control features.
+
+See [Add a Repository](https://app.dosu.dev/9207e853-a462-496b-ac67-bc8e8fde3782/documents/cbe4cfca-a0c7-4df6-a09a-8098e64ad12a) for the step-by-step guide.
 
 ## Best practices
 
📝 02 - Workspace — changes
@@ -2,19 +2,29 @@
 
 A workspace is the central unit of work in Helmor. It represents an isolated working copy — a branch, a file tree, and a set of sessions — dedicated to a single task.
 
+> **Note:** When the **Non-git directories** toggle is enabled in Settings → General, Helmor can attach sessions to plain local folders that are not git repositories. These non-git directory workspaces always run in Local isolation mode and have no branch context (display "Files" as a pseudo-branch). They do not support worktree or branch operations and provide no diff baseline or git history.
+
 ## What a workspace provides
+
+For git-based workspaces:
 
 - **Branch isolation** — each workspace gets its own Git branch so agent edits never contaminate other work.
 - **File tree** — browse, search, and edit files scoped to this workspace's state.
 - **Session history** — every agent conversation and its resulting changes are recorded.
 - **Diff baseline** — changes are compared against the workspace's target branch.
 
+For non-git directory workspaces (opt-in):
+
+- **File tree** — direct access to the local folder's contents.
+- **Session history** — agent conversations are recorded as usual.
+- No branch isolation, diff baseline, or git operations.
+
 ## Isolation modes
 
 | Mode | How it works |
 |------|-------------|
-| **Worktree** (default) | Creates a dedicated `git worktree` directory. Full isolation — the workspace has its own branch and disk copy. |
-| **Local** | Points directly at the repository root. Multiple conversations share the same files. Useful for quick edits without branching overhead. |
+| **Worktree** (default) | Creates a dedicated `git worktree` directory. Full isolation — the workspace has its own branch and disk copy. Git repositories only. |
+| **Local** | Points directly at the repository root. Multiple conversations share the same files. Useful for quick edits without branching overhead. For non-git directories, this is the only available mode (no branch picker or git-based isolation). |
 | **Chat** | A scratch directory with no Git binding. Good for exploratory questions where you don't need file changes. |
 
 ## Lifecycle
@@ -28,8 +38,12 @@
 
 ## Branching behavior
 
+For git-based workspaces:
+
 - **FromBranch** — Helmor forks a new branch from your selection. The workspace owns the branch; archiving deletes it.
 - **UseBranch** — the workspace attaches to an existing branch. The branch is preserved on archive.
+
+Non-git directory workspaces do not support branching behavior.
 
 ## Best practices
 
📝 03 - Add a Repository — changes
@@ -9,6 +9,12 @@
 3. Confirm the detected default branch (e.g., `main` or `master`).
 
 The repository appears in your sidebar immediately. Helmor reads the Git history, branches, and file tree from disk.
+
+### Non-git directories
+
+By default, Helmor expects a local Git project folder. If you need to work with a directory that isn't a git repository, enable **Non-git directories** in **Settings → General**. With this setting enabled, **Open project** can attach sessions to any local folder — not just git repositories.
+
+Non-git directories run as local-mode sessions with no branch or worktree actions. Helmor reads only the file tree; Git history, branches, and version control features are unavailable.
 
 ## Add a GitHub repository
 
📝 04 - Create a Workspace — changes
@@ -1,6 +1,8 @@
 # 04 - Create a Workspace
 
 A workspace is an isolated working copy where one task lives. It gives your agent a clean environment tied to a branch, separate from everything else in the repository.
+
+> **Non-git directories:** With the **Non-git directories** toggle enabled in Settings → General, workspaces can be created for plain local folders that aren't git repositories. Non-git directory workspaces always use **Local** isolation mode, have no branch picker, and skip all worktree/branch operations.
 
 ## Create a workspace
 
@@ -16,7 +18,7 @@
 | Mode | Description | Use case |
 |------|-------------|----------|
 | **Worktree** (default) | Dedicated `git worktree` directory with its own branch. | Standard agent tasks — full isolation. |
-| **Local** | Operates directly on the repository root. | Quick edits where you don't need branch isolation. |
+| **Local** | Operates directly on the repository root (git) or folder root (non-git). | Quick edits where you don't need branch isolation; or working in a non-git directory (displays "Files" as pseudo-branch, no git-based isolation). |
 | **Chat** | Scratch directory with no Git binding. | Exploratory questions, no file changes needed. |
 
 ## Workspace lifecycle

Leave Feedback Ask Dosu about helmor

Allow attaching sessions to plain local folders that are not git
repositories, behind an opt-in 'Non-git directories' setting. These run
as local-mode sessions with no branch/worktree actions.

Also harden agent process environment resolution: rebuild Windows PATH
from the registry so bundled CLIs resolve reliably, and handle Windows
absolute/UNC paths when resolving git pointer files.
@JRBusiness JRBusiness force-pushed the feat/non-git-directories branch from 99b0f42 to 125e383 Compare June 13, 2026 05:11
@natllian natllian merged commit 4d07a72 into dohooo:main Jun 23, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants