{"id":22454675,"url":"https://github.com/niwo/cloudstack-cli","last_synced_at":"2025-08-02T02:31:35.778Z","repository":{"id":12496242,"uuid":"15165792","full_name":"niwo/cloudstack-cli","owner":"niwo","description":"cloudstack-cli is a CloudStack API command line client written in Ruby","archived":false,"fork":false,"pushed_at":"2025-01-24T07:37:47.000Z","size":406,"stargazers_count":16,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-07-28T13:57:01.416Z","etag":null,"topics":["cloudstack","cloudstack-cli"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/niwo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-13T14:41:40.000Z","updated_at":"2025-01-24T07:37:30.000Z","dependencies_parsed_at":"2025-01-24T08:20:09.919Z","dependency_job_id":null,"html_url":"https://github.com/niwo/cloudstack-cli","commit_stats":null,"previous_names":[],"tags_count":114,"template":false,"template_full_name":null,"purl":"pkg:github/niwo/cloudstack-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niwo%2Fcloudstack-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niwo%2Fcloudstack-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niwo%2Fcloudstack-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niwo%2Fcloudstack-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niwo","download_url":"https://codeload.github.com/niwo/cloudstack-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niwo%2Fcloudstack-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268327466,"owners_count":24232666,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cloudstack","cloudstack-cli"],"created_at":"2024-12-06T07:08:50.799Z","updated_at":"2025-08-02T02:31:35.479Z","avatar_url":"https://github.com/niwo.png","language":"Ruby","readme":"# Cloudstack CLI\n\n[![Gem Version](https://badge.fury.io/rb/cloudstack-cli.png)](http://badge.fury.io/rb/cloudstack-cli)\n\ncloudstack-cli is a [CloudStack](http://cloudstack.apache.org/) API command line client written in Ruby.\ncloudstack-cli uses the [cloudstack_client](https://github.com/niwo/cloudstack_client) to talk to the CloudStack API.\n\n## Installation\n\nInstall the cloudstack-cli gem:\n\n```bash\n$ gem install cloudstack-cli\n```\n\n## Setup\n\n### Create a cloudstack-cli environment\n\ncloudstack-cli expects to find a configuration file with the API URL and your CloudStack credentials in your home directory named .cloudstack.yml (or .cloudstack-cli.yml).\nIf the file is located elsewhere you can specify the location using the --config-file option.\n\n*Create your initial environment, which defines your connection options:*\n\n```bash\n$ cloudstack-cli setup\n```\n\n\"cloudstack-cli setup\" (or \"cloudstack-cli environment add\") requires the following options:\n  - The full URL of your CloudStack API, i.e. \"https://cloud.local/client/api\"\n  - Your API Key (generate it under Accounts \u003e Users if not already available)\n  - Your Secret Key (see above)\n\n*Add an additional environment:*\n\n```bash\n$ cloudstack-cli env add production\n```\n\ncloudstack-cli supports multiple environments using the --environment option.\n\nThe first environment added is always the default. You can change the default as soon as you have multiple environments:\n\n```bash\n$ cloudstack-cli environment default [environment-name]\n```\n\n*List all environments:*\n\nsee `cloudstack-cli help environment` for more options.\n\nExample configuration file:\n\n```yaml\n# default environment\n:default: production\n\n# production environment\nproduction:\n  :url: \"https://my-cloudstack-server/client/api/\"\n  :api_key: \"cloudstack-api-key\"\n  :secret_key: \"cloudstack-api-secret\"\n\n# test environment\ntest:\n  :url: \"http://my-cloudstack-testserver/client/api/\"\n  :api_key: \"cloudstack-api-key\"\n  :secret_key: \"cloudstack-api-secret\"\n```\n\n### Shell tab auto-completion\n\nTo enable tab auto-completion for cloudstack-cli, add the following lines to your ~/.bash_profile file.\n\n```bash\n# Bash, ~/.bash_profile\neval \"$(cloudstack-cli completion --shell=bash)\"\n```\n\n__Note__: use `~/.bashrc` on Ubuntu\n\n## Usage\n\n*Display the cli help:*\n\n```bash\n$ cloudstack-cli help\n```\n\n*Help for a specific subcommand and command:*\n\n```bash\n$ cloudstack-cli vm help\n```\n\n```bash\n$ cloudstack-cli vm help list\n```\n\n### Example: Bootstrapping a server\n\n*Bootstraps a server using a template and creating port-forwarding rules for port 22 and 80:*\n\n```bash\n$ cloudstack-cli server create web-01 --template CentOS-7.5-x64 --zone DC1 --offering 2cpu_2gb --port-rules :22 :80\n```\n\n### Example: Run any custom API command\n\n*Run the \"listAlerts\" command against the CloudStack API with an argument of type=8:*\n\n```bash\n$ cloudstack-cli command listAlerts type=8\n```\n\n### Example: Creating a complete stack of servers\n\nCloudStack CLI does support stack files in YAML or JSON.\n\n*An example stackfile could look like this (my_stackfile.yml):*\n\n```yaml\n---\n  name: \"web_stack-a\"\n  description: \"Web Application Stack\"\n  version: \"1.0\"\n  zone: \"DC-ZRH-1\"\n  group: \"my_web_stack\"\n  keypair: \"mykeypair\"\n  servers:\n    - name: \"web-d1, web-d2\"\n      description: \"web node\"\n      template: \"CentOS-7-x64\"\n      offering: \"1cpu_1gb\"\n      networks: \"server_network\"\n      port_rules: \":80, :443\"\n    - name: \"db-01\"\n      description: \"PostgreSQL Master\"\n      iso: \"CentOS-7-x64\"\n      disk_offering: \"Perf Storage\"\n      disk_size: \"5\"\n      offering: \"2cpu_4gb\"\n      ip_network_list:\n        - name: FrontendNetwork\n          ip: 10.101.64.42\n        - name: BackendNetwork\n          ip: 10.102.1.11\n```\n\n*Create the stack of servers from the definition above:*\n\n```bash\n$ cloudstack-cli stack create my_stackfile.yml\n```\n\n**Hint:** You can also parse a stackfile from a URI.\n\n*The following command destroys a stack using a definition gathered from a stackfile lying on a Github repository:*\n\n```bash\n$ cloudstack-cli stack destroy https://raw.githubusercontent.com/niwo/cloudstack-cli/master/test/stack_example.json\nDestroy the following servers web-001, web-002, db-001? [y/N]: y\nDestroy server web-001 : job completed\nDestroy server web-002 : job completed\nDestroy server db-001 : /\nCompleted: 2/3 (15.4s)\n```\n\n### Example: Sort computing offerings\n\n*Sort all computing offerings by CPU and Memory grouped by domain:*\n(root admin privileges required)\n\n```bash\n$ cloudstack-cli compute_offer sort\n```\n\n### Example: Stop all backup routers of a given project\n\n*Stop all virtual routers of project named Demo (you could filter by zone too):*\n(this command is helpful if you have to deploy new major release of CloudStack when using redundant routers)\n\n```bash\n$ cloudstack-cli router list --project Demo --status running --redundant-state BACKUP --command STOP\n````\n\n## References\n\n-  [Cloudstack API documentation](http://cloudstack.apache.org/docs/api/)\n-  This tool was inspired by the Knife extension for Cloudstack: [knife-cloudstack](https://github.com/CloudStack-extras/knife-cloudstack)\n\n\n## Test\n\n1. Requires the [cloudstack-simulator](https://hub.docker.com/r/cloudstack/simulator/) docker images running on your local machine\n2. You need to add the admin secrets to your local cloudstack environment an make it default\n3. Currently you need to create a isolated network named \"test-network\" manually on the simulator\n4. Run `bundle exec rake test`\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n\n## License\n\nReleased under the MIT License. See the [LICENSE](https://raw.github.com/niwo/cloudstack-cli/master/LICENSE.txt) file for further details.\n","funding_links":[],"categories":["Command Line Interface Clients"],"sub_categories":["Templates"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniwo%2Fcloudstack-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniwo%2Fcloudstack-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniwo%2Fcloudstack-cli/lists"}