XQL — Excelano Query Language. One CLI, one SQL-shaped query language, multiple backends.
xql binds to a tabular data source at startup and runs SELECT, UPDATE, DELETE, and INSERT against it. Writes preview first, apply on confirmation. The grammar is shared across backends; only the I/O differs.
$ xql tasks.csv
Connected to: tasks.csv (5 columns, 248 rows). Type "help" for commands, "quit" to exit.
xql> SELECT Title, Status WHERE Priority > 2
| Title | Status |
| ------------------ | ----------- |
| Migrate auth layer | Open |
| Backfill activity | In Progress |
(2 rows)
xql> UPDATE SET Status = 'Done' WHERE Modified < '2024-01-01'
Would update 8 rows in tasks.csv:
SET Status = "Done"
Sample:
| id | Title |
| -- | ------------------ |
| 41 | Q3 invoice cleanup |
| 47 | Audit log purge |
... 6 more
Apply? [y/N]: y
Updated 8 of 8 rows. Wrote tasks.csv.
Tabular data lives in many places — CSVs on disk, SharePoint Lists in M365 tenants, Excel exports, database tables. Editing them in bulk is awkward. Spreadsheet apps choke past a few hundred thousand rows, point-and-click web UIs are not scriptable, and writing a one-off script for each transform is overkill. xql is the smallest tool that lets you write one SQL statement, see what it would change, and commit if it is right — against whichever backend matches the data you have in front of you.
The grammar is identical across backends — code written against xql csv runs against xql sp once you point it at a list.
xql belongs to a family of small tools split by what changes. xray observes and changes nothing — it profiles a delimited file's shape, types, and hazards before you touch it. xled edits cell values: sed's s/// and a per-row compute layer, applied over Excel-style ranges, never altering the table's shape. xshape changes the grid's geometry — pivot, unpivot, split, explode, merge. xql queries the row set: filter, aggregate, group, sort, and write back through DML. A join needs a second table and belongs to a SQL engine such as DuckDB, and converting between office formats is this2that's.
The split decides where a job goes. Rewriting the text inside cells by pattern is xled's, even when a WHERE would have picked the same rows. Turning one column into several is xshape's. Anything that answers a question about the rows — how many, which ones, grouped by what — is xql's. When you land in the wrong tool, the error says which one has the capability rather than just refusing; that routing runs in both directions across the family.
They compose over plain CSV, so a job that needs two of them is a pipeline, not a compromise: profile with xray, normalize values with xled, then query the result here.
Every install line below ends with xql --install-skill. That installs the Claude Code skill alongside the binary. Drop it if you do not use Claude Code — the CLI itself does not need it.
Add the Excelano apt repository once (one-time setup):
curl -fsSL https://excelano.com/apt/setup.sh | sudo shThen install it, so apt upgrade keeps it current:
sudo apt install xql && xql --install-skillWith WinGet, so winget upgrade keeps it current:
winget install Excelano.xql
xql --install-skillOr download the windows_amd64 zip from the releases page and unzip it.
From source (go.mod names the Go toolchain it needs):
go install github.com/excelano/xql/cmd/xql@latest && xql --install-skill
Update it the way you installed it: apt upgrade, winget upgrade, or the go install line again.
| Name | Extensions |
|---|---|
csv |
.csv, .tsv |
sp |
(never inferred — URL + auth required) |
xinglet |
(never inferred — xinglet:// URL + Bearer token required; read-only) |
xql --help lists registered backends. xql <backend> --help shows backend-specific flags.
- If
argv[1]matches a registered backend name, route to that backend withargv[2:]. - Otherwise, if
argv[1]has a recognized file extension, route to the matching backend withargv[1:]. - Otherwise, error.
No content sniffing. A missing or unknown extension is a usage error — fall back to the explicit subcommand.
xql csv <path>
xql <path> # equivalent when the extension is .csv or .tsv
Opens a prompt bound to the file. Arrow keys recall history, Ctrl-R searches it, Ctrl-D exits. History persists at ~/.config/xql/history-csv across sessions (one history file per backend).
The REPL accepts SQL statements one per line plus a few meta-commands as plain words (case-insensitive): help or ? shows command help, describe prints the column schema with inferred types (describe all on xql sp includes the SharePoint system columns hidden by default), refresh re-reads the file from disk, and quit or exit leaves the REPL. Output controls follow sqlite shapes (without the leading dot): mode <table|tsv|csv|json> sets how results render to stdout, headers on|off toggles the column-name row, output 'PATH' redirects subsequent SELECT results to PATH as CSV (sticky — type output with no argument to clear), and once 'PATH' redirects only the next statement. Runtime toggles use set <name> on|off; set all-fields on includes hidden SharePoint columns in SELECT *, and bare set lists the current state.
Writes (INSERT, UPDATE, DELETE) preview by default. xql prints the affected count, a sample of the rows that match, and then prompts Apply? [y/N]:. Anything but y cancels. Append ! to skip the prompt and commit immediately:
UPDATE SET Status = 'Done' WHERE Modified < '2024-01-01' !When a write is applied, xql rewrites the bound file. Pass --output FILE at startup (or use the output REPL command) to redirect both committed writes and SELECT results to a different file. --output always serializes CSV regardless of --mode; --mode controls the terminal view only.
xql csv <path> --exec "<sql>"
Runs one statement and exits. Writes need --commit; a bare DELETE (no WHERE clause) additionally needs --confirm-destructive. Output auto-detects to ASCII table on an interactive terminal and TSV when piped. Override with --mode=csv for RFC 4180 CSV, --mode=json (or the shorthand --json) for JSON, or pass --no-output-header to drop the header row in any row-shaped mode.
--describe prints the bound resource's column schema and exits, without entering the REPL and without a SQL statement. On xql sp, combine with --all-fields to include hidden SharePoint columns.
By default, the CSV backend expects a header row, double-quote quoting, and UTF-8. The delimiter comes from the file extension: tab for .tsv, comma for everything else. Override with:
--no-input-header,--no-header— file has no header; columns are namedcol1,col2, ...-d,--delim CHAR— single-character delimiter (use\tfor tab)
A UTF-8 byte-order mark (BOM) at the start of the file — common in Excel's "Save as CSV UTF-8" output — is stripped automatically; the first column name is not prefixed with it. CRLF and LF line endings are both accepted. Fields containing the delimiter, embedded quotes, or embedded newlines work as long as they are properly double-quoted per RFC 4180.
If the file looks like UTF-7 (the +ACI- escape that Scoutbook exports emit) or carries a UTF-16 BOM, xql prints a warning at startup with the iconv command needed to convert it to UTF-8, then proceeds. Detection is done from byte-perfect signatures only — no encoding-guessing heuristic — so a false positive on a real UTF-8 file is vanishingly unlikely.
Parsing uses LazyQuotes = true, which is forgiving about bare quotes mid-field and unbalanced quotes — usually a good thing for messy real-world files, but it can mask data corruption in a CSV that was truncated mid-export. A row count that does not match what you expect is the symptom.
Headers are trimmed of leading and trailing whitespace; the load fails clearly if a header is empty or duplicates another header, since both quietly corrupt schema lookups.
A committed write changes only the rows the statement touches. Every other row is written back as its original text, quoting and line ending included, and the file keeps its BOM, its header line and any trailing blank lines. A row with more fields than the header keeps the extra fields, even when it is updated. Rows a write changes or inserts use the file's line ending.
xql samples the first 1024 rows of a CSV and infers a type per column: int, float, bool, date, or string. Comparisons use the inferred type, so Priority > 2 does numeric compare and Modified < '2024-01-01' does date compare. The describe command shows what was inferred. Override at startup with --type Name=string,Priority=int if inference picks wrong.
The inferred type governs comparison, sorting and arithmetic, not how a cell is written. A cell that no statement assigns is written back as it was read, and displays that way too: 10.10, 1E5 and 00123 keep their text in a committed file, in SELECT output and in --output, while JSON output carries the typed value (10.1). A cell the column's type cannot parse, such as N/A in a float column, reads as NULL in queries and is written back unchanged. Only the cells a SET assigns or an INSERT writes take the canonical form of their type.
Some values keep a column out of a numeric type:
- Leading-zero values stay strings.
"07030","007","-01"look numeric tostrconvbut are almost always identifiers (ZIP codes, employee numbers, phone extensions). Asint,007would equal7and sort among the single digits, so the column infers asstring. Pass--type Code=intto override. NaNandInfare not treated as numeric. Excel's#DIV/0!-as-NaNcells leak throughstrconv.ParseFloat, butNaNbreaks SQL equality (NaN ≠ NaN), so the column falls back tostringwhenever they appear.- Numbers a float cannot hold exactly stay strings. A 20-digit account number would round to the nearest float, and two such IDs could then match the same
WHERE, so the column infers asstring.10.10and1E5are exact and infer asfloat.
xql sp https://contoso.sharepoint.com/sites/team/Lists/Tasks
The SharePoint backend binds to a single list and runs the same SQL grammar against it via Microsoft Graph. Authentication is device-code OAuth: the first run prints a short code and a URL to enter it at, and a refresh token is cached at ~/.config/excelano/sp-token.json so subsequent runs reauthenticate silently. That cache is shared with the xfiles tools, which sign in against the same app registration, so one sign-in covers xql sp and every xfiles command; a cache left by an earlier version at ~/.config/xql/sp-token.json is adopted on first run. The cached token is per-account; it carries Sites.ReadWrite.All delegated permission. xql auth reports the state of that session, with --json for a script, and exits 0 whether or not one exists; it never starts a sign-in, so it is the safe question to ask before unattended work. The sign-in layer itself lives in the graphauth module, which both repositories import.
WHERE means what it means on a CSV file, case-sensitive = and LIKE included. Graph narrows the fetch with the conditions SharePoint can answer, and xql evaluates the full predicate on what comes back; a query whose only conditions SharePoint cannot answer, such as a contains LIKE or a condition on ID, reads the whole list. GRAMMAR.md lists which conditions narrow.
UPDATE, DELETE, and INSERT validate against the list's column schema before any Graph round-trip: unknown columns, type mismatches, a value outside a choice column's options, writes to read-only or system fields, and writes to multi-value person and lookup, hyperlink and calculated columns all fail fast. A person or single-value lookup column is written by the ID it reads as. Writes preview a sample of affected rows and prompt Apply? [y/N]: in the REPL or require --commit in one-shot mode. A bare DELETE (no WHERE) in one-shot mode additionally requires --confirm-destructive. In the REPL, bare DELETE always prompts even with a trailing ! shortcut.
History persists at ~/.config/xql/history-sp. The list URL can be the bare list root or an AllItems.aspx variant; URL-encoded list-name segments are decoded automatically. Pass --all-fields to include system columns in SELECT * and describe. By default xql shows the list's own columns plus ID, Created, Modified, Author and Editor, and leaves out the read-only plumbing SharePoint adds to every list.
xql xinglet xinglet://4babff02-909f-4dba-b3df-3edf14b778bf
The xinglet backend reads a remote xinglist over HTTPS and pipes the CSV body through the same loader and executor as xql csv. Authentication is a single Bearer token; mint one at xinglet.com/home/tokens.php and export it before running:
export XINGLET_TOKEN=xglt_...
xql xinglet xinglet://<uuid>XINGLET_BASE_URL overrides the server host if you self-host xinglet on a different domain (default https://xinglet.com). The token is sent only on the URL named on the command line — xql does not store, log, or persist it.
The backend is read-only: only SELECT is supported. INSERT, UPDATE, and DELETE are rejected with a clear error, since the server exposes no write endpoint over Bearer auth. refresh re-fetches the list and rebuilds the table — useful for catching upstream edits without restarting the REPL. History persists at ~/.config/xql/history-xinglet.
The xinglist export carries inline column type annotations (Count:number, Joined:date, Status:choice(active|inactive)) which the backend translates to xql type hints automatically — queries reference the bare column name (Count, Joined, Status) and comparisons run against the correct type.
xql implements a deliberately small SQL grammar: SELECT and DML with literal values, simple WHERE predicates, aggregates, GROUP BY, HAVING, ORDER BY, LIMIT, OFFSET. GROUP BY accepts expressions, and the scalar functions — LOWER, UPPER, TRIM for string normalization, YEAR, MONTH, DAY for calendar components — are available in projections, predicates, and grouping alike. No JOINs, no subqueries. The same grammar applies across all backends; backend-specific differences (OData translation, identifier resolution, type coercion, read-only mode for xql xinglet) are noted inline. See GRAMMAR.md for the full formal grammar and semantics.
Case-insensitive dedup profiling — the canonical use for the scalar functions — reads like this:
SELECT LOWER(application_name) AS k, COUNT(*) AS n
GROUP BY LOWER(application_name)
HAVING COUNT(*) > 1
ORDER BY n DESCCoStar, Costar, and costar collapse into one row.
The date accessors do the same job on a time axis, turning a date column into something groupable:
SELECT YEAR(hired) AS y, MONTH(hired) AS m, COUNT(*) AS n
GROUP BY YEAR(hired), MONTH(hired)
ORDER BY y, mThey read a date column directly, and a string column whose values are ISO dates. A cell that isn't a date yields NULL for that row rather than failing the query, but a column inferred as int or float is rejected before the scan starts — Excel would answer with a serial number there, and xql has none to give.
Column names are case-insensitive on input — select * where firstname = 'John' resolves against a Firstname header. Output preserves the canonical header case. If a schema carries two columns that differ only in case (ID and id), referencing either form returns an ambiguous-column error rather than guessing.
On the SharePoint backend, columns can be referenced by either their internal name (what Graph uses for $filter and PATCH) or their display name (what the SharePoint UI shows). describe lists both side by side when they differ. CSV imports leave you with internal names like field_5 and display names taken from the CSV header — select vendor and select field_5 resolve to the same column. Use describe all to include SharePoint's system/hidden columns, and set all-fields on to include them in SELECT * at runtime (the launch flag --all-fields does the same).
An official Claude Code skill ships in skills/xql/. The binary installs it:
xql --install-skillThat writes ~/.claude/skills/xql/ and stamps in the skill's revision, which xql -V also prints, so a later run reports whether the skill has fallen behind the binary rather than leaving you to notice. It is safe to re-run: an unchanged skill reports already current and nothing is written. xql --uninstall-skill removes it. Restart Claude Code afterwards, since skills are discovered at session start.
The skill is compiled into the binary, so this works the same however you installed xql — apt, go install, or a build from source.
The skill lets any Claude Code session use xql correctly without hallucinating its SQL subset, splits the SharePoint and local-CSV lanes so the advice to switch to a full SQL engine lands only where one can read the data, and points at xfiles for library files rather than list rows.
xql csv runs locally and makes no network calls; xql sp and xql xinglet call their services over HTTPS. SECURITY.md says what each backend sends, where it caches a token and how that cache is protected, and how to report a vulnerability. If your organization restricts user consent, ADMINS.md has everything your IT department needs to review and approve the SharePoint backend.
MIT. See LICENSE.