{"id":15205445,"url":"https://github.com/cdklabs/cdk-app-cli","last_synced_at":"2025-12-30T00:14:50.794Z","repository":{"id":37051473,"uuid":"488778308","full_name":"cdklabs/cdk-app-cli","owner":"cdklabs","description":"The operator CLI for CDK apps.","archived":false,"fork":false,"pushed_at":"2024-05-28T00:05:28.000Z","size":2399,"stargazers_count":51,"open_issues_count":2,"forks_count":0,"subscribers_count":14,"default_branch":"main","last_synced_at":"2024-05-28T09:31:02.289Z","etag":null,"topics":["aws-cdk","cli","ops"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdklabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2022-05-05T00:05:22.000Z","updated_at":"2024-05-30T02:16:39.831Z","dependencies_parsed_at":"2023-09-24T02:05:27.503Z","dependency_job_id":"cb853162-85fb-4a36-9ee2-7128a16b61ed","html_url":"https://github.com/cdklabs/cdk-app-cli","commit_stats":{"total_commits":280,"total_committers":4,"mean_commits":70.0,"dds":"0.021428571428571463","last_synced_commit":"60d8f965fbed04ed22cdd09ca94436742325896b"},"previous_names":[],"tags_count":416,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdklabs%2Fcdk-app-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdklabs%2Fcdk-app-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdklabs%2Fcdk-app-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdklabs%2Fcdk-app-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdklabs","download_url":"https://codeload.github.com/cdklabs/cdk-app-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219867373,"owners_count":16554322,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["aws-cdk","cli","ops"],"created_at":"2024-09-28T06:01:42.709Z","updated_at":"2025-10-02T23:35:21.140Z","avatar_url":"https://github.com/cdklabs.png","language":"TypeScript","funding_links":[],"categories":["cli"],"sub_categories":[],"readme":"# cdk-app\n\nThe operator CLI for CDK apps. Experimental.\n\n`cdk-app` lets you associate commands with CDK constructs so that you can quickly invoke functions, redrive queues, visit resources in the AWS console, and more by just referencing the construct name.\n\n### Examples:\n\n* `cdk-app MyLambda tail-logs` - stream logs in real time from the Lambda's log group\n* `cdk-app TransactionTable visit-console` - open the AWS console page for your table\n* `cdk-app OrderQueue redrive-queue` - retry messages that failed to get processed\n\n## 🚀 Getting Started\n\nCreate a [CDK app](https://www.npmjs.com/package/aws-cdk) with a Lambda\nfunction, and deploy it to your AWS account.\n\n```ts\nconst fn = new lambda.Function(this, 'MyLambda', {\n  code: lambda.Code.fromInline(\"exports.handler = async (event) =\u003e { console.log('event: ', event) };\"),\n  handler: 'index.handler',\n  runtime: lambda.Runtime.NODEJS_14_X,\n});\n```\n\nNext, `npm install -g cdk-app-cli` and view the available commands:\n\n```\n$ cdk-app MyLambda\nCommands:\n  describe\n  invoke\n  visit-console\n  audit-console\n```\n\nRun a command to instantly access the construct in the AWS console:\n\n```\n$ cdk-app MyLambda visit-console\n```\n\nOr run a command to get information in your command line:\n\n```\n$ cdk-app MyLambda describe\n\u003e aws lambda get-function --function-name DemoAppStack-MyLambdaCCE802FB-lELPCJlktCim\n{\n    \"Configuration\": {\n        \"FunctionName\": \"DemoAppStack-MyLambdaCCE802FB-lELPCJlktCim\",\n        ...\n```\n\nAny extra arguments you pass will get automatically passed through to the\nunderlying command.\n\nYou can add your own commands by defining a JSON or YAML file in your CDK app\nnamed `construct-commmands`. For example, here we define some commands that use\nthe [awslogs](https://github.com/jorgebastida/awslogs) CLI:\n\n```yaml\n# construct-commands.yml\naws-cdk-lib.aws_lambda.Function:\n  logs:\n    exec: awslogs get /aws/lambda/${PHYSICAL_RESOURCE_ID} --start='5m ago'\n  tail-logs:\n    exec: awslogs get /aws/lambda/${PHYSICAL_RESOURCE_ID} ALL --watch\n```\n\nNow these commands will be available to use:\n\n```\n$ cdk-app MyLambda\nCommands:\n  describe\n  invoke\n  visit-console\n  audit-console\n  logs\n  tail-logs\n```\n\nTry using `cdk-app` in scripts as well!\n\n```bash\n#!/usr/bin/env bash\n\ndeclare -a arr=(\"MyLambda\" \"MyTable\" \"MyQueue\")\n\nfor construct in \"${arr[@]}\"; do\n  cdk-app \"$construct\" visit-console\ndone\n```\n\n## 📖 Documentation\n\n### Command line options\n\n```\ncdk-app [construct] [subcommand]\n\nRun an operator command on your CDK app's constructs.\n\nPositionals:\n  construct                                                  [string] [required]\n  subcommand                                                            [string]\n\nOptions:\n  --version  Show version number                                       [boolean]\n  --help     Show help                                                 [boolean]\n\nExtra configuration options available via environment variables:\n\n- CDK_APP_DIR - Path to cdk.out.\n- AWS_REGION - AWS region to run commands in.\n```\n\n### construct-commands.json\n\n#### Command types\n\n| Type | Description |\n| ----------- | ----------- |\n| open | Specify a URL or file to open. |\n| exec | Specify a command to run in your shell. |\n\n#### Command substitutions\n\n| Syntax | Description |\n| ----------- | ----------- |\n| `${AWS_REGION}` | The AWS_REGION of the current shell environment (e.g. `us-east-1`). |\n| `${PHYSICAL_RESOURCE_ID}` | The physical resource ID of construct's default resource. A construct named \"Default\" or \"Resource\" will automatically be assumed to be the default. |\n| `${URL_ENCODED_PHYSICAL_RESOURCE_ID}` | The same as `${PHYSICAL_RESOURCE_ID}`, except the value is URL encoded. |\n\n## Security\n\nSee [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.\n\n## License\n\nThis project is licensed under the Apache-2.0 License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdklabs%2Fcdk-app-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdklabs%2Fcdk-app-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdklabs%2Fcdk-app-cli/lists"}