For the complete documentation index, see llms.txt. This page is also available as Markdown.

Configure Default Working Directory

Commander supports flexible configuration of its working directory through environment variables and command-line parameters, including full XDG Base Directory Specification compliance.

Overview

By default, Commander stores its configuration and logging files in ~/.keeper. You can customize this location using environment variables for system-wide configuration or command-line parameters for session-specific overrides.

Supported Methods

Command-Line Parameter

Use --data-dir to override the working directory for a specific session.

keeper shell --data-dir /tmp/keeper-session
# Uses: /tmp/keeper-session/.keeper/

Environment Variables

KEEPER_DATA_HOME

Set a custom data directory for Commander across all sessions.

export KEEPER_DATA_HOME="/opt/keeper-data"
keeper shell
# Uses: /opt/keeper-data/.keeper/

XDG_DATA_HOME (XDG Compliance)

Follow the XDG Base Directory Specification for organized user data.

export XDG_DATA_HOME="$HOME/.local/share"
keeper shell
# Uses: $HOME/.local/share/.keeper/

Precedence Order

Commander determines the working directory using the following precedence (highest to lowest):

  1. CLI Parameter - --data-dir flag

  2. KEEPER_DATA_HOME - Environment variable

  3. XDG_DATA_HOME - XDG Base Directory Specification

  4. Default - ~/.keeper (legacy compatibility)

Smart Path Handling

Commander automatically appends .keeper to paths when needed:

Auto-Append Behavior

  • Input: /Users/john → Output: /Users/john/.keeper

  • Input: /Users/john/.keeper → Output: /Users/john/.keeper (unchanged)

This applies to both CLI parameters and the KEEPER_DATA_HOME environment variable.

XDG Compliance

When using XDG_DATA_HOME, Commander always appends .keeper:

  • XDG_DATA_HOME=/opt/data → Uses /opt/data/.keeper

Usage Examples

Basic Environment Variable Setup

XDG Base Directory Compliance

Session-Specific Override

Corporate Environment

Command-Line Reference

Global Options

Parameters:

  • --data-dir <path> - Directory to use for Commander data (overrides environment variables)

Examples:

Environment Variable Reference

Variable
Description
Example

KEEPER_DATA_HOME

Custom Commander data directory

/opt/keeper

XDG_DATA_HOME

XDG Base Directory for user data

$HOME/.local/share

Troubleshooting

Common Issues

Permission Errors

Ensure the specified directory is writable:

Path Not Found

Commander creates directories automatically, but parent directories must exist:

Environment Variable Not Working

Verify the environment variable is set correctly:

Compatibility Notes

  • Backward Compatible: Existing ~/.keeper installations continue working

  • Forward Compatible: New environment variables provide enhanced flexibility

  • Cross-Platform: Works on macOS, Linux, and Windows

  • XDG Compliant: Follows Unix standards for data directory organization

Last updated