amp
The amp module manages Amp settings and project instructions from Lua. Use it for ~/.config/amp/settings.json, MCP servers, permissions, update behavior, and AGENTS.md content.
lua
local amp = require("rootbeer.amp")Configure Amp
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" },
},
})Write Instructions
Use amp.prompt() for the instructions you want Amp to follow in this config:
lua
amp.prompt([[
## Conventions
- Use TypeScript with strict mode
- Prefer functional patterns over classes
- Always run tests before committing
- Use conventional commit messages
]])API Reference
amp.config(cfg)
Writes Amp settings to cfg.path as JSON.
Parameters — cfg: amp.Config
always_include_pathsstring[]optionalGlob patterns always included in fuzzy search (
amp.fuzzy.alwaysIncludePaths).MCP server configurations (
amp.mcpServers).pathstringoptionalWhere to write settings. Defaults to
"~/.config/amp/settings.json".Permission rules (
amp.permissions).thinkingbooleanoptionalEnable Claude's extended thinking (
amp.anthropic.thinking.enabled).updates_mode"auto"|"disabled"|"warn"optionalUpdate checking behavior (
amp.updates.mode).amp.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.
Parameters
contentstringThe markdown content for the instructions file.
pathstringoptionalWhere 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.