Skip to content

feat: rewrite entire project from Go to Rust#2

Open
kiro-agent[bot] wants to merge 1 commit into
mainfrom
rewrite-in-rust
Open

feat: rewrite entire project from Go to Rust#2
kiro-agent[bot] wants to merge 1 commit into
mainfrom
rewrite-in-rust

Conversation

@kiro-agent
Copy link
Copy Markdown

@kiro-agent kiro-agent Bot commented May 23, 2026

This pull request was created by @kiro-agent on behalf of @toricls 👻

Comment with /kiro fix to address specific feedback or /kiro all to address everything.
Learn about Kiro autonomous agent


Summary

Complete rewrite of the acos CLI tool from Go to Rust, maintaining all existing functionality.

Changes

  • Language: Go → Rust (2021 edition)
  • CLI parsing: flagclap (derive-based)
  • Interactive prompts: survey/v2dialoguer
  • Table output: tablewritercomfy-table
  • AWS SDK: aws-sdk-go-v2 → AWS SDK for Rust (aws-sdk-costexplorer, aws-sdk-organizations, aws-sdk-sts, aws-sdk-iam)
  • Async runtime: tokio
  • Error handling: anyhow
  • JSON serialization: serde + serde_json

Functionality preserved

  • List AWS accounts from Organizations (paginated)
  • Filter by OU (--ou) or specific account IDs (--account-ids)
  • Interactive multi-select account picker
  • Fallback to STS GetCallerIdentity + IAM ListAccountAliases when Organizations is unavailable
  • Cost Explorer integration (this month, last month, daily/weekly increase)
  • Table and JSON output formats
  • --as-of and --compared-to options

Project structure

src/
├── main.rs          # CLI entry point, table/JSON output, account selection
├── config.rs        # AWS SDK configuration loader
├── organization.rs  # Organizations API (list accounts, list by OU)
├── cost.rs          # Cost Explorer API (get costs, build filters)
└── sts.rs           # STS + IAM fallback for account info

Build & run

make build       # builds release binary to ./dist/acos
make run         # cargo run
make test        # cargo test
make fmt         # cargo fmt
make lint        # cargo clippy

Notes

  • Compiles cleanly with zero clippy warnings
  • CLI flags use kebab-case (--account-ids, --as-of, --compared-to) per Rust CLI conventions

- Replace Go implementation with Rust using AWS SDK for Rust
- Use clap for CLI argument parsing (--ou, --as-of, --compared-to, --json, --account-ids)
- Use dialoguer for interactive account selection (replaces survey)
- Use comfy-table for table output (replaces tablewriter)
- Use tokio for async runtime
- Maintain same functionality: Organizations listing, OU filtering,
  Cost Explorer integration, JSON/table output, fallback to STS
- Update Makefile with Rust build commands (build/run/clean/test/fmt/lint)
- Update .gitignore for Rust artifacts
- Update README with Rust installation instructions

Co-authored-by: Tori Hara <toricls@hey.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant