config

package
v0.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config handles loading and parsing the memsh configuration file (~/.memsh/config.toml) and converting the configuration into shell.Option slices for use with shell.New().

A missing config file is not an error - sensible defaults are returned.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildShellOpts

func BuildShellOpts(cfg Config) []shell.Option

BuildShellOpts converts the loaded config into shell options.

Types

type Config

type Config struct {
	Shell   ShellConfig   `toml:"shell"`
	Plugins PluginsConfig `toml:"plugins"`
}

Config is the structure of ~/.memsh/config.toml.

func Load

func Load() (Config, error)

Load reads ~/.memsh/config.toml. A missing file is not an error — defaults are returned silently.

type PluginsConfig

type PluginsConfig struct {
	// WASM is an allowlist of WASM plugin names to load from ~/.memsh/plugins/.
	// When empty all discovered .wasm files are loaded.
	// Example: wasm = ["python", "ruby"]
	WASM []string `toml:"wasm"`

	// Disable is a list of plugin names (native or WASM) to exclude.
	// Example: disable = ["wc"]
	Disable []string `toml:"disable"`
}

PluginsConfig controls which plugins are loaded.

type ShellConfig

type ShellConfig struct {
	// WASM enables or disables the wazero WASM plugin runtime.
	// Set to false to skip all WASM plugin loading (faster startup).
	// Default: true.
	WASM bool `toml:"wasm"`
}

ShellConfig controls core shell behaviour.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL