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.1.1.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.1.1-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ali_tool-0.1.1.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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.1.1.tar.gz
Algorithm Hash digest
SHA256 0d68b033aa70b2e3dde8519ba388f2ae02aae24bef8220417b908624ff80608a
MD5 0846ba2c3100db07d4c933532fd57f17
BLAKE2b-256 645cb03984cc5f86ebfff9ba91b529aeb062815ce4516e86616c8dfb280f47d4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ali_tool-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e1cf290928da40bcecb5566e8df0b957dfdef4b9aadcdc9443141267251c16ae
MD5 cee510612aeeba0a807202805cda8186
BLAKE2b-256 340a35bf3f8fb0cad48eae46aac364e8c657f9211695254fc0d47ae9401d68a8

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