Skip to main content

anix-snap

Beautiful code screenshots right from your terminal. Part of the ANIX family.

🇬🇧 English · 🇷🇺 Русский

demo

Install

Python 3.9+.

pip install -e .          # from this folder
pip install -e ".[png]"   # + PNG via cairosvg

PNG also works with resvg in PATH (easier on Windows than cairo).

Usage

Just words, in any order. The image is saved next to you and copied to the clipboard.

asnap api.py                 # whole file
asnap api.py 10-40           # lines 10-40 (api.py:10-40 works too)
asnap api.py 10-40 neon      # theme: peach, noir, neon or your own
asnap api.py +12 +15-17      # mark lines
asnap api.py png             # format: png or svg (picked automatically)
asnap diff                   # current git diff
asnap diff api.py staged     # one file, staged changes
asnap diff HEAD~1            # compare with a commit
cat x.rs | asnap - rust      # stdin, language as a word
asnap themes                 # list themes
asnap                        # cheat sheet

Rarely needed: -o FILE, --title TEXT, --no-lines, --no-copy, -w N, --scale N, --cdn-font, --ui ru|en.

Rules. Keywords (diff, themes, theme names, png/svg, staged) always win over files, so a themes/ folder in your project does not break anything. For a file with such a name write ./diff. In diff mode git itself decides whether a word is a branch/commit or a file (deleted files too); if it is both, asnap asks you to write ./main. Lines start at 1, 40-10 is read as 10-40.

PNG on Windows: install resvg (GitHub Releases or cargo install resvg) and add it to PATH. cairosvg needs a separate cairo library there.

By default PNG is made when cairosvg or resvg is available, otherwise SVG. Fira Code is embedded into the SVG (downloaded once, then cached).

Own themes

Put a .json into %APPDATA%\anix-snap\themes\ (Windows) or ~/.config/anix-snap/themes/ and use it by name: asnap api.py mytheme. Missing keys are taken from peach. See themes/example.json.

Keys: bg, fg, kw, fn, str, num, comment, op, builtin, add, rm.

ANIX Code

Copy extras/anixcode/snap.md into .anixcode/commands/ and use /snap api.py 10-40 neon.

Development

pip install -e ".[dev]"
pytest -q

MIT · an1zy

Metadata

Release files for anix-snap 0.3.3

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

Source distribution (sdist)

Source distribution for anix-snap 0.3.3
File Size Uploaded Provenance Actions
anix_snap-0.3.3.tar.gz 15.8 kB Without provenance Details for anix_snap-0.3.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anix-snap 0.3.3
File Interpreter ABI Platform Actions
anix_snap-0.3.3-py3-none-any.whl Python 3 none any Details for anix_snap-0.3.3-py3-none-any.whl

Total release size: 29.5 kB

Release files / anix_snap-0.3.3.tar.gz

Download URL anix_snap-0.3.3.tar.gz
Size 15.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d2e9677ad445177c362a0d3297b60950265347d707a34ee9bf0c9bec3eb4b1a9
BLAKE2b-256 checksum
How to use checksums
0d4c028839f1c7b67d9903374974f31b21daaaa6887d079fa925ec3ccd0bb016
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / anix_snap-0.3.3-py3-none-any.whl

Download URL anix_snap-0.3.3-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
083583976b778d74bce37ab7438ca8ab85c7ec701a159ad883d5c2cbfb1c1333
BLAKE2b-256 checksum
How to use checksums
360c31ded9d8588579691ff61b66a6fc44a58cbb0f41e049fb4591cc5abf3244
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Security for anix-snap 0.3.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.3 This release

2 release files No provenance

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