{"id":13515073,"url":"https://github.com/rails-lambda/lambda-console","last_synced_at":"2025-10-29T11:49:19.069Z","repository":{"id":175849411,"uuid":"654374843","full_name":"rails-lambda/lambda-console","owner":"rails-lambda","description":"☁️🐚 A CLI to run shell commands or interact with your application on Lambda.","archived":false,"fork":false,"pushed_at":"2023-11-17T20:24:57.000Z","size":308,"stargazers_count":13,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-13T16:43:08.783Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/rails-lambda.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2023-06-16T02:00:27.000Z","updated_at":"2024-09-24T11:16:46.000Z","dependencies_parsed_at":"2023-11-17T21:43:52.341Z","dependency_job_id":null,"html_url":"https://github.com/rails-lambda/lambda-console","commit_stats":null,"previous_names":["rails-lambda/lambda-console"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rails-lambda%2Flambda-console","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rails-lambda%2Flambda-console/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rails-lambda%2Flambda-console/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rails-lambda%2Flambda-console/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rails-lambda","download_url":"https://codeload.github.com/rails-lambda/lambda-console/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246418658,"owners_count":20773934,"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":[],"created_at":"2024-08-01T05:01:05.996Z","updated_at":"2025-10-29T11:49:14.026Z","avatar_url":"https://github.com/rails-lambda.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Lambda Console\n\n☁️🐚 A CLI to run shell commands or interact with your application on Lambda. This includes typical shell commands like `cat /etc/os-release` or language-specific interactions directly with your running application like Ruby's IRB prompt or Rails console.\n\n![Lambda Console CLI Screenshot](./images/lambda-console-cli-dark.png#gh-dark-mode-only)\n![Lambda Console CLI Screenshot](./images/lambda-console-cli-light.png#gh-light-mode-only)\n\nThe Lambda Console is language agnostic and its [event specification](#specfication) can be implemented in any language. See our list of [supporting implementation](#implementations) for details.\n\n## ⬇️ Installation\n\n```shell\nnpm install -g lambda-console-cli\n```\n\n## 🐚 Usage\n\nAssuming your language or application framework has a [supporting implementation](#implementations) and that you have an AWS CLI user or profile configured with the [required permissions](#permissions), simply invoke `lambda-console-cli` binary.\n\nAs seen in the screenshot above, it will present a series of interactive prompts to configure the AWS SDKs needed to invoke your Lambda function with the console [event specification](#specfication). All interactive prompts have CLI options.\n\n```\n\u003e lambda-console-cli --help\nUsage: lambda-console [options]\n\nA CLI to run shell commands or interact with your application on Lambda.\n\nOptions:\n  -v, --version                 Output the current version\n  -r, --region \u003cstring\u003e         AWS Region name\n  -p, --profile \u003cstring\u003e        AWS Profile name\n  -f, --function-name \u003cstring\u003e  AWS Lambda Function Name\n  -h, --help                    display help for command\n```\n\n## 🏘️ Implementations\n\nHave you created a language-specific package or implemented the Lambda Console specification in your framework? Open an GitHub issue and [share your project](https://github.com/rails-lambda/lambda-console/issues/new/choose) with us. We will add it to this list below.\n\n- Ruby: The [lambda-console-ruby](https://github.com/rails-lambda/lambda-console-ruby) gem for any Ruby Lambda.\n- Rails: Integrated into the [Lamby](https://github.com/rails-lambda/lamby) v5 for Rails on Lambda.\n- Node: Demo https://github.com/rails-lambda/lambda-console/issues/2\n\n## 📐 Specification \n\nPlease see [Lambda Console (Ruby)](https://github.com/rails-lambda/lambda-console-ruby) for a full reference implementation of the Lambda Console spec in Ruby. \n\n### Event Structure\n\nThe event structure for Lambda Console language specific implementation must conform to the following JSON schema:\n\n```json\n{\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"X_LAMBDA_CONSOLE\": {\n      \"type\": \"object\",\n      \"oneOf\": [\n        {\n          \"properties\": {\n            \"run\": {\n              \"type\": \"string\"\n            }\n          },\n          \"required\": [\"run\"],\n          \"additionalProperties\": false\n        },\n        {\n          \"properties\": {\n            \"interact\": {\n              \"type\": \"string\"\n            }\n          },\n          \"required\": [\"interact\"],\n          \"additionalProperties\": false\n        }\n      ]\n    }\n  },\n  \"required\": [\"X_LAMBDA_CONSOLE\"]\n}\n\n```\n\nMore succinctly, one of the two examples are acceptable event types.\n\n**Run Commands**: For running shell commands.\n\n```json\n{ \"X_LAMBDA_CONSOLE\": { \"run\": \"cat /etc/os-release\" } }\n```\n\n**Interact Commands**: Interact in the context of your program. Like IRB for Ruby.\n\n```json\n{ \"X_LAMBDA_CONSOLE\": { \"interact\": \"User.find(1)\" } }\n```\n\n### Response Formats\n\nThese rules apply to any implementation Lambda response for the Lambda Console to work properly.\n\n**Run Commands**\n\n- `statusCode`: Either `0` if no error or `1` if an error occurred.\n- `body`: Combined string of standard out and error in the order they happened.\n\n**Interact Commands**\n\n- `statusCode`: Either `200` if no error or `422` if an error occurred.\n- `body`: String response of the expression evaluated by your program.\n\n### Recommendations\n\n- Run: Should assume the Lambda task/application root as the present working directory.\n- Run: Should capture standard out and error in a single stream.\n- Interactive: Should be run from a language's main context or binding.\n\n## Future Ideas\n\n- Should our interact command capture all stdout or just the return of the evaluated expression?\n- Can we leverage some pseudo-tty features for run commands to support features like ANSI colors?\n- Creating a more formal response JSON schema as we create more features coupled to that response.\n- Add response headers so implementations can signal a language being used for code highlighting.\n- Can we stream STDOUT and STDERR back to the client as it happens? Lambda Streaming?\n\n## Permissions\n\nThe user running this CLI will need the following IAM actions associated with their user or role:\n\n- `lambda:ListFunctions`\n- `lambda:InvokeFunction`\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/rails-lambda/lambda-console. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/rails-lambda/lambda-console/blob/main/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Lambda Console project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/rails-lambda/lambda-console/blob/main/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frails-lambda%2Flambda-console","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frails-lambda%2Flambda-console","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frails-lambda%2Flambda-console/lists"}