Documentation
¶
Index ¶
- func CleanupWorkspaceConfigs(arcHome, workspaceID string) (int, error)
- func DefaultArcHome() string
- func FindProjectRoot(dir string) (string, error)
- func FindProjectRootWithArcHome(dir string, arcHome string) (string, error)
- func PathToProjectDir(absPath string) string
- func WriteConfig(arcHome, absProjectPath string, cfg *Config) error
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupWorkspaceConfigs ¶
CleanupWorkspaceConfigs removes all project configs under arcHome that reference the given workspace ID. Returns the number of project directories removed.
func DefaultArcHome ¶
func DefaultArcHome() string
DefaultArcHome returns the default arc home directory (~/.arc).
func FindProjectRoot ¶
FindProjectRoot resolves the project root for the given directory using the default arc home (~/.arc). Resolution order:
- Git walk — walk up looking for .git/
- Prefix walk — longest-to-shortest match in ~/.arc/projects/
- Returns error if nothing found
func FindProjectRootWithArcHome ¶
FindProjectRootWithArcHome resolves the project root using a custom arc home.
func PathToProjectDir ¶
PathToProjectDir converts an absolute filesystem path to a project directory name. Replaces "/" with "-", matching the Claude Code ~/.claude/projects/ convention. Example: "/home/user/my-repo" → "-home-user-my-repo"
func WriteConfig ¶
WriteConfig writes a project config to ~/.arc/projects/<path>/config.json.
Types ¶
type Config ¶
type Config struct {
WorkspaceID string `json:"workspace_id"`
WorkspaceName string `json:"workspace_name"`
ProjectRoot string `json:"project_root"`
}
Config holds the per-project workspace binding.
func LoadConfig ¶
LoadConfig reads a project config from ~/.arc/projects/<path>/config.json.