Metadata-Version: 2.4
Name: devsnap
Version: 0.1.1
Summary: Snapshot and diff your development environment — end 'works on my machine' debugging.
Author: gptfei
License: MIT
Project-URL: Homepage, https://github.com/gptfei/devsnap
Project-URL: Repository, https://github.com/gptfei/devsnap
Project-URL: Issues, https://github.com/gptfei/devsnap/issues
Keywords: environment,snapshot,diff,debugging,devtools,cli
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Debuggers
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# devsnap

**Snapshot and diff your development environment — end "works on my machine" debugging.**

`devsnap` is a zero-dependency Python CLI that captures your OS, Python,
tool versions (git, node, docker, go, rust, ...), installed packages and
selected environment variables into one shareable JSON snapshot. Secrets
are masked automatically, so a snapshot is safe to paste into a bug report.
Diff two snapshots and see exactly what differs between two machines.

## Install

```bash
pip install devsnap        # once published to PyPI
# or from source:
pip install git+https://github.com/gptfei/devsnap
```

Requires Python 3.9+. No third-party dependencies.

## Usage

```bash
# Take a snapshot on machine A
devsnap snap -o machine-a.json

# Take one on machine B, then compare
devsnap snap -o machine-b.json
devsnap diff machine-a.json machine-b.json
```

Example diff output:

```text
[python]
  ~ version: 3.11.4 -> 3.12.3

[tools]
  ~ git: git version 2.40.1 -> git version 2.43.0
  + docker = Docker version 25.0.3
```

`devsnap diff` exits with code 1 when environments differ, so CI can gate
on environment drift. Run `devsnap snap` without `-o` to print a readable
report instead of JSON.

As a library:

```python
from devsnap import collect_snapshot, diff_snapshots

mine = collect_snapshot()
print(mine.to_json())
```

## Why

"It works on my machine" bugs burn hours because the difference between
two environments is invisible. Existing answers are heavy (full system
inventory tools) or manual (copying `pip freeze` output around). devsnap
is the small middle ground: one command, one file, one diff.

## Contributing

Contributions are welcome — and designed to be easy:

- **Add a tool** to `collectors/tools.py` (one line, alphabetical).
- **Add a collector** for a stack we miss (Java, .NET, PHP, databases...).
  Copy any collector in `src/devsnap/collectors/`, see `base.py`.
- **Report** a machine where a snapshot comes out wrong.

Read [CONTRIBUTING.md](CONTRIBUTING.md), and look for issues labelled
`good first issue`.

## 中文简介

`devsnap` 是一个零依赖的 Python 命令行工具：一键把操作系统、Python、
常用工具版本、已装包和（自动打码后的）环境变量拍成一份 JSON 快照，
可以安全地贴进 issue 里。两份快照一 diff，“在我机器上能跑”的差异
立刻现形。

## License

MIT — see [LICENSE](LICENSE).
