Make crossword puzzles from the command line. Publish them on swords.cx and get a link anyone can solve.
Install · Try it · Commands · Full guide · swords.cx
macOS and Linux:
curl -fsSL https://swords.cx/install.sh | shWindows (PowerShell):
irm https://swords.cx/install.ps1 | iex$ puz show hello-world.json
Hello, World (5x5)
S L A W #
H O N O R
A G G R O
H E L L O
# S O D S
1A SLAW Cabbage side at a cookout
5A HONOR Medal of ___
8A HELLO With 4-Down, a programmer's first words
...- One puzzle, one file. A puzzle is a plain JSON file. Every command reads or changes one file. No account, no server.
- Fill a grid.
puz autofillfills a grid with good words, andpuz checksays whether it can be filled. The word list downloads once, from its own site. - Every common format. Import Across Lite
.puz. Export.puz,.jpz, a PNG, a printable PDF, or a newspaper submission PDF. - Publish in one command.
puz publishputs a finished puzzle on swords.cx and prints a link to solve it in the browser, on any device. - Built for scripts and AI agents. Commands that report results take
--json.
macOS and Linux:
curl -fsSL https://swords.cx/install.sh | shThis puts puz in ~/.local/bin and runs puz setup.
Windows (PowerShell):
irm https://swords.cx/install.ps1 | iexThis puts puz.exe in %LOCALAPPDATA%\Programs\puz, adds that folder to your PATH and runs puz setup.
There are builds for macOS (Apple silicon and Intel), Linux (x64 and arm64) and Windows (x64). puz tells you when a new version is out; puz update installs it. Anything else: build from source.
puz comes with a small puzzle. Publish it and open the link:
$ puz publish hello-world.puz
Saved hello-world.puz here: a small puzzle to try.
✓ Published Hello, World. Anyone with this link can solve it:
https://swords.cx/p/…/puz new "My Puzzle" --size 15x15 # write my-puzzle.json
puz block my-puzzle.json 4,0 # a black square and its symmetric partner
puz place my-puzzle.json 1a ALPS # write an answer
puz clue my-puzzle.json 1a "Swiss peaks"
puz show my-puzzle.json # the grid and every clue
puz stats my-puzzle.json # grid stats and a paper's rules
puz export my-puzzle.json --format pdf # also puz, jpz, png, json
puz import puzzle.puz # a .puz to a puzzle file
puz publish my-puzzle.json # put it on swords.cx and print the link
puz autofill my-puzzle.json --write # fill the rest of the grid
puz check my-puzzle.json # can the grid still be filled?
puz export my-puzzle.json --format nyt # a NYT submission PDF
puz swords list # what you published, with solve statsRun puz --help for every command. The full guide covers the fill commands, the word list, the file format, marks (rebus, circles, colors, walls), endings, stats, export and publishing.
swords.cx is a free place to share crosswords: push a puzzle, get a link.
- No account needed. Your computer keeps a key that owns each puzzle you publish.
- Publish again to update.
puzremembers the link in the puzzle file, so the link stays the same. - Your puzzles on any device. Run
puz swords login EMAILto add them to your account. - Manage them. Add a PIN, see solve stats, or take a puzzle down with
puz swords.
You can also drop a .puz, .jpz or .ipuz file on the swords.cx home page.
You need Rust 1.89 or newer.
git clone https://github.com/brianmuse/puz-cli
cd puz-cli
cargo build --release
./target/release/puz --helpRun the tests with cargo test --release.
This is one Cargo workspace with four packages:
| Folder | Package | What it is |
|---|---|---|
crates/puz |
puz-cli |
The puz command. |
crates/puz-core |
puz-core |
A library: the puzzle file model and everything that works on one file. |
crates/puz-fill |
puz-fill |
A library: the fill engine (checks, fill, autofill, black-square patterns). It also builds for WebAssembly. |
crates/swords |
swords-client |
A library: publish to swords.cx and manage what you published. |
vendor/ingrid_core is a copy of ingrid_core's fill search (MIT), with no word list in it. The fill commands download Spread the Wordlist by Brooke Husic and Enrique Henestroza Anguiano (CC BY-NC-SA 4.0) on first use; it is not part of this repo.
A tag starts the release. GitHub Actions (.github/workflows/release.yml) builds the five programs, writes SHA256SUMS, and makes the GitHub Release. swords.cx serves the newest release within 5 minutes, so the site needs no deploy.
- Set the new version in
Cargo.toml([workspace.package] version, and the matchingpuz-coreandpuz-fillversions incrates/puz/Cargo.toml). Runcargo build --releaseto updateCargo.lock. - Commit:
git commit -am "puz X.Y.Z". - Tag:
git tag vX.Y.Z. The tag must match the version, or the workflow stops. - Push both:
git push origin main vX.Y.Z.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
Unless you say otherwise, any contribution you submit for inclusion in this project, as defined in the Apache-2.0 license, is licensed as above, with no additional terms or conditions.