Catalog PyPI
PACKAGE EXPLORERView in registry

ailang-cli

PyPI

AI-Native Programming Language - Write code in natural language

aicompileriotllmmultilingualnatural-languageollamaprogramming
Versions collected1
Direct dependencies7From release 1.0.3
Last observed21 Oct, 11:08 UTC

README

Version 1.0.3 documentation

AILang - AI-Native Programming Language

Write code in your native language. English, Spanish, Arabic, Chinese - the compiler understands them all.

Version License Python

🌟 What is AILang?

AILang is a revolutionary programming language where you write code in plain natural language. No syntax to memorize, no semicolons, no curly braces - just describe what you want in English, Spanish, Arabic, or any other language, and the AI compiler executes it.

Traditional Programming:

function toggleLight(pin) {
  const GPIO = require('rpi-gpio');
  GPIO.setup(pin, GPIO.DIR_OUT);
  GPIO.write(pin, true);
}

AILang Programming (English):

Turn on the light connected to GPIO pin 17

AILang Programming (Arabic):

شغل الضوء المتصل بمنفذ GPIO رقم ١٧

🚀 Quick Start

Installation

Linux/Mac:

curl -fsSL https://raw.githubusercontent.com/rulhaq/ailang/main/install.sh | bash

Windows (PowerShell as Admin):

iwr -useb https://raw.githubusercontent.com/rulhaq/ailang/main/install.ps1 | iex

Or install via pip:

pip install ailang-cli

Your First Program

  1. Create a new project:
ailang new my-first-app
cd my-first-app
  1. Edit src/main.en:
Create a button in the center that says "Click Me!". 
When clicked, show an alert saying "Hello from AILang!"
  1. Compile and run:
ailang compile src/main.en

Your browser opens with your running app! 🎉

📚 Features

✅ Multi-Language Support

Write code in any natural language - the file extension determines the language:

  • .en - English
  • .es - Spanish (Español)
  • .ar - Arabic (العربية)
  • .fr - French (Français)
  • .de - German (Deutsch)
  • .zh - Chinese (中文)
  • .ja - Japanese (日本語)
  • .hi - Hindi (हिन्दी)
  • .pt - Portuguese (Português)
  • .ru - Russian (Русский)

✅ Multiple Target Platforms

Compile to different platforms:

# Web applications (HTML/CSS/JS)
ailang compile app.en --target web

# Python scripts
ailang compile script.en --target python

# IoT/Raspberry Pi
ailang compile iot-device.en --target iot

# Mobile apps (coming soon)
ailang compile mobile.en --target mobile

✅ Local LLM Support

No cloud required! AILang works with local LLMs:

  • Ollama (Recommended) - Run models locally
  • llama.cpp - Lightweight C++ inference
  • Cloud APIs - Claude, GPT-4 (optional)

✅ IoT & Hardware Support

Control real hardware with natural language:

Read temperature from sensor on pin 4.
If temperature exceeds 30 degrees, turn on fan.
Send notification to my phone.

Supports:

  • Raspberry Pi GPIO
  • Arduino (via serial)
  • Sensors (DHT22, BMP280, etc.)
  • Actuators, relays, motors
  • Network communication

🛠️ Installation & Setup

Prerequisites

  • Python 3.8+ (required)
  • Ollama (recommended for local LLM) or Cloud API keys

Detailed Installation

1. Install AILang

Via curl (Linux/Mac):

curl -fsSL https://raw.githubusercontent.com/rulhaq/ailang/main/install.sh | bash

Via PowerShell (Windows):

iwr -useb https://raw.githubusercontent.com/rulhaq/ailang/main/install.ps1 | iex

Via pip:

pip install ailang-cli

From source:

git clone https://github.com/rulhaq/ailang.git
cd ailang
pip install -e .

2. Choose Your LLM Backend

Option A: Local LLM (Recommended - Free & Private)

Install Ollama:

# Mac
brew install ollama

# Linux
curl -fsSL https://ollama.ai/install.sh | sh

# Windows
# Download from https://ollama.ai

Pull a model:

ollama pull llama3.2
# or
ollama pull codellama

Configure AILang:

ailang setup -i
# Select: 1 (Ollama)
# Model: llama3.2

Option B: Cloud APIs

ailang config set llm_backend anthropic
ailang config set anthropic_api_key YOUR_API_KEY

3. Verify Installation

ailang --version
# AILang 1.0.0

📖 Usage Guide

Command Line Interface

# Create new project
ailang new <project-name> [-l <language>]

# Compile source file
ailang compile <file> [-o output] [-t target] [--no-open]

# Configuration
ailang config get [key]
ailang config set <key> <value>
ailang config list

# Setup wizard
ailang setup -i

Project Structure

myproject/
├── src/
│   ├── main.en          # Main source file
│   ├── components.en    # Reusable components
│   └── utils.es         # Spanish utilities
├── build/               # Compiled output
├── ailang.json          # Project configuration
└── README.md

Configuration File (ailang.json)

