Manual Configuration Editing
Relevant source files
The following files were used as context for generating this wiki page:
Manual Configuration Editing refers to the process of directly modifying the ollacc configuration file to manage authentication tokens, API endpoints, and default model selections. While the ollacc launcher provides interactive prompts and CLI flags for configuration management, the system is designed to allow users to edit the configuration file directly using a text editor.
The configuration file is a simple Bash-compatible script located in the user's home directory. This design allows for a flexible workflow where users can programmatically or manually set environment variables that the launcher sources at runtime.
Sources: README.md:104-106, lib/auth.sh:7-12
Configuration File Structure and Location
The configuration file is stored at ~/.ollacc/config. During the installation process, the installer creates this directory with restricted permissions (chmod 700) and initializes the config file with chmod 600 to ensure that only the owner can read or write sensitive information, such as the API key.
Sources: install.sh:42-43, install.sh:65-72, README.md:104-106
File Format
The configuration file follows a standard shell variable assignment format: KEY="VALUE". Because the launcher uses the . (source) command to load these values, the file can technically include shell comments and other Bash logic, provided the primary keys are maintained.
Sources: lib/auth.sh:9-11, README.md:111-113
Key Configuration Variables
The following table describes the variables stored within the configuration file:
| Variable | Description | Default / Example |
|---|---|---|
ANTHROPIC_AUTH_TOKEN | The Bearer token used for Ollama Cloud API authentication. | "" |
ANTHROPIC_BASE_URL | The endpoint for the Ollama Cloud API. | https://ollama.com |
OLLAMA_CLAUDE_DEFAULT_MODEL | The model slug used when ollacc is run without flags. | "" |
Sources: install.sh:68-70, lib/auth.sh:12, README.md:108-110
Internal Configuration Logic
The ollacc system uses a set of internal functions to interact with the configuration file. When editing manually, it is important to understand how these functions read and write to the file to avoid conflicts.
Reading Configuration
The auth_load_config function is responsible for sourcing the file. If the ANTHROPIC_BASE_URL is not defined within the file, it defaults to https://ollama.com.
This diagram shows the logic used to load configuration at runtime.
Sources: lib/auth.sh:7-13
Writing Configuration
The system uses config_set and bash_escape to programmatically update values while preserving comments. The bash_escape function specifically handles special characters to prevent shell injection or syntax errors when the file is sourced.
Sources: lib/config.sh:11-30, lib/config.sh:36-61
Interaction with Management Flags
The ollacc CLI provides flags that perform "manual" actions programmatically. These flags interact directly with the configuration file by unsetting specific keys.
--model-clear: Removes theOLLAMA_CLAUDE_DEFAULT_MODELentry from the config.--key-clear: Removes theANTHROPIC_AUTH_TOKENentry from the config.
Sources: lib/flags.sh:12-32, README.md:91-94
Security Considerations
Manual editing must respect the security constraints established by the installer. The configuration file contains the ANTHROPIC_AUTH_TOKEN, which is sensitive.
- Permissions: The file should always maintain
600permissions. Theconfig_setfunction explicitly enforces this by runningchmod 600after updates. - Environment Variables: The launcher exports these values to the environment before executing the
claudecommand. Notably,ANTHROPIC_API_KEYis always exported as an empty string to ensure the SDK uses theANTHROPIC_AUTH_TOKEN.
Sources: lib/config.sh:41, lib/auth.sh:65-69, README.md:162-167
Conclusion
Manual configuration editing provides power users with the ability to bypass interactive menus and manage multiple environments or keys. By adhering to the KEY="VALUE" format and ensuring strict file permissions, users can safely integrate ollacc into their custom workflows.