containerfs

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package containerfs prepares host Claude Code configuration for container injection.

This is a leaf package: it imports internal/keyring, internal/logger, and stdlib only. No docker imports allowed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrepareClaudeConfig

func PrepareClaudeConfig(log *logger.Logger, hostConfigDir, containerHomeDir, containerWorkDir string) (stagingDir string, cleanup func(), err error)

PrepareClaudeConfig creates a staging directory with host claude config prepared for container injection. Caller must call cleanup() when done.

Handles: settings.json enabledPlugins merge, agents/, skills/, commands/, plugins/ (excluding install-counts-cache.json), known_marketplaces.json path fixup, symlink resolution.

func PrepareCredentials

func PrepareCredentials(log *logger.Logger, hostConfigDir string) (stagingDir string, cleanup func(), err error)

PrepareCredentials creates a staging directory with credentials.json. Sources: keyring first, then fallback to $CLAUDE_CONFIG_DIR/.credentials.json.

func PreparePostInitTar

func PreparePostInitTar(cfg config.Config, script string) (io.Reader, error)

PreparePostInitTar creates a tar archive containing a post-init script at .clawker/post-init.sh. The script is prefixed with a bash shebang and set -e, then the user's commands verbatim. The tar is designed for extraction at /home/claude, producing /home/claude/.clawker/post-init.sh. Returns an error if the script is empty or whitespace-only.

func ResolveHostConfigDir

func ResolveHostConfigDir() (string, error)

ResolveHostConfigDir returns the claude config dir ($CLAUDE_CONFIG_DIR or ~/.claude/). Returns error if the directory doesn't exist. A relative $CLAUDE_CONFIG_DIR is normalized to an absolute path against the current working directory so downstream consumers (e.g. workspace.GetClaudeProjectsMount) get a usable bind-mount source.

func ResolveHostProjectsDir added in v0.8.0

func ResolveHostProjectsDir() (string, bool, error)

ResolveHostProjectsDir returns <hostConfigDir>/projects when the directory exists on the host. The bool result is false when the dir does not exist — callers should skip the bind mount in that case rather than treating it as an error. Errors from ResolveHostConfigDir (e.g. CLAUDE_CONFIG_DIR pointing at a missing path) propagate verbatim. Uses os.Stat, so a symlink at the path resolves to its target. Never creates the directory; that is Claude Code's responsibility.

Types

This section is empty.

Jump to

Keyboard shortcuts

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