{
  "name": "myproject",
  "version": "1.0.0",
  "language": "en",
  "target": "web",
  "entry": "src/main.en",
  "output": "build",
  "llm_backend": "ollama",
  "ollama_model": "llama3.2"
}

💡 Examples

Web Application (English)

calculator.en:

Create a calculator app. Show a display area at the top for numbers.
Add buttons for digits 0-9, operations (+, -, *, /), clear, and equals.
Use a modern blue and white color scheme with rounded corners.
When users click buttons, perform calculations and show results.

Compile:

ailang compile calculator.en

IoT Device (English)

smart-garden.en:

Read soil moisture from sensor on pin 4 every hour.
If moisture is below 30%, turn on water pump on pin 17 for 10 seconds.
Log all readings with timestamps to a CSV file.
Send me an email if the moisture stays low for more than 6 hours.

Compile:

ailang compile smart-garden.en --target iot

Web App (Spanish)

todo.es:

Crear una aplicación de lista de tareas pendientes.
Mostrar un campo de entrada en la parte superior.
Agregar botón azul para crear nuevas tareas.
Mostrar tareas en una lista con casillas de verificación.
Usar diseño moderno con gradiente de azul a morado.

Compile:

ailang compile todo.es

IoT (Arabic)

security.ar:

قراءة حالة مستشعر الحركة على المنفذ ٢٣ كل ثانية.
إذا اكتشف حركة، تشغيل الإنذار على المنفذ ١٧.
التقاط صورة من الكاميرا وإرسالها إلى بريدي الإلكتروني.
تسجيل جميع الأحداث مع التاريخ والوقت.

Compile:

ailang compile security.ar --target iot

🎯 Advanced Usage

Multi-File Projects

main.en:

Load the login form from auth.en.
When user logs in successfully, show the dashboard from dashboard.en.

auth.en:

Create a login form with username and password fields.
Add a blue login button.
Validate credentials and return success or error.

Hot Reload Development

ailang compile app.en --watch

Edit your .en file and see changes instantly!

Custom LLM Endpoints

ailang config set llm_backend custom
ailang config set custom_endpoint http://localhost:8000/v1/generate

Environment Variables

export AILANG_BACKEND=ollama
export AILANG_MODEL=llama3.2
export AILANG_OUTPUT_DIR=dist

🔧 Configuration Reference

LLM Backends

BackendDescriptionSetup
ollamaLocal Ollama serverInstall Ollama + pull model
llamacppllama.cpp serverRun llama.cpp server on :8080
anthropicClaude APISet API key
openaiGPT-4 APISet API key
customCustom endpointConfigure URL

Available Settings

llm_backend          # ollama, anthropic, openai, llamacpp, custom
ollama_model         # Model name for Ollama
ollama_url           # Ollama server URL
anthropic_api_key    # Claude API key
openai_api_key       # OpenAI API key
custom_endpoint      # Custom LLM endpoint
default_language     # Default source language (en, es, ar, etc.)
output_dir           # Output directory (default: build)
auto_open            # Auto-open after compile (true/false)

🌍 Supported Languages

LanguageCodeExample Extension
Englishen.en
Spanishes.es
Arabicar.ar
Frenchfr.fr
Germande.de
Chinesezh.zh
Japaneseja.ja
Hindihi.hi
Portuguesept.pt
Russianru.ru

Want your language? Request it here

🤝 Contributing

We welcome contributions! Here's how:

  1. Add language support - Submit translations
  2. Improve compilation - Better prompts, optimizations
  3. New targets - Mobile, desktop, embedded
  4. Examples - Share your AILang projects
  5. Documentation - Tutorials, guides

See CONTRIBUTING.md

📦 Ecosystem

IDE Support

  • VS Code Extension - Syntax highlighting, autocomplete
  • Sublime Text - Syntax highlighting
  • Vim Plugin - Syntax, compilation

Package Registry

Share and install AILang packages:

ailang install date-utils
ailang publish my-package

Community Examples

Browse examples: https://github.com/ailang-examples

🐛 Troubleshooting

"Compilation failed"

  1. Check LLM backend is running:
# For Ollama
ollama list
curl http://localhost:11434/api/tags
  1. Verify configuration:
ailang config get
  1. Test with simple code:
echo "Show hello world" > test.en
ailang compile test.en

"Ollama not found"

Install Ollama: https://ollama.ai

Or use cloud API:

ailang config set llm_backend anthropic

Slow compilation

Use a smaller model:

ollama pull llama3.2:7b  # Smaller, faster
ailang config set ollama_model llama3.2:7b

📄 License

MIT License - See LICENSE

🙏 Credits

🌟 Star Us!

If you like AILang, give us a star on GitHub! ⭐

📞 Support


Made with ❤️ by the AILang community

Programming should be as natural as speaking.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.310 May 20267

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
rulhaq/ailang

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 11:08 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:f6ce5e1f4f266f8211f2fdf4038a0487a9a9c0b5f3001bc9cef47254ba10692d