{"id":20179202,"url":"https://github.com/janpreet/kado-ai","last_synced_at":"2026-05-04T17:35:03.233Z","repository":{"id":250388714,"uuid":"834331632","full_name":"janpreet/kado-ai","owner":"janpreet","description":"AI-powered infrastructure recommendations for DevOps. Analyzes Terraform, Ansible, and OPA Rego configurations to optimize your infrastructure-as-code. Part of the Kado ecosystem, it securely leverages AI to enhance DevOps workflows with intelligent insights.","archived":false,"fork":false,"pushed_at":"2024-07-31T00:22:19.000Z","size":560,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T05:41:55.713Z","etag":null,"topics":["ai","ansible","chatgpt","claude","devops","opa","terraform"],"latest_commit_sha":null,"homepage":"","language":"Go","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/janpreet.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":"2024-07-27T01:02:18.000Z","updated_at":"2024-07-31T10:47:56.000Z","dependencies_parsed_at":"2024-07-31T03:16:28.687Z","dependency_job_id":null,"html_url":"https://github.com/janpreet/kado-ai","commit_stats":null,"previous_names":["janpreet/kado-ai"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/janpreet/kado-ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janpreet%2Fkado-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janpreet%2Fkado-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janpreet%2Fkado-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janpreet%2Fkado-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janpreet","download_url":"https://codeload.github.com/janpreet/kado-ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janpreet%2Fkado-ai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32618023,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ai","ansible","chatgpt","claude","devops","opa","terraform"],"created_at":"2024-11-14T02:25:34.117Z","updated_at":"2026-05-04T17:35:03.208Z","avatar_url":"https://github.com/janpreet.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Continuous Integration](https://github.com/janpreet/kado-ai/actions/workflows/ci.yaml/badge.svg)](https://github.com/janpreet/kado-ai/actions/workflows/ci.yaml)[![Publish to pkg.go.dev](https://github.com/janpreet/kado-ai/actions/workflows/publish.yaml/badge.svg)](https://github.com/janpreet/kado-ai/actions/workflows/publish.yaml)\n# Kado AI\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/janpreet/kado-ai/main/assets/kado-ai.png\" data-canonical-src=\"https://raw.githubusercontent.com/janpreet/kado-ai/main/assets/kado-ai.png\" /\u003e\u003c/p\u003e\nKado AI is an AI-assisted infrastructure recommendation engine designed to analyze Terraform configurations, Ansible playbooks, OPA Rego policies, and Terraform plans. It leverages AI services to generate comprehensive infrastructure recommendations based on the provided code and configurations.\n\nThis package is an offshoot and integral part of the larger Kado project, which aims to streamline and enhance infrastructure operations through intelligent analysis and automation.\n\n## Table of Contents\n\n1. [Installation](#installation)\n2. [Configuration](#configuration)\n3. [Usage](#usage)\n4. [Security Considerations](#security-considerations)\n5. [Development](#development)\n6. [Testing](#testing)\n7. [Continuous Integration and Deployment](#continuous-integration-and-deployment)\n8. [Contributing](#contributing)\n9. [License](#license)\n10. [Support](#support)\n11. [Relationship to Kado](#relationship-to-kado)\n\n## Installation\n\nTo use Kado AI in your Go project, run:\n\n```bash\ngo get github.com/janpreet/kado-ai@latest\n```\n\nEnsure you're using Go 1.16 or later.\n\n## Configuration\n\nKado AI requires a `.kdconfig` file in the user's home directory. This file should contain the following configuration:\n\n```\nAI_API_KEY=your_api_key_here\nAI_MODEL=your_model_here\nAI_CLIENT=your_client_type_here\n```\n\n- `AI_API_KEY`: Your API key for the AI service (ChatGPT or Anthropic).\n- `AI_MODEL`: The AI model to use (e.g., \"gpt-4\" for ChatGPT or \"claude-3-sonnet-20240229\" for Anthropic).\n- `AI_CLIENT`: The AI client type (\"chatgpt\" or \"anthropic_messages\").\n\nTo set up the configuration:\n\n1. Create the `.kdconfig` file in your home directory:\n   ```bash\n   touch ~/.kdconfig\n   ```\n\n2. Add your configuration to the file:\n   ```bash\n   echo \"AI_API_KEY=your_api_key_here\" \u003e\u003e ~/.kdconfig\n   echo \"AI_MODEL=your_model_here\" \u003e\u003e ~/.kdconfig\n   echo \"AI_CLIENT=your_client_type_here\" \u003e\u003e ~/.kdconfig\n   ```\n\n3. Set appropriate permissions to protect your API key:\n   ```bash\n   chmod 600 ~/.kdconfig\n   ```\n\n## Usage\n\nHere's a basic example of how to use Kado AI in your Go code:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n\n    kadoai \"github.com/janpreet/kado-ai/ai\"\n)\n\nfunc main() {\n    client, err := kadoai.NewAIClient(\"/path/to/your/iac/code\", \"\")\n    if err != nil {\n        log.Fatalf(\"Error creating AI client: %v\", err)\n    }\n\n    recommendations, err := client.RunAI()\n    if err != nil {\n        if err.Error() == \"operation cancelled by user\" {\n            fmt.Println(\"AI analysis cancelled.\")\n            return\n        }\n        log.Fatalf(\"Error running AI: %v\", err)\n    }\n\n    fmt.Println(\"Infrastructure Recommendations:\")\n    fmt.Println(recommendations)\n}\n```\n\nWhen you run this code:\n\n1. It will analyze your Infrastructure as Code files.\n2. It will save the sanitized input to a file named `ai_input.txt` in your specified IaC directory.\n3. You will be prompted to review the input and confirm if you want to proceed with sending the data to the AI.\n4. If you confirm, it will send the data to the AI service and return the recommendations.\n5. If you cancel, the operation will stop without sending any data to the AI service.\n\nThis approach allows you to review the sanitized data before it's sent to the AI, providing an additional layer of security and control.\n\n## Security Considerations\n\n1. **API Key Protection**: Store your API key securely in the `.kdconfig` file and ensure it has restricted permissions (600).\n\n2. **Data Sanitization**: Kado AI sanitizes sensitive information before sending it to the AI service. This includes:\n   - Passwords\n   - API keys\n   - Tokens\n   - Private keys\n   - IP addresses\n   - URLs (domain parts are redacted)\n\n3. **Local Storage**: The sanitized input is saved locally in `ai_input.txt` within your IaC directory. Ensure this file is protected and cleaned up after use.\n\n4. **No Persistent Storage**: The AI service does not store your data, but the interaction is part of the API call. Ensure compliance with your data handling policies.\n\n5. **HTTPS**: All communications with AI services use HTTPS.\n\n6. **Version Control**: Do not commit the `.kdconfig` file or any files containing sensitive information to version control.\n\n7. **User Confirmation**: Before sending any data to the AI service, the user is prompted to review the sanitized input and must explicitly confirm to proceed. This allows for a final check to ensure no sensitive information is being sent unintentionally.\n\n## Development\n\nTo set up the development environment:\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/janpreet/kado-ai.git\n   cd kado-ai\n   ```\n\n2. Install dependencies:\n   ```bash\n   go mod tidy\n   ```\n\n3. Make your changes to the code.\n\n4. Run tests:\n   ```bash\n   make test\n   ```\n\n5. Build the package:\n   ```bash\n   make build\n   ```\n\n## Testing\n\nRun tests using:\n\n```bash\nmake test\n```\n\nThis will run all unit tests in the package. Ensure all tests pass before submitting a pull request.\n\n## Continuous Integration and Deployment\n\nThis project uses GitHub Actions for CI/CD. The workflows are defined in `.github/workflows/`:\n\n- `ci.yml`: Runs tests and build on every push and pull request to the main branch.\n- `publish.yml`: Runs tests, builds the package, and publishes to pkg.go.dev when a new release is created.\n\nTo create a new release:\n\n1. Update the version in your code if necessary.\n2. Commit and push your changes.\n3. Create a new tag:\n   ```bash\n   make tag VERSION=v0.1.0\n   ```\n4. Go to the GitHub repository and create a new release based on this tag.\n\n## Contributing\n\n1. Fork the repository.\n2. Create a new branch for your feature or bug fix.\n3. Make your changes and write tests for them.\n4. Run `make test` to ensure all tests pass.\n5. Submit a pull request with a clear description of your changes.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Support\n\nFor support, please open an issue in the GitHub repository. Provide as much context as possible, including:\n\n- Your Go version\n- Your operating system\n- The version of Kado AI you're using\n- A detailed description of the issue\n- Steps to reproduce the issue\n- Any relevant code snippets or error messages\n\nPlease do not share any sensitive information (like API keys) in your support requests.\n\n## Relationship to Kado\n\nKado AI is a component of the larger Kado project, which is designed to provide comprehensive infrastructure management and optimization tools. While Kado AI focuses on AI-assisted recommendations for infrastructure configurations, it integrates seamlessly with other Kado components to offer a full-featured solution for modern infrastructure challenges.\n\nFor more information about the overall Kado project and how Kado AI fits into the broader ecosystem, please visit the main Kado project repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanpreet%2Fkado-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanpreet%2Fkado-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanpreet%2Fkado-ai/lists"}