{"id":14957991,"url":"https://github.com/sachin1678/terraform-workspace-clone","last_synced_at":"2025-10-09T23:33:53.943Z","repository":{"id":42439934,"uuid":"475979320","full_name":"Sachin1678/terraform-workspace-clone","owner":"Sachin1678","description":"Clone existing terraform workspace","archived":false,"fork":false,"pushed_at":"2022-05-27T03:31:15.000Z","size":716,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-08T07:53:36.179Z","etag":null,"topics":["clone","terraform","workspace"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/terraform-workspace-clone","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/Sachin1678.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}},"created_at":"2022-03-30T17:15:20.000Z","updated_at":"2023-10-26T06:49:24.000Z","dependencies_parsed_at":"2022-08-19T17:40:22.294Z","dependency_job_id":null,"html_url":"https://github.com/Sachin1678/terraform-workspace-clone","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Sachin1678/terraform-workspace-clone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sachin1678%2Fterraform-workspace-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sachin1678%2Fterraform-workspace-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sachin1678%2Fterraform-workspace-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sachin1678%2Fterraform-workspace-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sachin1678","download_url":"https://codeload.github.com/Sachin1678/terraform-workspace-clone/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sachin1678%2Fterraform-workspace-clone/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002310,"owners_count":26083340,"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-10-09T02:00:07.460Z","response_time":59,"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":["clone","terraform","workspace"],"created_at":"2024-09-24T13:15:56.862Z","updated_at":"2025-10-09T23:33:53.923Z","avatar_url":"https://github.com/Sachin1678.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n  Title: terraform-workspace-clone\n  Description: NPM package to clone or duplicate extsting terraform workspace.\n  Author: Sachin Kumar\n  --\u003e\n\n\u003cmeta name=\"google-site-verification\" content=\"8A5R1KtPcvI0VKtc-q-ImfuZK7_-wtyGZuQXR3mT11E\" /\u003e\n\u003ch1 align=\"center\"\u003eterraform-workspace-clone\u003c/h1\u003e\n\n## NPM package to clone or duplicate extsting terraform workspace.\n\u003c/br\u003e\n\u003cp\u003e\n  \u003cimg alt=\"Version\" src=\"https://img.shields.io/badge/version-2.2.2-blue.svg\" /\u003e\n  \u003cimg alt=\"Version\" src=\"https://img.shields.io/badge/license-MIT-orange.svg\" /\u003e\n  \u003cimg alt=\"Downloads\" src=\"https://img.shields.io/npm/dt/terraform-workspace-clone.svg?maxAge=3600\" /\u003e\n\u003c/p\u003e\n\n# Getting started\n### terraform-workspace-clone is a command-line module to clone terraform workspace.\n\n### 🏠 [Homepage](https://github.com/Sachin1678/terraform-workspace-clone#readme)\n\n## Install\n\n```sh\nnpm install -g terraform-workspace-clone\n```\n\n## Usage\n`terraform-workspace-clone` needs few details before cloning the workspace. Input can be provided using cli prompts or can pass pre-filled json file as command-line argument. \n### Cli prompts:\nRun below command in cli.\n```\nterraform-workspace-clone\n```\n\nCan also use `tf-ws-clone` , It is a shorthand command.\n\nExample:\n```\n✔ TF domain name?  https://app.terraform.io   // Terraform domain, can be cloud or enterprise\n✔ Source workspace ID? ws-9xZ3c3iabcdefgh     // Workspace id which you need to clone\n✔ New workspace name? 00-test-1               // New workspace name\n✔ Destination TF organization name?  abc_org  // TF org name in which new workspace will be created.\n✔ (Optional) OAuth Token id from destinaton organization? // Required if want to clone VCS config. Refer 2nd screenshot.\n✔ User api token  ****************              // User api token. Screenshot 1. For more details go to `API Token` section of https://www.terraform.io/cloud-docs/users-teams-organizations/users.\n✔ Do you want to clone with values? no / yes  // Yes, if want to clone variables with values.\n```\n\n**NOTE:** User should have permission to access source and destination org. \n1. To generate user api token, \u003c/br\u003e go to **User Settings -\u003e Tokens -\u003e click on \"Create an API token\" button -\u003e Create API token -\u003e Copy token -\u003e Done**. \u003c/br\u003e\n![User API token](https://raw.githubusercontent.com/Sachin1678/terraform-workspace-clone/main/screenshots/user_api_token.png)\n\n2. To fetch VCS OAuth token ID, Select TF destination organization and go to **Settings -\u003e Providers -\u003e Copy OAuth client id**. Destination organization should be able to access VCS repo configured in source workspace. If VCS provider not configured then click on **Settings -\u003e Providers -\u003e Add VCS provider**. \n![VCS token ID](https://raw.githubusercontent.com/Sachin1678/terraform-workspace-clone/main/screenshots/vcs_oauth_token.png)\n\n### Config file:\nInput can be passed using pre-filled json file. JSON file should have below info:\n\n```\n{\n    \"baseUrl\": \"https://app.terraform.io\",\n    \"sourceWorkspaceId\": \"ws-9xZ3c3iabcdefgh\",\n    \"newWorkspaceName\": \"00-test-1\",\n    \"destinationOrgName\": \"abc_org\",\n    \"destinationOrgVcsOauthTokenId\": \"\",\n    \"userApiToken\": \"Zxcvbnm..............sjhsmD\",\n    \"isCloneValue\": true or false\n}\n```\nand then pass this file as a input.\n\n```sh\ntf-ws-clone --config=\u003cpath to json file\u003e/\u003cfilename\u003e.json\n```\n\nThis template can be generated using cli command. It will create a config template file with all the required keys **`tf_ws_clone_config.json`** at same path from where `tf-ws-clone` command is executed.\n\n```sh\ntf-ws-clone initconfig\n```\n\nExample:\n```\ntf-ws-clone --config=./tf_ws_clone_config.json\n```\n\n### Running on-demand using npx:\nUsing `npx` you can run the script on-demand:\n```\nnpx terraform-workspace-clone\n```\n\n```\nnpx terraform-workspace-clone --config=./tf_ws_clone_config.json\n```\n\n## Run tests\n\n```sh\nnpm run test\n```\n\n## New planned features\n* Clone across multiple domains.\n* Allow config file path also for the required details.\n## Author\n\n👤 **Sachin \u003crajput.sachingla@gmail.com\u003e**\n\n* Github: [@Sachin1678](https://github.com/Sachin1678)\n\n## 🤝 Contributing\n\nContributions, issues and feature requests are welcome!\u003cbr /\u003eFeel free to check [issues page](https://github.com/Sachin1678/terraform-workspace-clone/issues). You can also take a look at the [contributing guide](https://github.com/Sachin1678/terraform-workspace-clone/blob/master/CONTRIBUTING.md).\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n\n## 📝 License\n\nCopyright © 2022 [Sachin \u003crajput.sachingla@gmail.com\u003e](https://github.com/Sachin1678).\u003cbr /\u003e\nThis project is [MIT](https://github.com/Sachin1678/terraform-workspace-clone/blob/master/LICENSE) licensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsachin1678%2Fterraform-workspace-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsachin1678%2Fterraform-workspace-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsachin1678%2Fterraform-workspace-clone/lists"}