tfocus

Crates.iotfocus
lib.rstfocus
version
sourcesrc
created_at2024-12-02 03:26:00.134614
updated_at2024-12-02 03:26:00.134614
descriptionTerminal UI for Terraform workspace management
homepagehttps://github.com/nwiizo/tfocus
repositoryhttps://github.com/nwiizo/tfocus
max_upload_size
id1468178
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Shuya Motouchi (nwiizo)

documentation

https://github.com/nwiizo/tfocus

README

๐ŸŽฏ tfocus

โš ๏ธ WARNING: Resource targeting should be avoided unless absolutely necessary!

What's this? ๐Ÿค”

tfocus is a super interactive tool for selecting and executing Terraform plan/apply on specific resources. Think of it as an "emergency tool" - not for everyday use.

tfocus demo

Features ๐ŸŒŸ

  • ๐Ÿ” Peco-like fuzzy finder for Terraform resources
  • โšก Lightning-fast resource selection
  • ๐ŸŽจ Colorful TUI (Terminal User Interface)
  • ๐ŸŽน Vim-like keybindings
  • ๐Ÿ“ Recursive file scanning

Installation ๐Ÿ› ๏ธ

cargo install --git https://github.com/nwiizo/tfocus

Usage ๐ŸŽฎ

cd your-terraform-project
tfocus
  1. ๐Ÿ” Launch the fuzzy-search UI
  2. โŒจ๏ธ Select resources using vim-like keybindings
  3. ๐ŸŽฏ Execute plan/apply on selected resources

Keybindings ๐ŸŽน

  • โ†‘/k: Move up
  • โ†“/j: Move down
  • /: Incremental search
  • Enter: Select
  • Esc/Ctrl+C: Cancel

โš ๏ธ Important Warning โš ๏ธ

Using terraform resource targeting comes with significant risks:

  1. Potential disruption of the Terraform resource graph
  2. ๐ŸŽฒ Risk of state inconsistencies
  3. ๐Ÿงฉ Possible oversight of critical dependencies
  4. ๐Ÿค– Deviation from standard Terraform workflow

When to Use ๐ŸŽฏ

Only use this tool in specific circumstances:

  • ๐Ÿš‘ Emergency troubleshooting
  • ๐Ÿ”ง Development debugging
  • ๐Ÿงช Testing environment verification
  • ๐Ÿ“Š Impact assessment of large-scale changes

For regular operations, always use full terraform plan and apply!

Appropriate Use Cases ๐ŸŽญ

You might consider using tfocus when:

  • ๐Ÿ”ฅ Working with large Terraform codebases where you need to verify specific changes
  • ๐ŸŒ Full plan execution takes too long during development
  • ๐Ÿ” Emergency inspection of specific resource states
  • ๐Ÿ’ฃ Staged application of changes in complex infrastructure

Remember! Standard terraform plan and apply are the best practices for normal operations.

Development Status ๐Ÿšง

This is an experimental tool. Use at your own risk!

Example ๐Ÿ“บ

$ tfocus
QUERY>

โ–ถ    1 [File]     main.tf
     2 [Module]   vpc
     3 [Resource] aws_vpc.main

[โ†‘/k]Up [โ†“/j]Down [Enter]Select [Esc/Ctrl+C]Cancel

Contributing ๐Ÿค

Issues and PRs are welcome! Please help make this tool safer and more useful.

License ๐Ÿ“œ

MIT

Final Note ๐ŸŽฌ

Think of this tool as a "fire exit" - It's there when you need it, but you hope you never have to use it! ๐Ÿ˜…


made with ๐Ÿฆ€ and โค๏ธ by nwiizo

Commit count: 16

cargo fmt