{"record":{"id":"c9df67f0013a2bb0","repo":"atuinsh/atuin","slug":"is-a-table-use-a-dotted-key-like-key-to","errorCode":null,"errorMessage":"'{}' is a table; use a dotted key like '{}.key' to set a value within it","messagePattern":"'(.+?)' is a table; use a dotted key like '(.+?)\\.key' to set a value within it","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin/src/command/client/config.rs","lineNumber":346,"sourceCode":"    // Navigate/create intermediate tables\n    for &part in &parts[..parts.len() - 1] {\n        if !current.contains_key(part) {\n            current.insert(part, Item::Table(Table::new()));\n        }\n        current = current\n            .get_mut(part)\n            .expect(\"just inserted or already exists\")\n            .as_table_like_mut()\n            .ok_or_else(|| eyre::eyre!(\"'{}' exists but is not a table\", part))?;\n    }\n\n    let last = *parts.last().unwrap();\n\n    // Don't silently overwrite a table with a scalar value\n    if let Some(existing) = current.get(last)\n        && (existing.is_table() || existing.is_inline_table())\n    {\n        eyre::bail!(\n            \"'{}' is a table; use a dotted key like '{}.key' to set a value within it\",\n            key,\n            key\n        );\n    }\n\n    if let Some(item) = current.get_mut(last) {\n        let mut value = value;\n        if let Some(old_value) = item.as_value_mut() {\n            // Preserve any commands attached to the old value.\n            std::mem::swap(value.decor_mut(), old_value.decor_mut());\n        }\n        *item = Item::Value(value);\n    } else {\n        current.insert(last, Item::Value(value));\n    }\n\n    Ok(())","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/atuinsh/atuin/blob/c0c717ab04c881764bcad4b3d169a507e2432643/crates/atuin/src/command/client/config.rs#L328-L364","documentation":"When setting a config key, atuin refuses to overwrite an existing TOML table (or inline table) with a scalar value. If the final segment of the dotted key currently holds a table, the command bails and tells you to append another segment so you set a value *inside* the table instead of replacing it.","triggerScenarios":"Running `atuin config set stats` (or any key like `sync`, `daemon`, `keys`) with a scalar value when that top-level key is a table in config.toml, e.g. `atuin config set daemon true`.","commonSituations":"Assuming a key is a plain value when it is actually a namespace; typos like `atuin config set sync true` instead of `atuin config set sync.records true`; migrating old flat settings into the new nested schema.","solutions":["Add the leaf key: `atuin config set daemon.enabled true` instead of `atuin config set daemon true`.","Check the existing structure first: `atuin config get --verbose <table>` or read ~/.config/atuin/config.toml.","If replacing the whole table is truly intended, edit config.toml manually.","Use tab completion or `atuin doctor` to discover valid nested keys."],"exampleFix":"// before\natuin config set daemon true\n// error: 'daemon' is a table; use a dotted key like 'daemon.key'...\n// after\natuin config set daemon.enabled true","handlingStrategy":"validation","validationCode":"# inspect whether the target key is a table before setting\natuin config get --verbose daemon || true\ntomlq '.daemon | type' ~/.config/atuin/config.toml 2>/dev/null","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Read the existing config.toml structure before running `config set` on top-level names.","Assume namespace-looking names (daemon, sync, stats, keys) are tables.","Always set a leaf key one level deeper than a table."],"tags":["config","toml","cli","type-mismatch"],"backgroundTag":"incompatible-source-type","analyzedSha":"c0c717ab04c881764bcad4b3d169a507e2432643","analyzedAt":"2026-09-12T07:40:01.341Z","contentChangedAt":"2026-09-12T07:40:01.341Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}