Skip to content

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[]optional
Glob patterns always included in fuzzy search (amp.fuzzy.alwaysIncludePaths).
mcp_serverstable<string, amp.McpServer>optional
MCP server configurations (amp.mcpServers).
pathstringoptional
Where to write settings. Defaults to "~/.config/amp/settings.json".
permissionsamp.Permission[]optional
Permission rules (amp.permissions).
thinkingbooleanoptional
Enable Claude's extended thinking (amp.anthropic.thinking.enabled).
updates_mode("auto"|"disabled"|"warn")optional
Update 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.

contentstring
The markdown content for the instructions file.
pathstring?
Where to write the file. Defaults to "~/.config/amp/AGENTS.md".

amp.McpServer

argsstring[]optional
Command arguments.
commandstringoptional
Command to run (for local servers).
envtable<string, string>optional
Environment variables.
headerstable<string, string>optional
HTTP headers.
include_toolsstring[]optional
Tool name filters.
urlstringoptional
Server endpoint (for remote servers).

amp.Permission

mode"allow"|"ask"|"delegate"|"deny"
Permission mode.
toolstring
Tool pattern to match.