mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-07 20:47:37 +00:00
config(git,claude,ssh): templated gitconfig; claude settings/commands/hooks/skills; ssh config
gitconfig: name/email from chezmoi data, gh credential helper by PATH lookup (portable to darwin). claude: no credentials, history, projects, sessions, or plugin caches. ssh config as private_ (0600). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3c691e8dc5
commit
20891f3910
476 files changed
+59086
-7
No files matched your search
@@ -0,0 +1,72 @@
|
||||
# Configuration
|
||||
|
||||
Fetch https://developers.cloudflare.com/agents/api-reference/configuration/ for complete documentation.
|
||||
|
||||
## Wrangler Config (`wrangler.jsonc`)
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"name": "my-agent",
|
||||
"main": "src/index.ts",
|
||||
"compatibility_date": "2025-01-28",
|
||||
"compatibility_flags": ["nodejs_compat"],
|
||||
"durable_objects": {
|
||||
"bindings": [
|
||||
{ "name": "MyAgent", "class_name": "MyAgent" },
|
||||
{ "name": "ChatAgent", "class_name": "ChatAgent" }
|
||||
]
|
||||
},
|
||||
"migrations": [
|
||||
{ "tag": "v1", "new_sqlite_classes": ["MyAgent", "ChatAgent"] }
|
||||
],
|
||||
"ai": { "binding": "AI" },
|
||||
"assets": {
|
||||
"directory": "./dist/client",
|
||||
"binding": "ASSETS",
|
||||
"not_found_handling": "single-page-application",
|
||||
"run_worker_first": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Key Rules
|
||||
|
||||
- Every agent class needs a DO binding AND a `new_sqlite_classes` migration entry
|
||||
- `nodejs_compat` is required
|
||||
- Never edit old migrations — add a new tag (e.g. `v2`) for new classes
|
||||
- Do NOT enable `experimentalDecorators` in tsconfig — it breaks `@callable`
|
||||
- For Workers AI locally, set `"ai": { "binding": "AI", "remote": true }` in `.dev.vars` or config
|
||||
- Use `wrangler secret put` for secrets, never hardcode them
|
||||
|
||||
## Vite Setup
|
||||
|
||||
```typescript
|
||||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { cloudflare } from "@cloudflare/vite-plugin";
|
||||
import { agents } from "agents/vite";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react(), cloudflare(), agents()]
|
||||
});
|
||||
```
|
||||
|
||||
## Type Generation
|
||||
|
||||
```bash
|
||||
npx wrangler types
|
||||
```
|
||||
|
||||
This generates `env.d.ts` with typed bindings. Regenerate after changing `wrangler.jsonc`.
|
||||
|
||||
## tsconfig
|
||||
|
||||
Extend the agents tsconfig for correct settings:
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"extends": ["agents/tsconfig"],
|
||||
"include": ["src/**/*.ts", "src/**/*.tsx"],
|
||||
"compilerOptions": { "paths": { "~/*": ["./src/*"] } }
|
||||
}
|
||||
```
|
||||
Reference in new issue
Block a user