Skip to content

feat: add config module with TOML-based AWS profile/region resolution#8

Merged
nathanhuh merged 1 commit intomainfrom
feat/aws-config
Feb 25, 2026
Merged

feat: add config module with TOML-based AWS profile/region resolution#8
nathanhuh merged 1 commit intomainfrom
feat/aws-config

Conversation

@nathanhuh
Copy link
Copy Markdown
Contributor

한국어

변경 요약

TOML 기반 AWS 설정(config) 모듈을 추가합니다.

  • Config 구조체 추가: CLI 플래그 → ~/.config/unic/config.toml → 하드코딩 기본값 순서로 profile/region 결정
  • 첫 실행 시 config.toml 자동 생성 (ensure_config_exists)
  • --region CLI 플래그 추가
  • 모듈 구조 정리: cli, tui를 서브모듈로 분리, aws.rs를 services/로 이동
  • lib.rs 추가하여 config을 라이브러리 모듈로 노출
  • 의존성 추가: aws-config, anyhow, serde, toml, dirs, tempfile(dev)

관련 이슈

Closes #3

검증 방법

  • cargo build 정상 빌드 확인
  • config.toml 미존재 시 자동 생성 확인
  • CLI --profile, --region 플래그가 config 파일 값을 오버라이드하는지 확인

체크리스트

  • 변경 범위가 명확하다
  • 문서를 업데이트했다(필요한 경우)
  • 테스트/검증 절차를 포함했다
  • 호환성 깨짐(Breaking change)을 명시했다

English

Summary

Add TOML-based AWS config module.

  • Add Config struct resolving profile/region via CLI flags → ~/.config/unic/config.toml → hardcoded defaults
  • Auto-create config.toml on first run (ensure_config_exists)
  • Add --region CLI flag
  • Restructure modules: extract cli, tui into submodules; move aws.rs to services/
  • Add lib.rs exposing config as a library module
  • New dependencies: aws-config, anyhow, serde, toml, dirs, tempfile (dev)

Related Issues

Closes #3

Validation

  • Verified cargo build succeeds
  • Confirmed config.toml is auto-created when missing
  • Confirmed CLI --profile and --region flags override config file values

Checklist

  • Scope is focused
  • Docs updated (if needed)
  • Tests/validation included
  • Breaking changes documented

Copy link
Copy Markdown
Contributor

@YoungJinJung YoungJinJung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test code같은건 따로 안짜도 되려나요..?

@nathanhuh
Copy link
Copy Markdown
Contributor Author

test code같은건 따로 안짜도 되려나요..?

로컬에서 테스트까지 마쳤는데 커밋 시 누락되어 추가하였습니다!

@nathanhuh
Copy link
Copy Markdown
Contributor Author

Translation: Missed committing test file, added them back later.

@nathanhuh nathanhuh merged commit 665aeb6 into main Feb 25, 2026
1 check passed
@nathanhuh nathanhuh deleted the feat/aws-config branch February 25, 2026 06:32
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.

[Feature] Config & Profile Management

2 participants