{"id":13509185,"url":"https://github.com/awslabs/tecli","last_synced_at":"2025-03-30T13:31:47.359Z","repository":{"id":41342734,"uuid":"338400342","full_name":"awslabs/tecli","owner":"awslabs","description":"In a world where everything is Terraform, teams use Terraform Cloud API to manage their workloads. TECLI increases teams productivity by facilitating such interaction and by providing easy commands that can be executed on a terminal or on CI/CD systems.","archived":false,"fork":false,"pushed_at":"2023-12-18T21:54:01.000Z","size":1903,"stargazers_count":210,"open_issues_count":3,"forks_count":21,"subscribers_count":13,"default_branch":"main","last_synced_at":"2024-08-02T02:13:29.485Z","etag":null,"topics":["amazon-web-services","command-line","continuous-delivery","continuous-integration","devops","terraform","terraform-cloud"],"latest_commit_sha":null,"homepage":"https://github.com/awslabs/tecli","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/awslabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2021-02-12T18:28:58.000Z","updated_at":"2024-02-20T12:10:16.000Z","dependencies_parsed_at":"2024-01-13T19:24:26.536Z","dependency_job_id":"11101373-f7eb-44aa-bc46-dd1dcb0e3dd6","html_url":"https://github.com/awslabs/tecli","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awslabs%2Ftecli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awslabs%2Ftecli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awslabs%2Ftecli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awslabs%2Ftecli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awslabs","download_url":"https://codeload.github.com/awslabs/tecli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222552719,"owners_count":17002142,"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":["amazon-web-services","command-line","continuous-delivery","continuous-integration","devops","terraform","terraform-cloud"],"created_at":"2024-08-01T02:01:04.202Z","updated_at":"2024-11-01T09:31:00.098Z","avatar_url":"https://github.com/awslabs.png","language":"Go","readme":"\u003c!--\n\n  ** DO NOT EDIT THIS FILE\n  **\n  ** This file was automatically generated by the [CLENCLI](https://github.com/awslabs/clencli)\n  ** 1) Make all changes directly to YAML files: clencli/\u003cfile\u003e.yaml\n  ** 2) Run `clencli render template --name=\u003cfile\u003e` to render this file\n  **\n  ** By following this practice we ensure standard and high-quality accross multiple projects.\n  ** DO NOT EDIT THIS FILE\n\n--\u003e\n\n![Photo by [Gabriel Menchaca](https://unsplash.com/gabrielmenchaca) on [Unsplash](https://unsplash.com)](clencli/logo.jpeg)\n\n\u003e Photo by [Gabriel Menchaca](https://unsplash.com/gabrielmenchaca) on [Unsplash](https://unsplash.com)\n\n[![GitHub issues](https://img.shields.io/github/issues/awslabs/tecli)](https://github.com/awslabs/tecli/issues)[![GitHub forks](https://img.shields.io/github/forks/awslabs/tecli)](https://github.com/awslabs/tecli/network)[![GitHub stars](https://img.shields.io/github/stars/awslabs/tecli)](https://github.com/awslabs/tecli/stargazers)[![GitHub license](https://img.shields.io/github/license/awslabs/tecli)](https://github.com/awslabs/tecli/blob/master/LICENSE)[![Twitter](https://img.shields.io/twitter/url?style=social\u0026url=https%3A%2F%2Fgithub.com%2Fawslabs%2Ftecli)](https://twitter.com/intent/tweet?text=Wow:\u0026url=https%3A%2F%2Fgithub.com%2Fawslabs%2Ftecli)\n\n# Command Line Interface for Terraform Enterprise/Cloud ( tecli )\n\nIn a world where everything is Terraform, teams use [Terraform Cloud API](https://www.terraform.io/docs/cloud/api/index.html) to manage their workloads.\nTECLI increases teams productivity by facilitating such interaction and by providing easy commands that can be executed on a terminal or on CI/CD systems.\n\n## Table of Contents\n\n---\n\n- [Usage](#usage)\n- [Prerequisites](#prerequisites)\n- [Installing](#installing)\n\n- [Contributors](#contributors)\n- [References](#references)\n- [License](#license)\n- [Copyright](#copyright)\n\n## Screenshots\n\n---\n\n\u003cdetails open\u003e\n  \u003csummary\u003eExpand\u003c/summary\u003e\n\n| ![how-to-configure](clencli/terminalizer/configure.gif) |\n| :-----------------------------------------------------: |\n|                   _How to configure_                    |\n\n| ![how-to-create-a-workspace](clencli/terminalizer/workspace-create.gif) |\n| :---------------------------------------------------------------------: |\n|                       _How to create a workspace_                       |\n\n| ![how-to-create-a-workspace-linked-to-a-repository](clencli/terminalizer/workspace-with-vcs-repo.gif) |\n| :---------------------------------------------------------------------------------------------------: |\n|                          _How to create a workspace linked to a repository_                           |\n\n| ![how-to-create-a-run](clencli/terminalizer/run-create.gif) |\n| :---------------------------------------------------------: |\n|                    _How to create a run_                    |\n\n| ![how-to-read-plan-logs](clencli/terminalizer/plan-logs.gif) |\n| :----------------------------------------------------------: |\n|                   _How to read plan logs_                    |\n\n| ![how-to-read-apply-logs](clencli/terminalizer/apply-logs.gif) |\n| :------------------------------------------------------------: |\n|                    _How to read apply logs_                    |\n\n| ![how-to-delete-a-workspace](clencli/terminalizer/workspace-delete.gif) |\n| :---------------------------------------------------------------------: |\n|                       _How to delete a workspace_                       |\n\n\u003c/details\u003e\n\n## Usage\n\n---\n\n\u003cdetails open\u003e\n  \u003csummary\u003eExpand\u003c/summary\u003e\n\n`tecli --help`\n\n\u003c/details\u003e\n\n## Prerequisites\n\n---\n\n\u003cdetails\u003e\n  \u003csummary\u003eExpand\u003c/summary\u003e\n\n- [pre-requisites](https://github.com/awslabs/tecli/wiki/Pre-Requisites) - Pre-Requisites\n\n\u003c/details\u003e\n\n## Installing\n\n---\n\n\u003cdetails open\u003e\n  \u003csummary\u003eExpand\u003c/summary\u003e\n\nLook for the latest [release published](https://github.com/awslabs/tecli/releases) and download the binary according to your OS and platform.\nFor more information, check the [Installation](https://github.com/awslabs/tecli/wiki/Installation) Wiki page.\n\n\u003c/details\u003e\n\n## Commands\n\n```\nCommand Line Interface for Terraform Enterprise/Cloud\n\nUsage:\n   [command]\n\nAvailable Commands:\n  apply                 An apply represents the results of applying a Terraform Run's execution plan.\n  configuration-version A configuration version is a resource used to reference the uploaded configuration files.\n  configure             Configures tecli settings\n  help                  Help about any command\n  o-auth-client         An OAuth Client represents the connection between an organization and a VCS provider.\n  o-auth-token          The oauth-token object represents a VCS configuration which includes the OAuth connection and the associated OAuth token. This object is used when creating a workspace to identify which VCS connection to use.\n  plan                  A plan represents the execution plan of a Run in a Terraform workspace.\n  run                   A run performs a plan and apply, using a configuration version and the workspace’s current variables.\n  ssh-key               The ssh-key object represents an SSH key which includes a name and the SSH private key. An organization can have multiple SSH keys available.\n  variable              Operations on variables.\n  version               Displays the version of tecli and all installed plugins\n  workspace             Workspaces represent running infrastructure managed by Terraform.\n\nFlags:\n  -h, --help             help for this command\n  -p, --profile string   Use a specific profile from your credentials and configurations file. (default \"default\")\n\nUse \" [command] --help\" for more information about a command.\n```\n\n# Top Commands\n\nAll the following commands require [TEAM API TOKEN](https://www.terraform.io/docs/cloud/users-teams-organizations/api-tokens.html#team-api-tokens).\nYou can run `tecli configure create` to configure TECLI options. Alternatively, you can export [environment varibles](https://github.com/awslabs/tecli/wiki/Environment-Variables).\n\nTo export environment variables:\n\n```\n# on Linux:\nexport TFC_ORGANIZATION_TOKEN=XXX\nexport TFC_TEAM_TOKEN=XXX\n\n# on Windows (powershell):\n$Env:TFC_ORGANIZATION_TOKEN=\"XXX\"\n$Env:TFC_TEAM_TOKEN=\"XXX\"\n```\n\nTo list all workspaces part of an organization:\n\n```\ntecli workspace list -o=${TFC_ORGANIZATION} -p=${PROFILE}\n```\n\nTo find a workspace by name (instead of listing all workspaces and look for its ID):\n\n```\ntecli workspace find-by-name --organization=${TFC_ORGANIZATION} --name=${TFC_WORKSPACE_NAME}\n```\n\nTo create a workspace and allow destroy plans:\n\n```\ntecli workspace create --organization=${TFC_ORGANIZATION} --name=${TFC_WORKSPACE_NAME} --allow-destroy-plan=true\n```\n\nTo create a plan (if you want to upload your code to Terraform Cloud):\n\n```\ntecli configuration-version create --workspace-id=${WORKSPACE_ID}\ntecli configuration-version upload --url=${CV_UPLOAD_URL} --path=./\ntecli run create --workspace-id=${WORKSPACE_ID} --comment=\"${COMMENT}\"\n```\n\nTo check the staus of a run:\n\n```\ntecli run read --id=${RUN_ID}\n```\n\nYou combine some `BASH` scripting and check if your plan has finished:\n\n```\nwhile true; do STATUS=$(tecli run read --id=${RUN_ID} | jq -r \".Status\"); if [ \"${STATUS}\" != \"pending\" ]; then break; else echo \"RUN STATUS:${STATUS}, IF 'pending' TRY DISCARD PREVIOUS PLANS. SLEEP 5 seconds\" \u0026\u0026 sleep 5; fi; done\n```\n\nTo display the logs of a plan:\n\n```\ntecli plan logs --id=${PLAN_ID}\n```\n\nTo leave a comment on a plan:\n\n```\ntecli run create --workspace-id=${WORKSPACE_ID} --comment=\"${COMMENT}\" --is-destroy=true\n```\n\nTo discard a run:\n\n```\ntecli run discard --id=${RUN_ID}\n```\n\nTo discard all runs:\n\n```\ntecli run discard-all --workspace-id=${WORKSPACE_ID}\n```\n\nTo apply a plan:\n\n```\ntecli run apply --id=${RUN_ID} --comment=\"${COMMENT}\"\n```\n\nTo display the apply logs:\n\n```\ntecli apply logs --id=${APPLY_ID}\n```\n\nTo create a sensitive terraform variable:\n\n```\ntecli variable update --key=${VARIABLE_KEY} --value=${VARIABLE_VALUE} --workspace-id=${WORKSPACE_ID} --category=terraform --sensitive=true\n```\n\nTo create a sensitive environment variable:\n\n```\ntecli variable create --key=${VARIABLE_KEY} --value=${VARIABLE_VALUE} --workspace-id=${WORKSPACE_ID} --category=env --sensitive=true\n\n# AWS CLI ENVIRONMENT VARIABLES\ntecli variable create --key=AWS_ACCESS_KEY_ID --value=${AWS_ACCESS_KEY_ID} --workspace-id=${WORKSPACE_ID} --category=env --sensitive=true\ntecli variable create --key=AWS_SECRET_ACCESS_KEY --value=${AWS_SECRET_ACCESS_KEY} --workspace-id=${WORKSPACE_ID} --category=env --sensitive=true\ntecli variable create --key=AWS_DEFAULT_REGION --value=${AWS_DEFAULT_REGION} --workspace-id=${WORKSPACE_ID} --category=env --sensitive=true\n\n## IF YOU ALSO NEED TO EXPORT AWS_SESSION_TOKEN:\ntecli variable create --key=AWS_SESSION_TOKEN --value=${AWS_SESSION_TOKEN} --workspace-id=${WORKSPACE_ID} --category=env --sensitive=true\n```\n\nTo delete all variables (be careful):\n\n```\ntecli variable delete-all --workspace-id=${WORKSPACE_ID}\n```\n\n## Contributors\n\n---\n\n\u003cdetails open\u003e\n  \u003csummary\u003eExpand\u003c/summary\u003e\n\n|       Name       |       Email        |                    Role                     |\n| :--------------: | :----------------: | :-----------------------------------------: |\n|  Silva, Valter   | valterh@amazon.com | AWS Professional Services - Cloud Architect |\n| Dhingra, Prashit |                    | AWS Professional Services - Cloud Architect |\n\n\u003c/details\u003e\n\n## References\n\n---\n\n\u003cdetails open\u003e\n  \u003csummary\u003eExpand\u003c/summary\u003e\n\n- [Terraform Cloud](https://www.terraform.io/docs/cloud/index.html) - Terraform Cloud is an application that helps teams use Terraform together.\n- [Terraform Cloud/Enterprise Go Client](https://github.com/hashicorp/go-tfe) - The official Go API client for Terraform Cloud/Enterprise.\n- [clencli](https://github.com/awslabs/clencli) - Cloud Engineer CLI\n- [terminalizer](https://github.com/faressoft/terminalizer) - Record your terminal and generate animated gif images or share a web player link terminalizer.com\n\n\u003c/details\u003e\n\n## License\n\n---\n\nThis project is licensed under the Apache License 2.0.\n\nFor more information please read [LICENSE](LICENSE).\n\n## Copyright\n\n---\n\n```\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n```\n","funding_links":[],"categories":["Go","CLI Tools","terraform"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawslabs%2Ftecli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawslabs%2Ftecli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawslabs%2Ftecli/lists"}