ALI - Action Language Interpreter
Compose complex tmux commands from regular phrases. Pure command aggregator - outputs commands, never executes them.
Quickstart
# Install
uv tool install ali-tool # Recommended
# OR
pip install ali-tool
# Initialize tmux integration
ali --init tmux
# Then reload tmux: tmux source ~/.tmux.conf
# Use
ali GO .2 # → tmux select-pane -t .2
ali SPLIT pop # → tmux display-popup -w 80% -h 80% -d "$PWD" -E 'bash'
ali EDIT file.txt pop # → tmux display-popup ... 'micro file.txt'
ali WIDTH 012 # → Distribute panes evenly
ali ECHO ed? # → Popup editor, pipe output to send-keys
Press C-b a in tmux to open ALI prompt after initialization.
Architecture
ALI is a pure command aggregator - it only outputs commands, never executes them.
Input → Parser → Router → Resolver → Output
↓ ↓ ↓
Grammar Commands Templates
Core Components
- Parser - Tokenizes input using plugin grammars
- Router - Matches patterns to find commands
- Resolver - Expands templates with conditionals and services
- Registry - Manages plugins and their services
Template Engine
# Conditionals
exec: "{?target:tmux select-pane -t {target} && }command"
# Array lookups
exec: "{direction[left:-h -b,right:-h,up:-v -b,down:-v,pop:display-popup]}"
# Service composition
exec: "{split} 'micro {file}'" # Uses split service from tmux
Plugin Development
Plugins are YAML-only data files that define grammar, commands, and services.
# plugin.yaml
name: example
version: 1.0
description: Example plugin
# Grammar
grammar:
item: {type: string}
direction: {values: [left, right, up, down, pop]}
# Commands
commands:
- match: {verb: ACTION, item: present}
exec: "{split} '{item}'"
# Services
services:
process: "tool --process"
# Selectors
selectors:
item?:
type: stream
exec: "selector"
See the plugin documentation for more patterns.
Examples
Navigation
ali GO .2 # Go to pane 2
ali GO :3 # Go to window 3
ali GO ? # Visual pane selector
Splits & Layout
ali SPLIT # Split right (default)
ali SPLIT left # Split left
ali SPLIT pop # Open popup shell
ali WIDTH 012 # Distribute panes evenly
Editing
ali EDIT file.txt # Edit in right split
ali EDIT file.txt pop # Edit in popup
ali VIEW file.txt # Read-only view
Layout
ali LAYOUT # Interactive layout picker
ali LAYOUT '1|23' # Apply layout expression
ali TERMTAP # Open termtap companion popup
Stream Operations
ali ECHO ed? # Edit in popup, pipe to send-keys
ali COPY br? # Browse in popup, copy to clipboard
Ideas
- Multi-stage selectors — Pipe selectors together:
br? | ed?(browse, then edit the result) - Shell completions — Generate from verb/grammar data for bash/zsh/fish
Development
# Clone and install dev version
git clone https://github.com/angelsen/ali.git
cd ali
uv tool install -e .
# Test — ALI outputs commands, never executes
ali GO .2
ali SPLIT right | cat # verify clean stdout
REPL Debugging
from pathlib import Path
from ali_tool.core import ServiceRegistry, Router
registry = ServiceRegistry()
registry.load_plugins(Path('./src/ali_tool/plugins'))
router = Router(registry)
router.execute("SPLIT right") # see output
router.last_state # inspect parsed state
License
MIT - see LICENSE
Metadata
Release files for ali-tool 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ali_tool-0.3.2.tar.gz | 22.0 kB | Without provenance | Details for ali_tool-0.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ali_tool-0.3.2-py3-none-any.whl | Python 3 | none | any | Details for ali_tool-0.3.2-py3-none-any.whl |
Total release size: 51.7 kB
Release files / ali_tool-0.3.2.tar.gz
| Download URL | ali_tool-0.3.2.tar.gz |
|---|---|
| Size | 22.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7034c61b70ceb3ba53d8de3bff5788e44842b48aeb988f2d5981e74c8fa86356
|
|
BLAKE2b-256 checksum How to use checksums |
3a0e3ba8724389350bce4b1c26459d98413782d2f43245132f920d249da5ef25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"EndeavourOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / ali_tool-0.3.2-py3-none-any.whl
| Download URL | ali_tool-0.3.2-py3-none-any.whl |
|---|---|
| Size | 29.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9fe3f9055757b059e75c529211b6310ef66b5ccd1898edf6d59ac593a48cf53a
|
|
BLAKE2b-256 checksum How to use checksums |
4c3b872667ebdecfa60eaab4679ba912618e9c642092c1372942e41edfba30ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"EndeavourOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for ali-tool 0.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.