Skip to main content

xlforge Logo

xlforge

Stars Forks License

A command-line interface for Excel manipulation. Designed for agents and scripts.

About

xlforge is a powerful CLI for Excel manipulation built with an agent-first philosophy. Every command is stateless and includes the source file as a parameter, making it perfect for automation, scripts, and AI integrations.

Similar to how a robust build tool provides declarative commands for complex tasks, xlforge provides a comprehensive set of commands for Excel operations - from basic cell manipulation to advanced features like SQL queries, semantic search, and macro recording.

xlforge uses a Hybrid Engine architecture that automatically selects the best approach:

  • xlwings when Excel is installed - full control including cells, formatting, charts, and macros
  • openpyxl for headless/Docker environments - read/write cells, sheet operations, and basic formatting

Philosophy

  • Agent-first - Every command is a standalone shell operation
  • Stateless - No interactive mode, no shell persistence
  • JSON everywhere - All commands support JSON output; errors can be returned as JSON
  • Fail fast with retry - Exponential backoff on file lock (max 3 attempts)
  • Transaction-safe - Batch operations can be wrapped in transactions

Features

  • Cell operations - get, set, formula, clear, copy, bulk operations
  • Sheet management - create, delete, rename, copy, use
  • Formatting - cell styles, number formats, borders, colors
  • Data import/export - CSV, Excel tables, database sync
  • Charts and validations - create and manage Excel objects
  • SQL Bridge - Query Excel, CSV, and databases using DuckDB
  • Semantic search - AI-powered cell finding by meaning
  • Macro recorder - Transform user actions into reusable scripts
  • Checkpoint versioning - Git-like versioning for Excel files
  • Batch execution - Run scripts in a single COM session

Quick Start

# Install xlforge
pip install xlforge

# Read a cell
xlforge cell get report.xlsx "A1"

# Write to a cell
xlforge cell set report.xlsx "A1" "Hello World"

# Set a formula
xlforge cell formula report.xlsx "B1" "=SUM(A:A)"

# Set context to avoid repeating filename
xlforge use report.xlsx --sheet Data
cell set A1 "Value"  # Operates on Data!A1 in report.xlsx

# Run a batch script
xlforge run script.xlf --transaction

Documentation

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see the LICENSE file for details.

Metadata

Release files for xlforge 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xlforge 0.1.0
File Size Uploaded
xlforge-0.1.0.tar.gz 62.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xlforge 0.1.0
File Interpreter ABI Platform
xlforge-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 124.5 kB

Release files / xlforge-0.1.0.tar.gz

Download URL xlforge-0.1.0.tar.gz
Size 62.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bd633f50af8d21f96867402eb1e4d41797e0687a2a8d7438742b7d80d79bf978
BLAKE2b-256 checksum
How to use checksums
63ff0a102c1fa327d72dd5a2a19f418a1bc15c240f91f37ed3c7662ecbc8e149
Upload date
Uploaded using Trusted Publishing?
What is 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":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / xlforge-0.1.0-py3-none-any.whl

Download URL xlforge-0.1.0-py3-none-any.whl
Size 62.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00394f9b92fd41dffc20b311747fb93094b38b3d1cf594209a677f32ee34d81c
BLAKE2b-256 checksum
How to use checksums
907652448db25feaacb048d263c1be6ace9f4f12050431b696a4b3a310813d48
Upload date
Uploaded using Trusted Publishing?
What is 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":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page