{"id":20500030,"url":"https://github.com/klothoplatform/infracopilot","last_synced_at":"2025-10-28T01:13:16.502Z","repository":{"id":254900181,"uuid":"681361032","full_name":"klothoplatform/infracopilot","owner":"klothoplatform","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-26T18:12:54.000Z","size":169620,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-11-15T18:20:41.844Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/klothoplatform.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-08-21T21:05:08.000Z","updated_at":"2024-11-10T06:29:34.000Z","dependencies_parsed_at":"2024-08-28T00:31:24.365Z","dependency_job_id":null,"html_url":"https://github.com/klothoplatform/infracopilot","commit_stats":null,"previous_names":["klothoplatform/infracopilot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klothoplatform%2Finfracopilot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klothoplatform%2Finfracopilot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klothoplatform%2Finfracopilot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klothoplatform%2Finfracopilot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/klothoplatform","download_url":"https://codeload.github.com/klothoplatform/infracopilot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234162266,"owners_count":18789312,"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":[],"created_at":"2024-11-15T18:19:33.434Z","updated_at":"2025-09-25T07:31:09.687Z","avatar_url":"https://github.com/klothoplatform.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# infracopilot\n\n## Developing\nto run CI checks on git push:\n```sh\ngit config --local core.hooksPath .githooks/\n```\n\n### Run service\n\nChange the auth0 domain in `/src/auth_service/token` to our dev domain\n\nensure the following files/keys exist:\n- auth0_client_id.key\n- auth0_client_secret.key\n- azure_openai_api_key.key\n- fga_client_id.key\n- fga_model_id.key\n- fga_secret.key\n- fga_store_id.key\n\nTo set these with the bitwarden CLI:\n```sh\nFGA_NOTE=$(bw get item \"auth0 fga\" | jq -r '.notes' | grep -o '^dev.*')\necho \"$FGA_NOTE\" | grep 'client id:' | sed 's#.*: ##' \u003e fga_client_id.key\necho \"$FGA_NOTE\" | grep 'model id:' | sed 's#.*: ##' \u003e fga_model_id.key\necho \"$FGA_NOTE\" | grep 'secret:' | sed 's#.*: ##' \u003e fga_secret.key\necho \"$FGA_NOTE\" | grep 'store id:' | sed 's#.*: ##' \u003e fga_store_id.key\nunset FGA_NOTE\n```\n\nensure you have the minio docker container running\n```sh\ndocker-compose up\n```\n\n```sh\nPORT=3000 ENGINE_PATH=/Path/to/klotho/engine/binary IAC_CLI_PATH=/Path/to/klotho/iac/binary  make run\n```\n\n### Run Unit tests\n\n```sh\nmake test\n```\n\n### Run formatting\n\n```sh\nmake black\n```\n\n### Example curls\n\n#### Create a new architecture\n```sh\ncurl -X POST  http://127.0.0.1:3000/architecture -H \"Content-Type: application/json\" -d '{\"name\": \"arch\", \"owner\": \"jordan\", \"engine_version\": \"1.0\"}'\n```\n\nThe id of the new architecture is returned below and used in subsequent requests\n\n\u003e {\"id\":\"bb1331b4-e475-49e1-98b8-727aea52ce06\"}\n\n#### Modify an architecture (Send constraints)\n```sh\ncurl -X POST \"http://127.0.0.1:3000/architecture/$ARCHITECTURE_ID/run?state=$LATEST_STATE\" -H \"Content-Type: application/json\" -d '{\"constraints\": [{\"scope\": \"application\", \"operator\": \"add\", \"node\": \"aws:rest_api::api_gateway_01\"}]}'\n```\n\n#### Get an architecture's current state\n```sh\ncurl http://127.0.0.1:3000/architecture/$ARCHITECTURE_ID\n```\n\n#### Export a current architectures iac\n\n```sh\ncurl \"http://127.0.0.1:3000/architecture/$ARCHITECTURE_ID/iac?state=$LATEST_STATE\"\n```\n\n### Debugging\n\n#### Environment Variables\n- `KEEP_TMP` - if set to `true` will keep the tmp directory after a run\n- `CAPTURE_ENGINE_FAILURES` - if set to `true` will capture engine and IaC failures in the `failures` directory\n- `APP_LOG_FILE` - if set to a path, will log to the file specified\n\n## Deploying a dev stack\nArchitecture:\nhttps://app.infracopilot.io/editor/12aa38c5-6b88-4e6a-b9c8-35c9186e6516\n\n1. `pipenv requirements \u003e requirements.txt`\n1. `npm --prefix deploy install`\n2. `cd deploy \u0026\u0026 pulumi up`\n  - Grab the `ifcp_binary_storage_BucketName`, `ifcp_static_site_BucketName`\n  - Note: service won't work yet, since the secrets don't exist\n3. `make build-frontend` (optionally with -dev or -prod)\n4. `cd fontend/build \u0026\u0026 aws s3 sync . s3://{ifcp_static_site_BucketName}`\n5. `aws secretsmanager put-secret-value --secret-id {} --secret-string {}`\n  - Upload the 4 secrets according to the environment running: `ifcp-fga-client-id`, `ifcp-fga-model-id`, `ifcp-fga-secret`, `ifcp-fga-store-id`\n6. `cd binaries \u0026\u0026 aws s3 sync . s3://{ifcp_binary_storage_BucketName}`\n7. `cd deploy \u0026\u0026 pulumi up` \n  - This is mostly just to restart the task. It's probably failing and restarting so it might not be necessary.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklothoplatform%2Finfracopilot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklothoplatform%2Finfracopilot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklothoplatform%2Finfracopilot/lists"}