tg is a Python TUI based SSH connection manager that integrates seamlessly with your existing SSH configuration. https://pypi.org/project/tengingarstjori/
  • Python 90.5%
  • Shell 9.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-10 08:25:27 +00:00
docs Initial commit and move to forgejo 2026-09-10 04:13:42 -04:00
scripts Initial commit and move to forgejo 2026-09-10 04:13:42 -04:00
src/tengingarstjori Initial commit and move to forgejo 2026-09-10 04:13:42 -04:00
tests Initial commit and move to forgejo 2026-09-10 04:13:42 -04:00
.gitignore Initial commit 2026-09-10 08:04:26 +00:00
CLAUDE.md Initial commit and move to forgejo 2026-09-10 04:13:42 -04:00
install.sh Initial commit and move to forgejo 2026-09-10 04:13:42 -04:00
LICENSE Initial commit and move to forgejo 2026-09-10 04:13:42 -04:00
main.py Initial commit and move to forgejo 2026-09-10 04:13:42 -04:00
MANIFEST.in Initial commit and move to forgejo 2026-09-10 04:13:42 -04:00
pre_commit_tests.sh Initial commit and move to forgejo 2026-09-10 04:13:42 -04:00
pyproject.toml Initial commit and move to forgejo 2026-09-10 04:13:42 -04:00
pytest.ini Initial commit and move to forgejo 2026-09-10 04:13:42 -04:00
README.md Update README.md 2026-09-10 08:25:27 +00:00
requirements.txt Initial commit and move to forgejo 2026-09-10 04:13:42 -04:00
security_best_practices_report.md Initial commit and move to forgejo 2026-09-10 04:13:42 -04:00
uv.lock Initial commit and move to forgejo 2026-09-10 04:13:42 -04:00

Tengingarstjóri(tg) - SSH Connection Manager

Tengingarstjóri (tg) is a Python TUI based SSH connection manager that integrates seamlessly with your existing SSH configuration. Shortened to tg for ease of use, the app was born when my previous tool was deprecated and I wanted to learn how pypi and python packaging worked.

Installation

pip install tengingarstjori

From Source

git clone https://github.com/greyhoundforty/tengingarstjori.git
cd tengingarstjori
pip install -e .

Features

  • Full SSH Connection Management: Add, update, clone, and remove connections
  • Flexible List Views: Table, compact, and JSON formats with tag/search/sort filtering
  • Quick Connect: tg connect <name> launches SSH and tracks usage stats
  • ProxyJump Support: Seamless bastion host and jump server configuration
  • Port Forwarding: Local and remote port forwarding with auto-corrected syntax
  • Non-invasive SSH Config Integration: Preserves your existing setup
  • Export / Import: Backup and restore connections as JSON or SSH config format
  • History & Health Checks: tg history and tg test for usage tracking and connectivity

Demo

Quick Start

# Initialize Tengingarstjóri (tg)
tg init

# Add your first connection
tg add -n web-server -h 192.168.1.100 -u admin

# List connections
tg list

# Connect
tg connect web-server

# Or use SSH directly (tg manages the config)
ssh web-server

Architecture

Rather than modifying your main SSH config directly, Tengingarstjóri will:

  1. Create a managed config file: ~/.ssh/config.tengingarstjori
  2. Add a single line to main config to include our new file: Include ~/.ssh/config.tengingarstjori
  3. Manage connections separately: All additions/changes go to the managed file
  4. Preserve your existing SSH setup: Your existing SSH config remains untouched

Security

Tengingarstjóri is designed to handle sensitive SSH configuration safely:

  • Restricted file permissions: connections.json, ~/.ssh/config.tengingarstjori, and the ~/.tengingarstjori/ config directory are created with 0600/0700 permissions atomically — there is no window where files are world-readable.
  • SSH config injection prevention: All user-supplied fields (name, host, user, identity_file, proxy_jump, extra_options) are validated to reject newline characters before being written into the SSH config. Notes have newlines stripped. This prevents crafted values from injecting arbitrary SSH config directives.
  • Non-destructive config management: Only a single Include line is added to your main ~/.ssh/config. All managed connections live in a separate file that can be inspected, backed up, or removed independently.
  • Backup before changes: A backup of your main SSH config is created at ~/.ssh/config.backup before any modification.

Usage Examples

See the wiki for CLI examples, configuration options, and local development guidance.

Contributing

  1. See DEVELOPMENT.md for local testing guidance
  2. Ensure all tests pass: mise run test
  3. Check code quality: mise run lint
  4. Run full validation: mise run validate
  5. Update documentation as needed

License

This project is licensed under the MIT License - see the LICENSE file for details.