Releases: nacyot/consolle
Releases · nacyot/consolle
v0.4.1 - Major Feature Release (Session Management v2 + Three-Mode Supervisor)
This release consolidates all changes from the 0.3.x series. Previous versions did not have release notes, so this covers everything since v0.2.9.
🎯 Session Management v2
A comprehensive session management system with unique session IDs, persistent registry, and command history tracking.
Session Registry
- Unique Session IDs: 8-character hex IDs (e.g.,
a1b2c3d4) with 4-character short IDs for convenience - Persistent Storage: Global registry at
~/.cone/registry.json(schema v2) - Per-Session Data:
~/.cone/sessions/{project_hash}/{session_id}/with metadata.json and history.log - Session Lifecycle: Tracks status, pid, rails_env, mode, command_count, timestamps, stop_reason
- Concurrency Safe: File locking with atomic writes (temp + rename pattern)
Command History
- JSONL Format: Append-only log with timestamp, code, result, execution_time, success/error
- Rich Filtering: By session, date (
--today,--date), status (--success,--failed), pattern (--grep) - Output Formats: Compact (default), verbose (
-v), JSON (--json)
New CLI Commands
cone ls # List active sessions
cone ls -a # Include stopped sessions
cone history # View command history
cone history --session a1b2 --failed --grep User
cone rm SESSION_ID # Remove session and history
cone rm -f SESSION_ID # Force remove (stops if running)
cone prune [--yes] # Remove all stopped sessionsUpdated Commands
cone start- Displays Session ID:a1b2c3d4 (a1b2)cone stop- Marks session stopped (preserves history)cone status- Shows Session ID, Uptime, Commands countcone exec- Logs to session history with execution time
🚀 Three-Mode Supervisor System
A major architectural change with three execution modes for different use cases.
| Mode | Description | Ruby | Speed |
|---|---|---|---|
pty |
PTY-based, custom commands (default) | 2.7+ | ~0.6s |
embed-rails |
Rails console embedding | 3.3+ | ~0.001s (200x faster) |
embed-irb |
Pure IRB embedding (no Rails) | 3.3+ | ~0.001s (200x faster) |
Mode Selection
cone start # PTY mode (default)
cone start --mode embed-rails # 200x faster for local Rails
cone start --mode embed-irb # Pure Ruby without RailsOr via .consolle.yml:
mode: embed-railsWhen to Use Each Mode
pty: Remote environments (SSH, Docker, Kamal), custom commands, Ruby < 3.3embed-rails: Local Rails development, maximum speed, Ruby 3.3+embed-irb: Pure Ruby utilities without Rails context
Custom Commands (PTY Mode Only)
cone start --command "ssh user@host bin/rails console"
cone start --command "kamal console" --wait-timeout 60
cone start --command "docker exec -it app bin/rails console"Technical Details
- PTY Mode: Process isolation, watchdog thread, restart rate limiting (max 5/5min)
- Embedded Modes: Mutex-protected evaluation, StringIO capture, shared VM
- Output Handling: 100KB truncation, Base64 encoding for code >1KB
- Prompt Detection: Custom sentinel
\u001E\u001F<CONSOLLE>\u001F\u001Ewith self-diagnosis
🛠 Rails Convenience Commands
Quick shortcuts for common Rails operations:
cone rails env # Show current Rails environment
# => "development"
cone rails reload # Reload application code (reload!)
# Reloading...
# => true
cone rails db # Show database connection info
# Adapter: postgresql
# Database: myapp_development
# Host: localhost
# Connected: true⚙️ Configuration File Support
Set defaults in .consolle.yml at project root:
mode: embed-rails
prompt_pattern: '^myapp\(\w+\)>'
command: "bin/rails console" # PTY mode onlySelf-Diagnosis for Prompt Detection
When prompt detection fails, provides:
- Last 5 lines of received output
- Potential prompt pattern detected
- Configuration file instructions
- Environment variable alternative (
CONSOLLE_PROMPT_PATTERN)
🔒 Execution Safety & Timeouts
Pre-exec Ctrl-C (Prompt Separation)
Before each exec, sends Ctrl-C and waits up to 3 seconds for IRB prompt:
- Ensures clean state before executing new commands
- Guards against remote console delays (SSH, Docker, Kamal)
- If prompt doesn't return: Console subprocess restarts →
SERVER_UNHEALTHYerror
# Control options
cone exec --pre-sigint 'code' # Force enable
cone exec --no-pre-sigint 'code' # Disable for single call
CONSOLLE_DISABLE_PRE_SIGINT=1 cone start # Disable globallyTimeout Precedence
CONSOLLE_TIMEOUT (env, if > 0) > --timeout (CLI) > default (60s)
cone exec 'heavy_task' --timeout 120 # CLI timeout
CONSOLLE_TIMEOUT=90 cone exec 'heavy_task' # Env var (highest priority)Error Codes
| Code | Description |
|---|---|
EXECUTION_TIMEOUT |
Code exceeded timeout |
SERVER_UNHEALTHY |
Pre-exec prompt check failed (3s), console restarted |
PROMPT_DETECTION_ERROR |
Initial console startup failed |
⚠️ Breaking Changes
RAILS_ENV Environment Variable
The -e/--rails_env CLI option has been removed. Use RAILS_ENV environment variable:
# Before (no longer works)
cone start -e production
# After
RAILS_ENV=production cone start🐛 Bug Fixes
| Fix | Issue | Solution |
|---|---|---|
| FrozenError (Ruby 3.x) | String mutation on frozen string | Changed to mutable string +'' |
| Large output hangs | Socket blocking on >64KB | 64KB chunk reading with read_nonblock, 100KB truncation |
| Remote cursor position | ESC[6n from SSH/Docker | Detect and respond with ESC[1;1R |
| Large file execution | Timeout on big Ruby files | Base64 for <1KB, temp file + load for ≥1KB |
| restart --force | Options leaking to start | Fixed invoke(:start, [], {}) |
| Timeout wiring | Incomplete precedence | Full chain: env > CLI > default |
📊 Performance Comparison
| Operation | PTY Mode | Embedded Modes |
|---|---|---|
| Startup | 5-25s (Rails boot) | ~100ms-2s |
| Per-execution | ~500ms-2s | ~2-5ms (200x faster) |
| Memory | Isolated subprocess | Shared VM |
📚 Documentation
- Updated
rule.mdandrule.ko.mdfor all new features - Added
bundle execrecommendation for Rails projects - Comprehensive examples for all execution modes and commands
Full Changelog: v0.2.9...v0.4.1