feat: support non-git directories as local workspaces#825
Merged
Conversation
|
@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. |
Contributor
📄 Knowledge review✏️ Documentation updates4 pages were updated by changes in this PR.
📝 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 |
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.
99b0f42 to
125e383
Compare
# Conflicts: # sidecar/src/claude/session-manager.ts # sidecar/src/codex/app-server.ts
# Conflicts: # src/features/workspace-start/index.tsx
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 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.
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.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): cleanagent-path-env,git-access,codex-app-server,claude-session-manager— passApp.add-repo, settings round-trip — passcargo clippy -- -D warningsclean; repository/repos unit tests passA changeset is included (
minor).