Documentation
¶
Overview ¶
Package containerfs prepares host Claude Code configuration for container injection.
This is a leaf package: it imports internal/config, 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 PrepareHookTar(cfg config.Config, shell, script, name 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 PrepareHookTar ¶ added in v0.10.0
PrepareHookTar tars a shell-wrapped user hook script to .clawker/<name>.sh (mode 0755) for extraction at /home/claude. An empty script yields a valid no-op wrapper ("#!/bin/$shell\nset -e\n"), letting callers deliver a guaranteed-present script even when the hook is unset (overwriting any stale prior content).
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.