sxn is a powerful session management tool for multi-repository development. It helps developers manage complex development environments with multiple git repositories, providing isolated workspaces, automatic project setup, and intelligent session management.
- Session Management: Create isolated development sessions with their own git worktrees
- Multi-Repository Support: Work with multiple repositories in a single session
- Automatic Project Setup: Apply project-specific rules and templates automatically
- Git Worktree Integration: Leverage git worktrees for efficient branch management
- Template Engine: Generate project-specific files using Liquid templates
- Security First: Path validation and command sanitization for safe operations
- Thread-Safe: Concurrent operations with proper synchronization
Add this line to your application's Gemfile:
gem 'sxn'And then execute:
bundle installOr install it yourself as:
gem install sxnsxn initsxn add feature-xyz --description "Working on feature XYZ"sxn use feature-xyzsxn worktree add my-project --branch feature-xyzsxn listSessions are isolated workspaces that contain git worktrees for your projects:
# Create a new session
sxn add my-feature
# Switch to a session
sxn use my-feature
# List all sessions
sxn list
# Show current session
sxn current
# Remove a session
sxn sessions remove my-featureRegister and manage projects that can be added to sessions:
# Add a project
sxn projects add my-app ~/projects/my-app
# List projects
sxn projects list
# Remove a project
sxn projects remove my-appAdd project worktrees to your current session:
# Add a worktree for a project
sxn worktree add my-app --branch feature-branch
# List worktrees in current session
sxn worktree list
# Remove a worktree
sxn worktree remove my-appDefine project-specific setup rules:
# List available rules
sxn rules list
# Apply rules to a project
sxn rules apply my-appsxn stores its configuration in .sxn/config.yml in your workspace:
sessions_folder: .sxn-sessions
settings:
auto_cleanup: true
max_sessions: 10
default_branch: mainCreate .sxn-rules.yml in your project root to define automatic setup:
rules:
- type: template
template: rails/database.yml
destination: config/database.yml
- type: copy_files
source: .env.example
destination: .env
- type: setup_commands
commands:
- bundle install
- yarn install
- rails db:setupsxn includes templates for common project types:
- Rails: CLAUDE.md, database.yml, session-info.md
- JavaScript: README.md, session-info.md
- Common: .gitignore, session-info.md
Templates use Liquid syntax and have access to session, project, and environment variables.
After cloning the repository, run:
bundle install
./script/setup-hooks # Set up git hooks for automated checksImportant: All code must pass tests and linting before being pushed to the repository.
# Run all tests
bundle exec rspec
# Run tests in parallel (faster)
bundle exec rake parallel:spec
# Run with coverage report
bundle exec rake parallel:spec_with_coverage# Check code style
bundle exec rubocop
# Auto-fix code style issues
bundle exec rubocop -aThe project includes a pre-push hook that automatically runs RuboCop and RSpec before allowing pushes. To set it up:
./script/setup-hooksTo bypass hooks in emergency situations (not recommended):
git push --no-verify- Make your changes
- Run
bundle exec rubocop -ato fix any style issues - Run
bundle exec rspecto ensure tests pass - Commit your changes
- Push (pre-push hooks will run automatically)
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Ensure tests pass and code style is correct
- Commit your changes with meaningful commit messages
- Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Run all tests in parallel (recommended for speed)
bundle exec parallel_rspec spec/
# Run all tests sequentially
bundle exec rspec
# Run only unit tests
bundle exec rspec spec/unit
# Run with coverage
ENABLE_SIMPLECOV=true bundle exec parallel_rspec spec/# Install RBS dependencies
rbs collection install
# Run Steep type checker
steep check# Run RuboCop
bundle exec rubocopBug reports and pull requests are welcome on GitHub at https://github.com/yourusername/sxn.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
The gem is available as open source under the terms of the MIT License.
This is a personal project that leverages Claude Code as the primary and active developer. As we continue to refine the development process and iron out any kinks, you can expect builds to gradually become more stable. Your patience and feedback are greatly appreciated as we evolve this tool together.