{"id":19915650,"url":"https://github.com/andreafspeziale/os-cli","last_synced_at":"2026-03-06T11:07:02.257Z","repository":{"id":182354694,"uuid":"668368696","full_name":"andreafspeziale/os-cli","owner":"andreafspeziale","description":"Opinionated and convenient OpenSearch CLI 🔍","archived":false,"fork":false,"pushed_at":"2024-04-27T21:21:24.000Z","size":1137,"stargazers_count":8,"open_issues_count":12,"forks_count":0,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2024-04-29T23:18:12.761Z","etag":null,"topics":["aws","cli","nest","nestjs","opensearch","searchengine"],"latest_commit_sha":null,"homepage":"","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/andreafspeziale.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2023-07-19T16:32:08.000Z","updated_at":"2024-08-20T21:49:12.663Z","dependencies_parsed_at":null,"dependency_job_id":"392dfefd-2e4b-45c6-bf61-ad946854f464","html_url":"https://github.com/andreafspeziale/os-cli","commit_stats":null,"previous_names":["andreafspeziale/os-cli"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreafspeziale%2Fos-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreafspeziale%2Fos-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreafspeziale%2Fos-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreafspeziale%2Fos-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreafspeziale","download_url":"https://codeload.github.com/andreafspeziale/os-cli/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224062259,"owners_count":17249274,"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","cli","nest","nestjs","opensearch","searchengine"],"created_at":"2024-11-12T21:41:39.417Z","updated_at":"2026-03-06T11:07:02.206Z","avatar_url":"https://github.com/andreafspeziale.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cp\u003e\n    \u003c!-- \u003ca href=\"https://opensearch.org/\" target=\"blank\", style=\"text-decoration: none;\"\u003e\n      \u003cimg src=\"./assets/os-logo.png\" width=\"150\" alt=\"OpenSearch Logo\" /\u003e\n    \u003c/a\u003e --\u003e\n    \u003cimg src=\"./assets/os-logo.png\" width=\"150\" alt=\"OpenSearch Logo\" /\u003e\n    \u003cb\u003e\u003c/b\u003e\n    \u003c!-- \u003ca href=\"https://nestjs.com/\" target=\"blank\" style=\"text-decoration: none;\"\u003e\n      \u003cimg src=\"https://nestjs.com/img/logo_text.svg\" width=\"320\" alt=\"Nest Logo\" /\u003e\n    \u003c/a\u003e --\u003e\n    \u003cimg src=\"https://nestjs.com/img/logo_text.svg\" width=\"320\" alt=\"Nest Logo\" /\u003e\n  \u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://opensearch.org/\" target=\"blank\"\u003eOpenSearch\u003c/a\u003e CLI built in \u003ca href=\"https://github.com/nestjs/nest\" target=\"blank\"\u003eNest\u003c/a\u003e,\u003cbr\u003e\n    a progressive Node.js framework for building efficient and scalable server-side applications.\n  \u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://www.npmjs.com/@andreafspeziale/os-cli\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@andreafspeziale/os-cli.svg\" alt=\"NPM Version\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/@andreafspeziale/os-cli\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/@andreafspeziale/os-cli.svg\" alt=\"Package License\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/andreafspeziale/os-cli/actions\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/andreafspeziale/os-cli/release.yml\" alt=\"Release Status\"/\u003e\u003c/a\u003e\n  \u003cp\u003e\n\u003c/div\u003e\n\n## Installation\n\u003e The Official [opensearch-cli](https://opensearch.org/docs/latest/tools/cli/) is also available\n\n### npm\n\n```sh\nnpm install -g @andreafspeziale/os-cli\n```\n\n### yarn\n\n```sh\nyarn global add @andreafspeziale/os-cli\n```\n\n### pnpm\n\n```sh\npnpm add -g @andreafspeziale/os-cli\n```\n\n### docker\n\n```sh\ndocker pull andreafspeziale/os-cli\ndocker run --rm --env-file .env andreafspeziale/os-cli\n```\n\n\u003e If using a local (docker) OpenSearch image like the one included in the `docker-compose` file be sure to set correctly the `network` option and `OS_HOST` env variable (OS_HOST=http://opensearch:9200) in the above command (`docker run --rm --env-file .env --network os-cli_default andreafspeziale/os-cli`)\n\n\u003e If using the dockerized CLI and you need to use your json payloads as inputs you'll need to mount the folder into the CLI execution context (e.g `docker run --rm --env-file .env -v ./recipes:/opt/os-cli/recipes --network os-cli_default andreafspeziale/os-cli d q -i books -f recipes/query.json`)\n\n## How to use?\n\n![](./assets/terminal.gif)\n\n### Quickstart\n\nTo taste the CLI very quickly using `npx` or after installing it you can spawn OpenSearch locally by using the `docker-compose` file included in the repository:\n\n- `git clone git@github.com:andreafspeziale/os-cli.git`\n- `cd os-cli`\n- `docker compose up -d`\n- `export OS_CONNECTION_METHOD=local`\n- `npx @andreafspeziale/os-cli i l` or `os-cli i l`\n\nLike the `docker-compose` file there are also some recipes included in the repository:\n\n- `npx @andreafspeziale/os-cli i cr -i books -f ./recipes/create-index.json` or `os-cli i cr -i books -f ./recipes/create-index.json`\n- `npx @andreafspeziale/os-cli d cr -i books -f ./recipes/create-documents.json` or `os-cli d cr -i books -f ./recipes/create-documents.json`\n- `npx @andreafspeziale/os-cli d q -i books -f ./recipes/query.json` or `os-cli d q -i books -f ./recipes/query.json`\n\n### Configuration\n\u003e For proxy mode check [aws-sigv4-proxy](https://github.com/awslabs/aws-sigv4-proxy)\n\nThe CLI leverages environment variables in order to set connection and logging options just once.\n\n| Name                        | Required                                                  | Default                          | Description                                    | Values                                                          |\n|-----------------------------|-----------------------------------------------------------|----------------------------------|------------------------------------------------|-----------------------------------------------------------------|\n| OS_HOST                     | when `OS_CONNECTION_METHOD` is NOT _local_ or _proxy_      | `http://localhost:(9200 or 8080)` | OpenSearch connection host                     | -                                                               |\n| OS_CONNECTION_METHOD        | Yes                                                       | -                                | How you want to connect to OpenSearch          | [`local`, `proxy`, `serviceAccount`, `credentials`]             |\n| AWS_REGION                  | only when `OS_CONNECTION_METHOD` is NOT _local_ or _proxy_ | -                                | OpenSearch AWS connection region               | -                                                               |\n| AWS_ROLE_ARN                | only when `OS_CONNECTION_METHOD` is _serviceAccount_      | -                                | AWS role ARN for assume role connection        | -                                                               |\n| AWS_WEB_IDENTITY_TOKEN_FILE | only when `OS_CONNECTION_METHOD` is _serviceAccount_      | -                                | AWS web identity token file                    | -                                                               |\n| AWS_ACCESS_KEY_ID           | only when `OS_CONNECTION_METHOD` is _credentials_         | -                                | AWS access key id for canonical connection     | -                                                               |\n| AWS_SECRET_ACCESS_KEY       | only when `OS_CONNECTION_METHOD` is _credentials_         | -                                | AWS secret access key for canonical connection | -                                                               |\n| LOGGER_LEVEL                | No                                                        | `debug`                           | Which logs will be displayed                   | [`silent`, `error`, `warn`, `info`, `http`, `verbose`, `debug`] |\n| LOGGER_PRETTY               | No                                                        | `true`                           | Boolean to enable/disable logs formatting      | `true`, `false`                                                 |\n| LOGGER_REDACT               | No                                                        | `''`                             | Removed specified words from logs              | -                                                               |\n\nFor a docker local OpenSearch instance all you need to do is:\n\n`export OS_CONNECTION_METHOD=local`\n\nInstead for a canonical AWS connection method a receipt along with your values would be:\n\n```\nexport OS_HOST=\nexport OS_CONNECTION_METHOD=credentials\nexport AWS_REGION=\nexport AWS_ACCESS_KEY_ID=\nexport AWS_SECRET_ACCESS_KEY=\n```\n\n## Development\n\nAfter cloning the repository:\n\n- `cd os-cli`\n- `cp ./env/.env.development ./env`\n- `docker compose up -d`\n- `pnpm install`\n\nI personally prefer build in a terminal window and run the compiled version in a separate one like so:\n\n- `pnpm build --watch`\n- `pnpm start:prod` or `node dist/os-cli.js`\n\n## Stay in touch\n\n- Author - [Andrea Francesco Speziale](https://twitter.com/andreafspeziale)\n- Website - [https://nestjs.com](https://nestjs.com/)\n- Twitter - [@nestframework](https://twitter.com/nestframework)\n\n## License\n\nos-cli [MIT licensed](LICENSE).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreafspeziale%2Fos-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreafspeziale%2Fos-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreafspeziale%2Fos-cli/lists"}