{"id":13564399,"url":"https://github.com/petrgazarov/salami","last_synced_at":"2025-04-03T21:30:52.000Z","repository":{"id":199167368,"uuid":"681989731","full_name":"petrgazarov/salami","owner":"petrgazarov","description":"Infrastructure as Natural Language","archived":false,"fork":false,"pushed_at":"2023-10-28T00:52:05.000Z","size":871,"stargazers_count":44,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-11-04T17:47:28.500Z","etag":null,"topics":["cloud-infrastructure","declarative-language","infrastructure-as-code","llm","natural-language","salami"],"latest_commit_sha":null,"homepage":"","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/petrgazarov.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-23T07:41:50.000Z","updated_at":"2024-09-18T03:18:54.000Z","dependencies_parsed_at":"2024-08-01T13:20:34.662Z","dependency_job_id":"39e715c4-cb92-4b0d-b8be-6f39850c689e","html_url":"https://github.com/petrgazarov/salami","commit_stats":null,"previous_names":["petrgazarov/salami"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrgazarov%2Fsalami","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrgazarov%2Fsalami/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrgazarov%2Fsalami/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrgazarov%2Fsalami/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/petrgazarov","download_url":"https://codeload.github.com/petrgazarov/salami/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247082977,"owners_count":20880755,"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":["cloud-infrastructure","declarative-language","infrastructure-as-code","llm","natural-language","salami"],"created_at":"2024-08-01T13:01:30.731Z","updated_at":"2025-04-03T21:30:47.083Z","avatar_url":"https://github.com/petrgazarov.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/images/salami-icon.svg\" alt=\"Salami Icon\" width=\"100px\" height=\"100px\"\u003e\n\u003c/p\u003e\n\n# Salami\n\nInfrastructure As Natural Language\n\n## 🤔 What is this?\n\nSalami is a declarative domain-specific language for cloud infrastructure based on natural language descriptions. Salami compiler uses GPT4 to convert the natural language to Terraform code. You can think of Salami as writing documentation for each cloud resource object, and letting the compiler take care of converting that to IaC (Infrastructure as Code).\n\n**[Short demo video](https://youtu.be/ej629E0WOIY)** |\n**[Release blog post](https://www.petrgazarov.com/posts/infrastructure-as-natural-language)**\n\n## 🚀 Getting Started\n\n### Installation\n\nHomebrew (Mac OS, Linux):\n\n```bash\nbrew tap petrgazarov/salami\nbrew install salami\n```\n\nManual:\n\nDownload the latest binaries for Mac OS, Linux and Windows from the [releases page](https://github.com/petrgazarov/salami/releases).\n\n### Config\n\nThe root of your project should contain a `salami.yaml` config file.\n\nExample:\n\n```yaml\ncompiler:\n  target:\n    platform: terraform\n  llm:\n    provider: openai\n    model: gpt4\n    api_key: ${OPENAI_API_KEY}\n  source_dir: salami\n  target_dir: terraform\n```\n\n| Configuration Setting       | Description                                                                   | Required |\n| --------------------------- | ----------------------------------------------------------------------------- | -------- |\n| compiler.target.platform    | Platform to target. Only `terraform` value is currently supported.            | Yes      |\n| compiler.llm.provider       | Provider for the LLM. Only `openai` value is currently supported.             | Yes      |\n| compiler.llm.model          | Model used by the provider. Only `gpt4` value is currently supported.         | Yes      |\n| compiler.llm.api_key        | OpenAI API key. To set it to an env variable, use the `${ENV_VAR}` delimeter. | Yes      |\n| compiler.llm.max_concurrent | Maximum number of concurrent API calls to OpenAI API. Default is 5.           | No       |\n| compiler.source_dir         | The directory where your Salami files are located.                            | Yes      |\n| compiler.target_dir         | The directory where the Terraform files should be written.                    | Yes      |\n\n### Usage\n\nFrom the root of your project, run:\n\n```bash\nsalami compile\n```\n\nFor verbose output, run:\n\n```bash\nsalami -v compile\n```\n\n## 🎨 Design\n\n### Constructs\n\nSalami files are mostly comprised of natural language, with several special constructs:\n\n1. **Blocks** - multiline blocks of text that each represent either a resource or a variable; delimited by double newlines.\n2. **Constructor functions** - functions that are used to specify the nature of the block; start with an `@` symbol.\n3. **Variable references** - references to variables that are defined in the program; delimited by curly braces.\n4. **Resource references** - references to resources that are defined in the program; start with a dollar sign.\n\n\u003csmall\u003eExample Salami code with 3 blocks: VPC resource, Security Group resource and the \u003ccode\u003econtainer_port\u003c/code\u003e variable:\u003c/small\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/images/salami-example.png\" width=\"80%\"\u003e\n\u003c/p\u003e\n\nFor more examples, see the `examples` directory. Each example has a README file with instructions on how to run it.\n\n### Constructor function signatures\n\n\u003cbr\u003e\n\n**@resource**\n\n| Position | Argument      | Type   | Required? | Examples                         |\n| -------- | ------------- | ------ | --------- | -------------------------------- |\n| 1        | resource type | string | Yes       | `aws.s3.bucket`, `AWS S3 Bucket` |\n| 2        | logical name  | string | Yes       | `ApiCluster`, `prod_bucket_1`    |\n\n\u003cbr\u003e\n\n**@variable**\n\n| Position | Argument      | Type   | Required | Examples                             |\n| -------- | ------------- | ------ | -------- | ------------------------------------ |\n| 1        | name          | string | Yes      | `container_port`, `logs_bucket_name` |\n| 2        | variable type | string | Yes      | `string`, `number`, `boolean`        |\n| 3        | default       | any    | No       | `8080`, `logs_bucket_1fdretbnHUdfn`  |\n\n### Lock file\n\nThe compiler generates a lock file that includes parsed Salami objects and the resulting Terraform code. It is used to determine which objects have changed since the last compilation. Unchanged objects are not sent to LLM, which makes the compilation process much faster.\n\n### File extension\n\n`.sami` is the extension for Salami files.\n\n## ✅ VS Code Extension\n\nIt's recommended to install the [Salami VS Code extension](https://marketplace.visualstudio.com/items?itemName=Salami.salami). It provides highlighting functionality for the `.sami` files.\n\n## 😍 Contributing\n\nContributions are welcome! For non-trivial contributions, please open an issue first to discuss the proposed changes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetrgazarov%2Fsalami","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetrgazarov%2Fsalami","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetrgazarov%2Fsalami/lists"}