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
  • ๐Ÿ“ฆ Global Installation: Install once via pipx, use in any project

Quickstart

Installation

pipx install sindri

Or install from source:

git clone https://github.com/yourusername/sindri.git
cd sindri
pipx 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.1.tar.gz (69.8 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.1-py3-none-any.whl (77.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sindri_dev-0.1.1.tar.gz
  • Upload date:
  • Size: 69.8 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.1.tar.gz
Algorithm Hash digest
SHA256 98ba08d6f1340385eed2f5810eebab6ae8d23892237d89038ee967f416563c5f
MD5 ae4f91dfc4329b4af4eaa67a3ef882b9
BLAKE2b-256 bed5b2fa09861187434a86ecd004c9f6ac1101e2b42994d90be0ea6dc7bc7479

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sindri_dev-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 77.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d77498ce265ebcac347ff1d3d4e4f3ed0d2317a63f731518b588a07e9896ef6
MD5 6085f88c3dc0087739eae0cdde0823f5
BLAKE2b-256 6b237711e413cbc189975fd9a2a1581e674559774fa84d345f6ad845a88bdc2d

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