amp
Declarative Amp configuration. Manage your ~/.config/amp/settings.json from a Lua table — MCP servers, permissions, thinking mode, and more.
lua
local amp = require("rootbeer.amp")Example
lua
amp.config({
thinking = true,
updates_mode = "warn",
mcp_servers = {
playwright = {
command = "npx",
args = { "-y", "@playwright/mcp@latest", "--headless" },
},
},
permissions = {
{ tool = "Bash(npm run *)", mode = "allow" },
{ tool = "Bash(rm *)", mode = "ask" },
},
})
amp.prompt([[
## Conventions
- Use TypeScript with strict mode
- Prefer functional patterns over classes
- Always run tests before committing
- Use conventional commit messages
]])API Reference
config(cfg)
Writes Amp settings to cfg.path as JSON.
always_include_pathsstring[]optionalGlob patterns always included in fuzzy search (
amp.fuzzy.alwaysIncludePaths).mcp_serverstable<string, amp.McpServer>optionalMCP server configurations (
amp.mcpServers).pathstringoptionalWhere to write settings. Defaults to
"~/.config/amp/settings.json".permissionsamp.Permission[]optionalPermission rules (
amp.permissions).thinkingbooleanoptionalEnable Claude's extended thinking (
amp.anthropic.thinking.enabled).updates_mode("auto"|"disabled"|"warn")optionalUpdate checking behavior (
amp.updates.mode).prompt(content, path)
Writes the global AGENTS.md instructions file. This file is loaded by Amp at the start of every session and applies across all projects. Use it for personal coding conventions, preferred tools, and project-agnostic guidance.
contentstringThe markdown content for the instructions file.
pathstring?Where to write the file. Defaults to
"~/.config/amp/AGENTS.md".amp.McpServer
argsstring[]optionalCommand arguments.
commandstringoptionalCommand to run (for local servers).
envtable<string, string>optionalEnvironment variables.
headerstable<string, string>optionalHTTP headers.
include_toolsstring[]optionalTool name filters.
urlstringoptionalServer endpoint (for remote servers).
amp.Permission
mode"allow"|"ask"|"delegate"|"deny"Permission mode.
toolstringTool pattern to match.