You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alchemy is deliberately lightweight and AI-first, which makes greenfield development incredibly fast. However, when users have existing infrastructure (brownfield scenarios), there is currently no convenient way to bring resources under Alchemy management.
Terraform users can run aztfexport (or the Azure portal export) to get HCL + state.
Pulumi has import tools.
Alchemy currently requires manually writing the TypeScript declarations and then relying on adoption logic (or state refresh if the resource author implemented it — see Refresh state capability #985).
This creates a high barrier for teams migrating large accounts or wanting to adopt existing Cloudflare Workers, AWS resources, databases, buckets, etc.
Proposed Solution
Add a new scanning + LLM prompt generation feature (most likely as a new CLI command) that:
Scans a cloud account/provider (AWS, Cloudflare, and any custom provider that implements the necessary hooks).
Filters the scan (e.g. by region, tags, resource group, account/project, name pattern, resource type, etc.).
Exports a clean, idiomatic JSON representation of the discovered resources.
Generates a ready-to-use LLM prompt that includes:
The exported JSON data
Context about Alchemy’s resource model (await ResourceType("name", { props }))
Adoption best practices (adopt: true / state reconciliation)
Instructions to produce valid, idiomatic TypeScript code that can be dropped into an alchemy.run.ts file
Example CLI usage:
# Scan everything in the current AWS account
alchemy scan aws --output adoption-prompt.md
# Filtered scan
alchemy scan cloudflare --filter "type=Worker" --filter "name~my-app" --output adoption-prompt.md
# Azure example (once provider support lands)
alchemy scan azure --resource-group my-rg --output adoption-prompt.md
The output file (adoption-prompt.md) would contain something like:
You are an expert Alchemy (alchemy.run) engineer.
Here is the JSON export of existing cloud resources I want to adopt:
{ "provider": "aws", "resources": [ { "type": "Bucket", "name": "my-data-bucket", "id": "my-data-bucket-12345", "properties": { ... }, ... }, ... ]}
Please generate complete, ready-to-run Alchemy TypeScript code that:
- Declares these resources using the correct providers (`Aws.Bucket`, `Cloudflare.Worker`, etc.)
- Uses `adopt: true` (or the current idiomatic adoption pattern) so Alchemy takes ownership without recreation
- Follows Alchemy style (async/await, proper scoping, etc.)
- Includes any necessary comments for the user
Only output the code block(s). Do not add extra commentary.
Users can then copy-paste the prompt into Claude/Codex/etc. and get production-ready Alchemy code in seconds — perfectly aligned with Alchemy’s “AI-first” philosophy.
Why JSON + LLM prompt (instead of auto-generating code)?
Keeps the core lightweight and deterministic.
Lets the user review/adjust the generated code before it touches their account.
Leverages the rapidly improving LLMs without baking model calls into the CLI.
Future-proof: we could later add an --llm flag that calls an LLM directly if desired.
Acceptance Criteria / Nice-to-Haves
Pluggable per-provider scanners (each provider implements scan() or similar).
Alchemy’s existing AI-first design (“encourages the use of LLMs to create/copy/fork/modify resources”)
This feature would make Alchemy the most pleasant IaC tool for both greenfield and brownfield work, especially for teams already using LLMs in their workflow.
Happy to help implement or test once a design is agreed upon!
Problem
Alchemy is deliberately lightweight and AI-first, which makes greenfield development incredibly fast. However, when users have existing infrastructure (brownfield scenarios), there is currently no convenient way to bring resources under Alchemy management.
aztfexport(or the Azure portal export) to get HCL + state.This creates a high barrier for teams migrating large accounts or wanting to adopt existing Cloudflare Workers, AWS resources, databases, buckets, etc.
Proposed Solution
Add a new scanning + LLM prompt generation feature (most likely as a new CLI command) that:
await ResourceType("name", { props }))adopt: true/ state reconciliation)alchemy.run.tsfileExample CLI usage:
The output file (
adoption-prompt.md) would contain something like:You are an expert Alchemy (alchemy.run) engineer. Here is the JSON export of existing cloud resources I want to adopt: { "provider": "aws", "resources": [ { "type": "Bucket", "name": "my-data-bucket", "id": "my-data-bucket-12345", "properties": { ... }, ... }, ... ] } Please generate complete, ready-to-run Alchemy TypeScript code that: - Declares these resources using the correct providers (`Aws.Bucket`, `Cloudflare.Worker`, etc.) - Uses `adopt: true` (or the current idiomatic adoption pattern) so Alchemy takes ownership without recreation - Follows Alchemy style (async/await, proper scoping, etc.) - Includes any necessary comments for the user Only output the code block(s). Do not add extra commentary.Users can then copy-paste the prompt into Claude/Codex/etc. and get production-ready Alchemy code in seconds — perfectly aligned with Alchemy’s “AI-first” philosophy.
Why JSON + LLM prompt (instead of auto-generating code)?
--llmflag that calls an LLM directly if desired.Acceptance Criteria / Nice-to-Haves
scan()or similar).--output json,--output markdown(with prompt),--output ts(future).--state-storeoptions.Related Issues / Context
This feature would make Alchemy the most pleasant IaC tool for both greenfield and brownfield work, especially for teams already using LLMs in their workflow.
Happy to help implement or test once a design is agreed upon!