Introduce built-in templates for enhanced configuration options, support JSONC format

This commit is contained in:
JY Tan
2025-12-28 22:16:50 -08:00
parent 8317bb96bc
commit d8e55d9515
22 changed files with 655 additions and 83 deletions

28
docs/templates.md Normal file
View File

@@ -0,0 +1,28 @@
# Config Templates
Fence includes built-in config templates for common use cases. Templates are embedded in the binary, so you can use them directly without copying files.
## Using templates
Use the `-t` / `--template` flag to apply a template:
```bash
# Use a built-in template
fence -t npm-install npm install
# Wraps Claude Code
fence -t code -- claude
# List available templates
fence --list-templates
```
You can also copy and customize templates from [`internal/templates/`](/internal/templates/).
## Available Templates
| Template | Description |
|----------|-------------|
| `code` | Production-ready config for AI coding agents (Claude Code, Codex, Copilot, etc.) |
| `git-readonly` | Blocks destructive commands like `git push`, `rm -rf`, etc. |
| `local-dev-server` | Allow binding and localhost outbound; allow writes to workspace/tmp |