@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 03:37 UTC

main
md 114 lines 4.51 KB
Rendered Raw
1 <div align="center">
2
3 <a href="https://alchemy.run">
4 <img src="https://raw.githubusercontent.com/alchemy-run/alchemy/main/images/readme-hero.webp" alt="Alchemy — Infrastructure as Effects" width="360" />
5 </a>
6
7 <br />
8
9 [![npm](https://img.shields.io/npm/v/alchemy?style=flat-square&color=3f5a2a&label=alchemy)](https://www.npmjs.com/package/alchemy)
10 [![license](https://img.shields.io/badge/license-Apache%202.0-3f5a2a?style=flat-square)](./LICENSE)
11 [![discord](https://img.shields.io/badge/discord-join-3f5a2a?style=flat-square&logo=discord&logoColor=white)](https://alchemy.run/discord)
12
13 **Infrastructure-as-Effects** — cloud infrastructure and application logic as a single, type-safe [Effect](https://effect.website) program.
14
15 [Docs](https://alchemy.run) · [Tutorial](https://alchemy.run/cloudflare/tutorial/part-1) · [Examples](./examples) · [Discord](https://alchemy.run/discord)
16
17 </div>
18
19 ---
20
21 An R2 Bucket, and a Worker that serves files from it:
22
23 ```typescript
24 import * as Cloudflare from "@alchemy.run/cloudflare";
25 import * as Effect from "effect/Effect";
26 import * as HttpServerResponse from "effect/http/HttpServerResponse";
27
28 export const Uploads = Cloudflare.R2.Bucket("Uploads");
29
30 export default Cloudflare.Worker(
31 "Api",
32 { main: import.meta.url },
33 Effect.gen(function* () {
34 const bucket = yield* Cloudflare.R2.ReadWriteBucket(Uploads);
35
36 return {
37 fetch: Effect.gen(function* () {
38 const obj = yield* bucket.get("hello.txt");
39 return obj
40 ? HttpServerResponse.text(yield* obj.text())
41 : HttpServerResponse.text("Not found", { status: 404 });
42 }),
43 };
44 }).pipe(Effect.provide(Cloudflare.R2.ReadWriteBucketBinding)),
45 );
46 ```
47
48 One `ReadWriteBucket(Uploads)` call adds the Worker binding at deploy time and hands back a typed client at runtime.
49
50 ---
51
52 - **One program, one language.** Resources, Lambdas/Workers, IAM, and SDKs live in the same Effect program — no YAML, no second runtime.
53 - **Bindings, not glue code.** `AWS.S3.GetObject(bucket)` wires the IAM policy, env var, and a typed SDK call in a single line.
54 - **Errors in the type system.** Every cloud API failure is a tagged Effect error you handle — or don't — on purpose.
55 - **Many clouds, one model.** AWS, Cloudflare, GCP, Fly, Hetzner, Kubernetes, Railway, Neon, PlanetScale, Stripe, and more.
56 - **Same code, every stage.** Local dev, `plan` / `deploy`, smoke tests, and CI all share one mental model.
57
58 ```sh
59 pnpm add alchemy@latest effect @effect/platform-bun @effect/platform-node
60 ```
61
62 ## GitHub Action
63
64 Use the root action to deploy `prod` from `main`, deploy PR previews as
65 `staging-{number}`, and destroy PR previews when the PR closes:
66
67 ```yaml
68 - uses: alchemy-run/alchemy@main
69 env:
70 CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
71 CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
72 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73 ```
74
75 The workflow must install the `alchemy` CLI before this action runs.
76
77 ## Bootstrap with an AI coding agent
78
79 Paste this into Claude Code, Cursor, or any agent that can fetch a URL:
80
81 ```
82 You are an Alchemy expert. Read https://alchemy.run/llms.txt to load the
83 full documentation index, then act as my pair on this project.
84
85 Goal: help me set up, build, test, and deploy a cloud application with
86 `alchemy` (Infrastructure-as-Effects, powered by Effect).
87
88 Follow the patterns from the docs and the /examples folder. Stay idiomatic
89 to Effect: use Layers for wiring, return Effects from lifecycle code, and
90 keep infra and runtime in the same program. Ask before introducing new
91 dependencies or breaking conventions.
92 ```
93
94 ## Learn more
95
96 - [What is Alchemy?](https://alchemy.run/what-is-alchemy) — the framework in 2 minutes
97 - [Getting Started](https://alchemy.run/getting-started) — your first Stack
98 - [Tutorial](https://alchemy.run/cloudflare/tutorial/part-1) — build, test, and deploy a Cloudflare app step by step
99 - [Examples](./examples) — runnable projects on AWS and Cloudflare
100 - [llms.txt](https://alchemy.run/llms.txt) — agent-ready documentation index
101
102 > **alchemy** v2 is in beta. Expect breaking changes. Come hang in our [Discord](https://alchemy.run/discord).
103
104 ## Credits
105
106 ### Blacksmith
107
108 Thanks to [Blacksmith](https://blacksmith.sh/?ref=alchemy.run) for sponsoring our CI runners. Their fast Linux, macOS, and Windows runners help us test our packages across platforms and deploy our content-heavy website in mere minutes.
109
110 ## License
111
112 Licensed under the [Apache License 2.0](./LICENSE). See
113 [Third-Party Licenses](./THIRD_PARTY_LICENSES.md) for code incorporated from
114 upstream projects.