{"id":23244267,"url":"https://github.com/creyke/cosmic","last_synced_at":"2025-08-20T03:32:47.378Z","repository":{"id":144134275,"uuid":"216039332","full_name":"creyke/Cosmic","owner":"creyke","description":"A succinct and powerful command line query tool for Azure Cosmos DB","archived":false,"fork":false,"pushed_at":"2019-11-03T21:31:42.000Z","size":134,"stargazers_count":4,"open_issues_count":8,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-06T12:14:08.354Z","etag":null,"topics":["cli","command","cosmos","csharp","line","netcore"],"latest_commit_sha":null,"homepage":"","language":"C#","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/creyke.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}},"created_at":"2019-10-18T14:13:03.000Z","updated_at":"2020-02-07T15:52:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"6d7a8877-b987-4a0c-a88f-7c525a3a9da4","html_url":"https://github.com/creyke/Cosmic","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creyke%2FCosmic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creyke%2FCosmic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creyke%2FCosmic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creyke%2FCosmic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creyke","download_url":"https://codeload.github.com/creyke/Cosmic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230388791,"owners_count":18217895,"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":["cli","command","cosmos","csharp","line","netcore"],"created_at":"2024-12-19T06:21:28.978Z","updated_at":"2024-12-19T06:21:29.566Z","avatar_url":"https://github.com/creyke.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimage src=\"https://raw.githubusercontent.com/creyke/Cosmic/master/Cosmic/icon.png\" alt=\"Cosmic\"\u003e\n\n# Cosmic\nA succinct and powerful command line query tool for Azure Cosmos DB.\n\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/CosmicCli/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\n## Summary\nCosmic makes it effortless to run ad-hoc or prepared queries against your Azure Cosmos DB containers for common usage scenarios such as:\n- Selecting data\n- Upserting data\n- Deleting data\n- Backing up data\n- Troubleshooting performance or cost issues\n- Sharing reusable, parameterisable queries\n\nCosmic is a tool for operating on **existing** Azure Cosmos DB collections. If you want to create and modify accounts, databases, and collections, then you should use the official Microsoft Azure CLI tool [az cosmosdb](https://docs.microsoft.com/en-us/cli/azure/cosmosdb).\n\n## Installation\n```\ndotnet tool install -g cosmic\n```\n\n## Basic Usage\nConnect to an Azure Cosmos DB account:\n```\ncosmic connect -n foo -c \"AccountEndpoint=https://****.documents.azure.com:443/;AccountKey=****==;\"\n```\n\nSwitch to an active container you want to work with (optional):\n```\ncosmic switch foo/db/container\n```\n\nQuery an Azure Cosmos DB account:\n```\ncosmic query \"SELECT * FROM c\"\n```\n\n## Documentation\nThe latest auto-generated [commands reference documentation](./Commands.md) is a good place to start. If you have a feature request or a bug then raise it as an [issue](https://github.com/creyke/Cosmic/issues). If you have any questions then visit the [Gitter community](https://gitter.im/CosmicCli/community).\n\n## Further Examples\nDelete documents from an Azure Cosmos DB account:\n```\ncosmic delete \"SELECT * FROM c\"\n```\n\nYou can pipe data out to a file:\n```\ncosmic query \"SELECT * FROM c\" \u003e data.json\n```\n\n...and then upsert data back in:\n```\ncosmic upsert data.json\n```\n\n...or  upsert a document directly:\n```\ncosmic upsert \"{'id':'foo'}\"\n```\n\nMeasure RU cost:\n```\ncosmic query \"SELECT * FROM c\" -r\n```\n\nCheck which container is active:\n```\ncosmic active\n```\n\nStore a query for later with default query parameters:\n```\ncosmic store -n myquery \"SELECT * FROM c WHERE c.Type = '%%'\" car\n```\n\nExecute a previously stored query with it's default query parameters:\n```\ncosmic query myquery\n```\n\nExecute a previously stored query with defined query parameter values:\n```\ncosmic query myquery boat\n```\n\nOutput query text before result:\n```\ncosmic query myquery boat -q\n```\n\nCommon aliases can be used either within a query or as a query parameter:\n```\ncosmic query \"SELECT * FROM c WHERE c.Start \u003e= %TODAY% AND c.Start \u003c= %TOMORROW%\"\n```\n\nAvailable aliases can be listed:\n```\ncosmic aliases\n```\n\nList connected Azure Cosmos DB accounts:\n```\ncosmic accounts\n```\n\nLoop using iterators:\n```\ncosmic upsert \"{'id':'%I%'}\" -l 10\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreyke%2Fcosmic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreyke%2Fcosmic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreyke%2Fcosmic/lists"}