{"id":41252139,"url":"https://github.com/mrgrain/cdk-updown","last_synced_at":"2026-01-23T01:41:16.071Z","repository":{"id":301791138,"uuid":"1010252844","full_name":"mrgrain/cdk-updown","owner":"mrgrain","description":"Self-executable CDK apps","archived":false,"fork":false,"pushed_at":"2026-01-19T00:03:40.000Z","size":1239,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-19T10:01:15.250Z","etag":null,"topics":["automation","aws","cdk","cli"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@mrgrain/cdk-updown","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrgrain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-28T17:15:19.000Z","updated_at":"2025-07-07T00:04:45.000Z","dependencies_parsed_at":"2025-07-14T02:08:50.095Z","dependency_job_id":"a8c7fa18-5715-4298-acb8-be93dd85455c","html_url":"https://github.com/mrgrain/cdk-updown","commit_stats":null,"previous_names":["mrgrain/cdk-updown"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mrgrain/cdk-updown","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrgrain%2Fcdk-updown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrgrain%2Fcdk-updown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrgrain%2Fcdk-updown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrgrain%2Fcdk-updown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrgrain","download_url":"https://codeload.github.com/mrgrain/cdk-updown/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrgrain%2Fcdk-updown/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28677711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T01:00:35.747Z","status":"ssl_error","status_checked_at":"2026-01-23T01:00:19.529Z","response_time":144,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","aws","cdk","cli"],"created_at":"2026-01-23T01:41:15.367Z","updated_at":"2026-01-23T01:41:16.063Z","avatar_url":"https://github.com/mrgrain.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![CDK up / down](./images/wordmark-dynamic.svg)\n\nSelf-executable CDK apps.\n\n![Demo](./images/demo.gif)\n\nEver tried to quickly demo some infrastructure code? You write your CDK app, then switch to the terminal for `cdk deploy`, then back again for `cdk destroy`. It's annoying. Sharing examples is even worse - people need the CDK CLI installed and configured just to try your code. CDK up/down fixes this by making your apps self-executable. Your code becomes the deployment tool. One command to deploy and clean up. Perfect for quick prototyping, live demos, and tutorials where you don't want setup friction getting in the way.\n\n## Installation\n\nInstall the package using your preferred package manager:\n\n```console\nnpm install @mrgrain/cdk-updown\nyarn add @mrgrain/cdk-updown\npnpm add @mrgrain/cdk-updown\nbun add @mrgrain/cdk-updown\n```\n\n## Usage\n\nCreate an executable TypeScript file for your CDK app `./bin/my-app.ts` using the `updown()` function.\n\n```typescript\nimport { updown } from \"@mrgrain/cdk-updown\";\nimport { App, Stack, aws_sns } from \"aws-cdk-lib\";\n\nconst cli = updown(async () =\u003e {\n  // Build your CDK app here\n  const app = new App();\n  const stack = new Stack(app);\n  new aws_sns.Topic(stack, \"Topic\");\n\n  return app.synth();\n});\n\n// Run the CLI\nawait cli.run();\n```\n\nThen execute as usual:\n\n```console\nnpx tsx ./bin/my-app.ts\n```\n\n## Single-file executable\n\nUsing a bundle that can produce single-file executables, it is easily possible to make your CDK app fully runtime independent.\nFor example [with Bun](https://bun.sh/docs/bundler/executables):\n\n```console\nbun build ./bin/my-app.ts --compile --minify --outfile ./dist/my-app\n```\n\nNow you have a fully self-contained binary of your app:\n\n```console\n./dist/my-app\n```\n\n## Advanced Use Cases\n\nYou can also call `up()` and `down()` directly.\nIt gives you more control over when to deploy or destroy your infrastructure without relying on command-line arguments.\n\nBoth methods return deployment data and throw errors instead of exiting the process.\nThey skip the selection dialog, but maintain the terminal output.\nYou can use them to build a more customized CLI experience.\n\n```typescript\nimport { updown } from \"@mrgrain/cdk-updown\";\nimport { App, Stack, aws_sns } from \"aws-cdk-lib\";\n\ndeclare const builder: AssemblyBuilder;\n\ntry {\n  // Create the updown cli\n  const cli = updown(builder);\n\n  // Up and get deployment result\n  const deployResult = await cli.up();\n  console.log(`Deployed ${deployResult.stacks.length} stacks`);\n  \n  // Down and get destroy result\n  const destroyResult = await cli.down();\n  console.log(`Destroyed ${destroyResult.stacks.length} stacks`);\n\n} catch (error) {\n  console.error('Operation failed:', error.message);\n  // Handle error as needed\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrgrain%2Fcdk-updown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrgrain%2Fcdk-updown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrgrain%2Fcdk-updown/lists"}