Commands
Each page below lists the arguments and options of one command, with their defaults, as the
installed xpd reads them. The site builds these lists from xpd's own command definitions, so
they change when xpd changes. xpd -h and xpd <command> -h print the same flags in a terminal,
and every command takes -h and --help. xpd -V prints the version.
Start with xpd check, which lints Python files and writes fixes.
xpd 0.41.5 has 19 commands, and xpd new has 4 of its own.
| Command | Also called | What it does |
|---|---|---|
xpd test |
Check rule examples and review diagnostic and fix snapshots | |
xpd find |
Find libraries and rules for a task, without importing Python | |
xpd api |
Show a public symbol's parameters as the source writes them, with its summary, members and guarding rules | |
xpd index |
Parse library source into a versioned index. Never imports or runs library code | |
xpd check |
xpd scan |
Lint Python files. Exit 0 when clean, 1 on any issue of the --fail-on severity, which is error by default, 2 if xpd can't run |
xpd hook |
Agent hook: reads an event's JSON on stdin, lints the files an edit changed, and holds a turn that leaves errors or warnings | |
xpd profile |
Profile a data file (csv, parquet, feather, json, xlsx). Needs pandas | |
xpd equiv |
Check that two scripts produce an equal result (DataFrame or Series). Needs pandas |
|
xpd refit |
Refit a saved Pipeline on raw training rows and compare its outputs and scores | |
xpd graph |
Print the dataflow of step code or Hamilton modules: what reads what, and what does not connect | |
xpd run |
xpd query |
Search code by syntax, in any language ast-grep parses, and preview or apply a rewrite |
xpd outline |
Map the files of a project: imports, definitions and their members, with line numbers | |
xpd rules |
List every rule and package check, with its severity, fix and documentation | |
xpd doctor |
Suggest Ruff, ty and pytest settings and pytest plugin changes for this project, each with its file, reason and evidence | |
xpd skill |
Print the agent skill (SKILL.md) for this xpd version | |
xpd mcp |
Start the MCP server | |
xpd lsp |
Start the language server, which an editor runs to show the issues as you type | |
xpd completions |
Generate completion for the installed xpd command tree | |
xpd new |
Create a rule project, or a rule, test case or utility in one | |
xpd new project |
Create sgconfig.yml, xpd.yml and the rules, rule-tests and utils folders | |
xpd new rule |
Create a rule from a pattern, with the Markdown that explains it beside the rule file | |
xpd new test |
Create an empty test case for a rule, with no valid or invalid code yet | |
xpd new util |
Create a global utility rule, which any rule can use with matches: <name> |
The project's Python
Section titled “The project's Python”profile, equiv, refit and index run Python code, and find uses Python once to download
its search model. xpd uses the first of these Pythons that it finds.
- The one in
$VIRTUAL_ENV - The one in the nearest
.venvat or above the current folder python3onPATH
Exit status
Section titled “Exit status”Most commands exit 0 when they succeed and 2 when xpd cannot run, for example because a file
cannot be read. A command that checks something, such as check, graph, run, test,
equiv and refit, exits 1 when the check finds a problem. Each command page has the details.