Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
c684fc4
feat: Add Pydantic config validation with environment variable support
claude Jan 18, 2026
aab1650
feat: Add built-in watch mode for instance status command
claude Jan 18, 2026
c20aed2
refactor: Remove unused cfg parameter from get_instance_name()
claude Jan 18, 2026
cff9995
fix: Use correct config key ssh_key_path in connect()
claude Jan 18, 2026
157d0a0
docs: Add issue 36 for config validate panel width
ivyleavedtoadflax Jan 18, 2026
e40c8c3
refactor: Remove unnecessary builtins import from instance.py (#18)
ivyleavedtoadflax Jan 18, 2026
e32dcc1
refactor: Remove unused Typer app instance from utils.py
claude Jan 18, 2026
8514550
refactor: Use cached get_sts_client() in get_account_id()
claude Jan 18, 2026
998813e
docs: Add issues 37-38 for pricing improvements
ivyleavedtoadflax Jan 18, 2026
edf1135
fix: Remove hardcoded console width and simplify validate output
claude Jan 18, 2026
1515e21
docs: Add issue 39 for scheduled instance shutdown
ivyleavedtoadflax Jan 18, 2026
48226c4
docs: Update issue 39 to use remote shutdown command
ivyleavedtoadflax Jan 18, 2026
8773ac0
feat: Add region fallback for pricing API (#22)
ivyleavedtoadflax Jan 18, 2026
bd661c1
feat: Add scheduled instance shutdown via SSH
claude Jan 18, 2026
6abf1c7
docs: Add issue 40 for console output consistency
ivyleavedtoadflax Jan 18, 2026
42f6f75
feat: Standardize console output styles for ECS commands
claude Jan 18, 2026
6d01aa6
feat: Add instance cost command to show estimated cost based on uptim…
ivyleavedtoadflax Jan 18, 2026
904d98a
docs: Add issues 41-42 for cost fixes and ls/status clarification
ivyleavedtoadflax Jan 18, 2026
d483cdd
docs: Add testing requirements for issue 41
ivyleavedtoadflax Jan 18, 2026
c814b3d
feat: Integrate cost columns into instance ls with --cost flag (#41)
claude Jan 18, 2026
89444b0
docs: Reopen issue 41 - cost still not displaying
ivyleavedtoadflax Jan 18, 2026
59f489a
feat: Differentiate instance ls and status commands (#42) (#27)
ivyleavedtoadflax Jan 18, 2026
d45b087
refactor: Remove unnecessary enumerate() in get_instance_ids() (#28)
ivyleavedtoadflax Jan 18, 2026
23defd4
refactor: Remove unused drop_nameless parameter from get_instance_info()
claude Jan 18, 2026
abd960b
refactor: Remove deprecated ec2_client backwards compatibility shim
claude Jan 18, 2026
5a9a03e
refactor: Remove deprecated ecs_client backwards compatibility shim
claude Jan 18, 2026
d609bd2
refactor: Remove unused ENV_PREFIX constant from config.py (#32)
ivyleavedtoadflax Jan 18, 2026
9fd5a15
refactor: Rename in_duration parameter to stop_in for consistency (#33)
ivyleavedtoadflax Jan 18, 2026
3074968
docs: Add issue 43 for Rich Panel width fix
ivyleavedtoadflax Jan 18, 2026
f2b1ef5
refactor: Rename type function and parameter to avoid shadowing built…
ivyleavedtoadflax Jan 18, 2026
59e5ba1
refactor: Add missing width=200 to Console initialization in config.py
claude Jan 18, 2026
79b1500
refactor: Remove unused is_instance_stopped() function (#36)
ivyleavedtoadflax Jan 18, 2026
3a8e525
fix: Correct EU region location names in pricing API
ivyleavedtoadflax Jan 18, 2026
eb64967
docs: Update issue 41 with root cause and fix details
ivyleavedtoadflax Jan 18, 2026
b9968ef
docs: Add issue 44 for test API validation
ivyleavedtoadflax Jan 18, 2026
51043d5
refactor: Remove duplicate list_launch_templates() from instance.py
claude Jan 18, 2026
15ec8b7
docs: Add issue 45 for v1.1.0 release preparation
ivyleavedtoadflax Jan 18, 2026
a0ce56c
fix: Set expand=False on all Rich Panels to prevent full-width expansion
claude Jan 18, 2026
553aeb7
test: Add AWS API contract validation tests (#39)
ivyleavedtoadflax Jan 18, 2026
4e357ec
release: Prepare v1.1.0 release (#40)
ivyleavedtoadflax Jan 18, 2026
88143e6
refactor: Remove unused ConfigurationError exception class (#41)
ivyleavedtoadflax Jan 18, 2026
dd0cebb
refactor: Remove unused InvalidInstanceStateError exception class (#42)
ivyleavedtoadflax Jan 18, 2026
66fca37
refactor: Extract _build_ssh_command() helper to reduce duplication
claude Jan 18, 2026
882fb10
refactor: Consolidate datetime imports to module level in instance.py…
ivyleavedtoadflax Jan 18, 2026
1c75cde
refactor: Centralize console initialization in utils.py
claude Jan 18, 2026
443eae3
refactor: Remove redundant Console creation in _watch_status() (#46)
ivyleavedtoadflax Jan 18, 2026
181e266
chore: Add gitleaks to pre-commit hooks for secret detection
ivyleavedtoadflax Jan 18, 2026
d03e4b5
refactor: Remove redundant get_instance_type() call in instance_type()
claude Jan 18, 2026
fb62a5d
refactor: Replace overly broad exception handling in list_launch_temp…
ivyleavedtoadflax Jan 18, 2026
57ccc78
refactor: Remove misleading return type from list_launch_templates() …
ivyleavedtoadflax Jan 18, 2026
1122bcd
refactor: Replace overly broad exception handling in config.py (#50)
ivyleavedtoadflax Jan 18, 2026
d4c79e8
refactor: Replace silent exception handler in list_launch_templates()
claude Jan 18, 2026
944d1ac
refactor: Extract duplicated launch() logic into shared utility funct…
ivyleavedtoadflax Jan 18, 2026
0fd926d
refactor: Add explicit exit codes to typer.Exit() calls in ecs.py
claude Jan 18, 2026
58a4df7
refactor: Standardize docstring formatting in ecs.py
claude Jan 18, 2026
983c829
refactor: Standardize Typer parameter style in status() command (#55)
ivyleavedtoadflax Jan 18, 2026
d7a6ed7
refactor: Remove unused get_instance_pricing_info() function (#56)
ivyleavedtoadflax Jan 18, 2026
9c11aad
refactor: Standardize ConfigParser variable naming in config.py (#57)
ivyleavedtoadflax Jan 18, 2026
1e82ecc
refactor: Remove unused if __name__ == "__main__" blocks
claude Jan 18, 2026
7c6ad98
refactor: Remove unused return value from write_config() function
claude Jan 18, 2026
aae4c54
refactor: Remove unused get_snapshot_status() function
claude Jan 18, 2026
8162ea2
refactor: Remove unused validate_snapshot_id() function
claude Jan 18, 2026
4cefa73
refactor: Move Terraform comment to be adjacent to its code
claude Jan 18, 2026
9628c2c
refactor: Use config_manager.remove_value() in unset_value command (#63)
ivyleavedtoadflax Jan 18, 2026
60fc458
refactor: Simplify config path assignment with ternary operators
claude Jan 18, 2026
ac4586b
refactor: Remove unused get_monthly_estimate() function and HOURS_PER…
ivyleavedtoadflax Jan 18, 2026
3645737
refactor: Extract duplicate exception handling to helper method in Co…
ivyleavedtoadflax Jan 18, 2026
c842185
refactor: Fix inconsistent filtering in get_instance_ids()
claude Jan 18, 2026
252f035
refactor: Fix get_value CLI command to use ConfigManager consistently…
ivyleavedtoadflax Jan 18, 2026
317773d
refactor: Extract hardcoded time constants in instance.py (#69)
ivyleavedtoadflax Jan 18, 2026
6240778
refactor: Add MINUTES_PER_HOUR constant for semantic correctness
claude Jan 18, 2026
c840673
refactor: Extract SSH readiness sleep to constant (#71)
ivyleavedtoadflax Jan 18, 2026
af5b261
refactor: Extract type change polling magic numbers to constants
claude Jan 18, 2026
1f4c92d
docs: Add issue 46 for connect stopped instance behavior (GitHub #73)
ivyleavedtoadflax Jan 18, 2026
c703a78
feat: Add --start and --no-start flags to connect command (GitHub #73)
claude Jan 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: Remove redundant Console creation in _watch_status() (#46)
The _watch_status() function created its own Console instance when the
module already imports console from remote.utils. This change:

- Removes local watch_console = Console() in _watch_status()
- Uses the shared console instance from utils instead
- Removes now-unused Console import from rich.console
- Updates test to mock console instead of Console

This completes the console centralization refactor - all modules now
use the shared console instance from remote/utils.py.

Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit 7d639db)
  • Loading branch information
ivyleavedtoadflax and claude committed Jan 18, 2026
commit 443eae385a7003548e84089e7dd586388f35e2e3
24 changes: 24 additions & 0 deletions progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,3 +381,27 @@ This duplication meant any changes to console configuration would need to be mad

**Note:** `remote/instance.py` still imports `Console` from `rich.console` because the `_watch_status` function creates a separate Console instance for its Live display functionality.

---

## 2026-01-18: Remove redundant Console creation in `_watch_status()`

**File:** `remote/instance.py`

**Issue:** The `_watch_status()` function created a new `Console()` instance on line 305:
```python
watch_console = Console()
```

This was redundant because:
1. The module already imports `console` from `remote.utils` (centralized console instance)
2. The local `watch_console` duplicated functionality already available
3. This was noted as an exception in the previous refactor, but there's no reason not to reuse the shared console

**Changes:**
- Removed the `watch_console = Console()` line from `_watch_status()`
- Changed `Live(console=watch_console, ...)` to `Live(console=console, ...)`
- Changed `watch_console.print(...)` to `console.print(...)`
- Removed the now-unused `from rich.console import Console` import

This completes the console centralization refactor - all modules now use the shared `console` instance from `remote/utils.py`.

7 changes: 2 additions & 5 deletions remote/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import typer
from botocore.exceptions import ClientError, NoCredentialsError
from rich.console import Console
from rich.live import Live
from rich.panel import Panel
from rich.table import Table
Expand Down Expand Up @@ -302,16 +301,14 @@ def _build_status_table(instance_name: str, instance_id: str) -> Panel | str:

def _watch_status(instance_name: str, instance_id: str, interval: int) -> None:
"""Watch instance status with live updates."""
watch_console = Console()

try:
with Live(console=watch_console, refresh_per_second=1, screen=True) as live:
with Live(console=console, refresh_per_second=1, screen=True) as live:
while True:
result = _build_status_table(instance_name, instance_id)
live.update(result)
time.sleep(interval)
except KeyboardInterrupt:
watch_console.print("\nWatch mode stopped.")
console.print("\nWatch mode stopped.")


@app.command()
Expand Down
4 changes: 2 additions & 2 deletions tests/test_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,8 @@ def test_should_handle_keyboard_interrupt(self, mocker):
# Mock _build_status_table to return a simple string
mocker.patch("remote.instance._build_status_table", return_value="test")

# Mock Console and Live
mocker.patch("remote.instance.Console")
# Mock console (imported from utils) and Live
mocker.patch("remote.instance.console")
mock_live = mocker.patch("remote.instance.Live")
mock_live.return_value.__enter__ = mocker.Mock(return_value=mock_live.return_value)
mock_live.return_value.__exit__ = mocker.Mock(return_value=False)
Expand Down