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 ¶
- func PrepareClaudeConfig(log *logger.Logger, hostConfigDir, containerHomeDir, containerWorkDir string) (stagingDir string, cleanup func(), err error)
- func PrepareCredentials(log *logger.Logger, hostConfigDir string) (stagingDir string, cleanup func(), err error)
- func PreparePostInitTar(cfg config.Config, script string) (io.Reader, error)
- func ResolveHostConfigDir() (string, error)
- func ResolveHostProjectsDir() (string, bool, error)
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 ¶
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 ¶
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
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.