---
title: core_settings | CodeWeaver Docs
description: API reference for codeweaver.core.config.core_settings
url: "https://docs.knitli.com/api/core/config/core_settings"
type: static
generatedAt: "2026-04-17T17:21:07.881Z"
---

# core_settings
       [Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fconfig%2Fcore_settings%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fconfig%2Fcore_settings%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[View in Markdown](/codeweaver/api/core/config/core_settings.md)       [Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fconfig%2Fcore_settings%2F)[Share on X](https://x.com/intent/tweet?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fconfig%2Fcore_settings%2F&text=core_settings)[Share on Threads](https://threads.net/intent/post?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fconfig%2Fcore_settings%2F&text=core_settings)[Share on Bluesky](https://bsky.app/intent/compose?text=core_settings%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fconfig%2Fcore_settings%2F)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fconfig%2Fcore_settings%2F)[Share on Reddit](https://reddit.com/submit?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fconfig%2Fcore_settings%2F&title=core_settings)[Share on Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fconfig%2Fcore_settings%2F&t=core_settings)[Share on Email](mailto:?subject=core_settings&body=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fconfig%2Fcore_settings%2F)[Share on WhatsApp](https://wa.me/?text=core_settings%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fconfig%2Fcore_settings%2F)[Share on Telegram](https://t.me/share/url?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fconfig%2Fcore_settings%2F&text=core_settings)
# `codeweaver.core.config.core_settings`
[Section titled “codeweaver.core.config.core_settings”](#codeweavercoreconfigcore_settings)
Root settings for core-only CodeWeaver installation.

This module provides the root settings class when only the core package is installed (logging and telemetry configuration only).

## Class: `CodeWeaverCoreSettings`
[Section titled “Class: CodeWeaverCoreSettings”](#class-codeweavercoresettings)
Root settings for core-only CodeWeaver installation, and base settings for all CodeWeaver installations. Other CodeWeaver packages extend this class to add additional configuration as needed.

The class also includes an implementation of BaseSettings’s `settings_customize_sources` method to define a comprehensive and prioritized configuration source hierarchy, including support for environment variables, dotenv files, multiple configuration file formats in a dozen or so locations, and secret management services.

When only the core package is installed, this provides configuration for logging and telemetry only. All other CodeWeaver functionality requires additional packages (providers, engine, server).

Configuration structure:


**

```
[logging]level = "INFO"
[telemetry]enabled = true
```

### Method: `finalize`
[Section titled “Method: finalize”](#method-finalize)

**

```
finalize()
```

Finalize settings after loading.

This method exists for backwards compatibility and may be used for future settings post-processing if needed.

Returns: Self for chaining

Note: This method is idempotent - calling it multiple times is safe.

### Method: `from_config`
[Section titled “Method: from_config”](#method-from_config)

**

```
from_config()
```

Create a CodeWeaverSettings instance from a configuration file.

This is a convenience method for creating a settings instance from a specific config file. By default, CodeWeaverSettings will look for configuration files in standard locations (like codeweaver.toml in the project root — see `get_config_locations`). This method allows you to specify a particular config file to load settings from, primarily for testing or special use cases.

### Method: `generate_default_config`
[Section titled “Method: generate_default_config”](#method-generate_default_config)

**

```
generate_default_config()
```

Generate a default configuration file at the specified path.

The file format is determined by the file extension (.toml, .yaml/.yml, .json).

### Method: `json_schema`
[Section titled “Method: json_schema”](#method-json_schema)

**

```
json_schema()
```

Get the JSON validation schema for the settings model.

Note: For build-time schema generation, use scripts/build/generate-schema.py instead. This method is kept for runtime introspection and testing purposes.

### Method: `python_json_schema`
[Section titled “Method: python_json_schema”](#method-python_json_schema)

**

```
python_json_schema()
```

Get the JSON validation schema for the settings model as a string.

### Method: `save_to_file`
[Section titled “Method: save_to_file”](#method-save_to_file)

**

```
save_to_file()
```

Save the current settings to a configuration file.

The file format is determined by the file extension (.toml, .yaml/.yml, .json).

### Method: `serialize_for_telemetry`
[Section titled “Method: serialize_for_telemetry”](#method-serialize_for_telemetry)

**

```
serialize_for_telemetry()
```

Serialize the model for telemetry output, filtering sensitive keys.

### Method: `settings_customize_sources`
[Section titled “Method: settings_customize_sources”](#method-settings_customize_sources)

**

```
settings_customize_sources()
```

Customize settings sources for CodeWeaverSettings and subclasses.

This method defines the configuration source hierarchy for CodeWeaver settings classes. Init settings are deliberately excluded — the `nested_model_default_partial_update` config causes InitSettingsSource to serialize model instances to dicts, losing type information needed for discriminated unions. Profile-based defaults are handled by `ProviderSettings` validators instead.

### Method: `view`
[Section titled “Method: view”](#method-view)

**

```
view()
```

Get a read-only mapping view of the settings.

### Method: `write_json_schema`
[Section titled “Method: write_json_schema”](#method-write_json_schema)

**

```
write_json_schema()
```

Write the JSON schema to a file.

If no path is provided, writes to ‘codeweaver.schema.json’ in the current directory.

## Function: `aws_secret_store_configured`
[Section titled “Function: aws_secret_store_configured”](#function-aws_secret_store_configured)

**

```
aws_secret_store_configured()
```

Check if AWS Secrets Manager is configured for use as a settings source.

## Function: `azure_key_vault_configured`
[Section titled “Function: azure_key_vault_configured”](#function-azure_key_vault_configured)

**

```
azure_key_vault_configured()
```

Check if Azure Key Vault is configured for use as a settings source.

## Function: `get_config_locations`
[Section titled “Function: get_config_locations”](#function-get_config_locations)

**

```
get_config_locations()
```

Get standard configuration file locations for CodeWeaverSettings.

Also ensures that the user configuration directories exist with correct permissions.

## Function: `get_dotenv_locations`
[Section titled “Function: get_dotenv_locations”](#function-get_dotenv_locations)

**

```
get_dotenv_locations()
```

Get standard dotenv file locations for CodeWeaverSettings.

## Function: `get_possible_config_paths`
[Section titled “Function: get_possible_config_paths”](#function-get_possible_config_paths)

**

```
get_possible_config_paths()
```

Get possible configuration file paths for CodeWeaverSettings.

## Function: `google_secret_manager_configured`
[Section titled “Function: google_secret_manager_configured”](#function-google_secret_manager_configured)

**

```
google_secret_manager_configured()
```

Check if Google Secret Manager is configured for use as a settings source.