Skip to main content

Action Language Interpreter - One command for every tool

Project description

ALI - Action Language Interpreter

PyPI version Python 3.12+ License: MIT

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

Stream Operations

ali ECHO ed?       # Edit in popup, pipe to send-keys
ali COPY br?       # Browse in popup, copy to clipboard

Development

# Clone and install dev version
git clone https://github.com/angelsen/ali.git
cd ali
uv tool install -e .

# Test a command
ali GO .2

License

MIT - see LICENSE

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

ali_tool-0.2.0.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

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

ali_tool-0.2.0-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file ali_tool-0.2.0.tar.gz.

File metadata

  • Download URL: ali_tool-0.2.0.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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}

File hashes

Hashes for ali_tool-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6bbdeb0176af248b5578f33ec8d85e071f3e5cf73682cf76fc04957d1b3901be
MD5 468a354febb9ab051c0059b2a81df9db
BLAKE2b-256 1b4233460c9725ed894f45ef4e6233052a360ae3822166dc9fa3ca1f21bc420d

See more details on using hashes here.

File details

Details for the file ali_tool-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ali_tool-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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}

File hashes

Hashes for ali_tool-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a102096d22623a8856969f4c1a565fba7810d6b186e37689c4b1989b541ed8e
MD5 c7e78a64471e34320f081329c8acf64e
BLAKE2b-256 0f4ea40593e3df627fdefaf8adb2423190f7d595e6931c06ba55e1dc73daf6f2

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