A CLI tool to generate AWS boto3 code snippets using the OpenAI API and written in Rust.
Status: This is version 0.1.0—still in development. Major (1.x) releases are forthcoming.
- Generate Python boto3 scripts for AWS operations from natural language prompts.
- Configure default OpenAI model, AWS region, and AWS profile.
- Interactive and manual configuration methods.
- Flexible output: print to stdout or write to files.
- A Unix-like shell (Linux, macOS) or PowerShell (Windows)
- A valid OpenAI API key
- AWS credentials configured
Install coto with our standalone installers:
# On macOS and Linux.
curl -LsSf https://aranda.xyz/coto/install.sh | shWindows standalone installer will be added in a future version. You can access our Windows binaries here.
Run the setup command to initialize your configuration file at $XDG_CONFIG_HOME/coto/config.toml (e.g., ~/.config/coto/config.toml):
coto setupYou will be prompted to enter:
- OpenAI API key
- Default OpenAI model (e.g.,
gpt-4o-mini) - AWS region (e.g.,
us-west-2) - AWS CLI profile (e.g.,
default)
Create or edit the config file directly:
# ~/.config/coto/config.toml
api_key = "your-openai-api-key"
model = "gpt-4o-mini"
region = "us-west-2"
profile = "default"Manage individual settings in your config file without opening it manually. You can:
# Show current configuration
coto config show
# Set a value
coto config set model gpt-4
# Unset a value
coto config unset profileInteractively configure your OpenAI key, default model, AWS region, and profile.
coto setupManage individual settings in your config file (alias for config commands shown above).
# Show settings
coto config show
# Set or unset values
coto config set <key> <value>Generate a boto3 code snippet from a natural language prompt.
coto gen [OPTIONS]Options:
-p, --prompt <PROMPT>Natural language description of desired AWS operation. (required)-r, --region <REGION>AWS region to use (overrides config).-P, --profile <PROFILE>AWS CLI profile to use (overrides config).-m, --model <MODEL>OpenAI model to use (overrides config).-o, --output <FILE>Write code snippet to file instead of printing.-d, --dry-runShow request details without calling the API.
# Print a snippet to stdout
coto gen -p "list all S3 buckets in us-west-2"
# Write snippet to a file
coto gen -p "upload the file ~/profile.png to the coto-test S3 bucket" -o upload.py
# Override defaults
coto gen -p "delete the EC2 instance named coto-vm" --region us-east-1 --profile myprofileContributions, issues, and feature requests are welcome! Feel free to check issues or submit a pull request.
This project is licensed under the Apache License 2.0. See LICENSE for details.