project

package
v0.11.0-rc7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupWorkspaceConfigs

func CleanupWorkspaceConfigs(arcHome, workspaceID string) (int, error)

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

func FindProjectRoot(dir string) (string, error)

FindProjectRoot resolves the project root for the given directory using the default arc home (~/.arc). Resolution order:

  1. Git walk — walk up looking for .git/
  2. Prefix walk — longest-to-shortest match in ~/.arc/projects/
  3. Returns error if nothing found

func FindProjectRootWithArcHome

func FindProjectRootWithArcHome(dir string, arcHome string) (string, error)

FindProjectRootWithArcHome resolves the project root using a custom arc home.

func PathToProjectDir

func PathToProjectDir(absPath string) string

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

func WriteConfig(arcHome, absProjectPath string, cfg *Config) error

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

func LoadConfig(arcHome, absProjectPath string) (*Config, error)

LoadConfig reads a project config from ~/.arc/projects/<path>/config.json.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL