Skip to main content

A project-configurable command palette for common dev workflows

Project description

Sindri

A project-configurable command palette for common dev workflows. Sindri provides an interactive TUI (Text User Interface) and CLI for managing project-specific commands, making it easy to run setup, build, test, and deployment tasks.

Features

  • ๐ŸŽฏ Interactive TUI: Beautiful terminal interface with search, filtering, and command details
  • ๐Ÿ“ Project-Specific Config: Each repository defines its own commands via sindri.toml
  • ๐Ÿš€ Async Execution: Run commands asynchronously with live output streaming
  • ๐Ÿ”„ Parallel Execution: Run multiple commands concurrently
  • ๐Ÿ“Š Multi-Stream Logs: View logs from multiple commands in split panes
  • โš™๏ธ Rich Configuration: Support for dependencies, timeouts, retries, watch mode, and more
  • ๐Ÿณ Docker Support: Built-in support for Docker and Docker Compose workflows
  • ๐Ÿ“ฆ Easy Installation: Install via pip install sindri-dev, use in any project

Quickstart

Installation

pip install sindri-dev

Or install with optional extras:

pip install sindri-dev[docker,compose,git,version,pypi]

Or install from source:

git clone https://github.com/yourusername/sindri.git
cd sindri
pip install -e .

Initialize a Project

Navigate to your project directory and run:

sindri init

This creates a sindri.toml file with example commands. Edit it to match your project's needs.

Use Sindri

Open the interactive menu:

sindri

Or run commands directly:

sindri run setup
sindri run start --parallel

Configuration

Sindri uses TOML configuration files. The config file is discovered by searching upwards from the current working directory for sindri.toml or .sindri.toml.

Basic Configuration

version = "1.0"
project_name = "my-project"

[[commands]]
id = "setup"
title = "Setup Project"
description = "Install dependencies"
shell = "pip install -r requirements.txt"
tags = ["setup", "install"]

[[commands]]
id = "start"
title = "Start Service"
description = "Start the application"
shell = "python -m myproject.main"
tags = ["run", "start"]

Advanced Features

Command Dependencies

[[commands]]
id = "restart"
title = "Restart Service"
shell = "pkill -f app && sleep 1 && python -m app"
dependencies = { before = ["stop"] }

Watch Mode

[[commands]]
id = "tail-logs"
title = "Tail Logs"
shell = "tail -f logs/app.log"
watch = true

Environment Variables

[[commands]]
id = "run-dev"
title = "Run in Development Mode"
shell = "python -m app"
env = { DEBUG = "1", ENV = "development" }

Timeouts and Retries

[[commands]]
id = "long-task"
title = "Long Running Task"
shell = "python long_task.py"
timeout = 300  # 5 minutes
retries = 3

Command Groups

[[groups]]
id = "setup"
title = "Setup"
description = "Setup commands"
order = 1
commands = ["setup", "install"]

Docker Compose Profiles

[[compose_profiles]]
id = "dev"
title = "Development Profile"
profiles = ["dev"]
command = "up"
flags = ["-d"]

See examples/example-project/sindri.toml for a complete example.

CLI Commands

sindri init

Initialize a new Sindri configuration file in the current directory.

sindri init
sindri init --config custom.toml

sindri run <command-id>

Run one or more commands non-interactively.

sindri run setup
sindri run start web api --parallel
sindri run test --timeout 60 --retries 2

Options:

  • --config, -c: Path to config file
  • --dry-run: Show what would be executed without running
  • --verbose, -v: Enable verbose logging
  • --json-logs: Output logs in JSON format
  • --timeout, -t: Timeout in seconds
  • --retries, -r: Number of retries on failure
  • --parallel, -p: Run multiple commands in parallel

sindri list

List all available commands.

sindri list

sindri (default)

Open the interactive TUI menu.

sindri
sindri --config custom.toml

Options:

  • --config, -c: Path to config file
  • --verbose, -v: Enable verbose logging
  • --json-logs: Output logs in JSON format

TUI Navigation

The interactive TUI provides the following keybindings:

  • Ctrl+F or /: Focus search input
  • Enter: Run selected command
  • โ†‘/โ†“: Navigate command list
  • Tab: Switch between panels
  • Ctrl+C or Q: Quit

Recipes

Docker Workflow

[[commands]]
id = "docker-build"
title = "Build Docker Image"
shell = "docker build -t myapp:latest ."
tags = ["docker", "build"]

[[commands]]
id = "docker-run"
title = "Run Docker Container"
shell = "docker run -p 8000:8000 myapp:latest"
tags = ["docker", "run"]

Docker Compose Workflow

[[commands]]
id = "compose-up"
title = "Start Services"
shell = "docker compose up -d"
tags = ["docker", "compose"]

[[commands]]
id = "compose-logs"
title = "View Logs"
shell = "docker compose logs -f"
tags = ["docker", "compose", "logs"]
watch = true

Python Virtual Environment

[[commands]]
id = "setup"
title = "Setup Virtual Environment"
shell = "python -m venv venv && source venv/bin/activate && pip install -r requirements.txt"
tags = ["setup"]

[[commands]]
id = "activate"
title = "Activate Virtual Environment"
shell = "source venv/bin/activate"
tags = ["setup"]

Node.js Project

[[commands]]
id = "install"
title = "Install Dependencies"
shell = "npm install"
tags = ["setup", "install"]

[[commands]]
id = "dev"
title = "Start Dev Server"
shell = "npm run dev"
tags = ["run", "dev"]

[[commands]]
id = "build"
title = "Build for Production"
shell = "npm run build"
tags = ["build"]

Build Executable (PyInstaller)

[[commands]]
id = "build-exe"
title = "Build Executable"
shell = "pyinstaller --onefile --name myapp src/main.py"
tags = ["build", "executable"]

Test Suite with Coverage

[[commands]]
id = "test"
title = "Run Tests"
shell = "pytest tests/"
tags = ["test"]

[[commands]]
id = "test-cov"
title = "Run Tests with Coverage"
shell = "pytest --cov=myproject --cov-report=html tests/"
tags = ["test", "coverage"]

Screenshots

Note: Screenshots will be added here once the TUI is finalized.

Main Screen

Main Screen

Command Execution

Command Execution

Multi-Stream Logs

Multi-Stream Logs

Architecture

Sindri is built with:

  • Typer: CLI framework
  • Textual: TUI framework
  • Pydantic: Configuration validation
  • asyncio: Async command execution
  • structlog: Structured logging

Project Structure

sindri/
โ”œโ”€โ”€ sindri/
โ”‚   โ”œโ”€โ”€ cli.py          # CLI interface
โ”‚   โ”œโ”€โ”€ config.py        # Config discovery and schema
โ”‚   โ”œโ”€โ”€ runner.py        # Async execution engine
โ”‚   โ”œโ”€โ”€ logging.py       # Structured logging
โ”‚   โ”œโ”€โ”€ utils.py         # Utility functions
โ”‚   โ””โ”€โ”€ tui/             # TUI components
โ”‚       โ”œโ”€โ”€ app.py       # Main TUI app
โ”‚       โ”œโ”€โ”€ screens.py   # TUI screens
โ”‚       โ””โ”€โ”€ widgets.py   # TUI widgets
โ”œโ”€โ”€ tests/               # Test suite
โ”œโ”€โ”€ examples/            # Example configurations
โ””โ”€โ”€ pyproject.toml       # Project configuration

Development

Setup

git clone https://github.com/yourusername/sindri.git
cd sindri
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -e ".[dev]"

Running Tests

pytest
pytest --cov=sindri

Building

python -m build

Platform Support

  • โœ… Linux: Full support
  • โœ… macOS: Full support
  • โš ๏ธ Windows: Supported with some limitations:
    • Shell command syntax may differ (use cmd.exe syntax or PowerShell)
    • Some Unix commands may not be available
    • Path separators are handled automatically

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details.

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sindri_dev-0.1.2.tar.gz (67.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sindri_dev-0.1.2-py3-none-any.whl (75.1 kB view details)

Uploaded Python 3

File details

Details for the file sindri_dev-0.1.2.tar.gz.

File metadata

  • Download URL: sindri_dev-0.1.2.tar.gz
  • Upload date:
  • Size: 67.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for sindri_dev-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d0e81a4da21c520cd38fbdb84d2580bdfe678997c2f481851d81d5d479ad951a
MD5 64e86b8c331cdf47cb9764fe3ae713e7
BLAKE2b-256 f5905ab388d04cda46156b036d9f9d07568341907967656201274d2a45910687

See more details on using hashes here.

File details

Details for the file sindri_dev-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: sindri_dev-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 75.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for sindri_dev-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b2b2b7d1c9a4c334588d5eae06b1f31597fa7a7ea9236e0112a2cc93abb78c69
MD5 3ef3f92d02da01d661f2f0c0d93ef1aa
BLAKE2b-256 2de8adadcf40eb8a7388be5360bcae4e7f30f2d834215866596efd922ef5e6f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page