pengembangan · Referensi perintah
qzx compareFiles
Apa fungsinya
Membandingkan file teks baris demi baris dan file biner menggunakan byte persis serta SHA-256.
Kematangan perintah: Alpha
Tersedia untuk penggunaan nyata dan umpan balik sementara antarmuka serta perilakunya masih dapat berkembang. Ini adalah evaluasi saat ini untuk checkout pengembangan. Setiap tag rilis immutable di masa mendatang akan mempertahankan evaluasi persis yang disertakan dalam versi tersebut. Tersedia di PyPI 0.2.2.0.9. Dokumentasi ini sesuai dengan checkout alpha 0.2.2.0.9.
Perilaku dan perlindungan bawaan
Memeriksa tanpa mengubah status
Eksekusi langsung untuk operasi ini
Berfungsi tanpa memanggil program native
Berfungsi tanpa menggunakan jaringan
Dirancang untuk bekerja tanpa elevasi hak akses
Klasifikasi keamanan ini ditinjau oleh OpenAI GPT-5.6 Pro terhadap digest implementasi sha256:14fc4e563390c03c8b4fc17e1efdc444e275ec2e8f03986ccaf5153e2e407d2e pada 2026-08-25.
Sintaks persis
qzx compareFiles <file1> <file2> [mode] [max_bytes] --jsonParameter
Geser atau gunakan bilah horizontal untuk melihat semua kolom.
| Nama | Tipe | Wajib | Default | Deskripsi |
|---|---|---|---|---|
| file1 | str | Ya | Tidak dideklarasikan | Jalur file pertama |
| file2 | str | Ya | Tidak dideklarasikan | Jalur file kedua |
| mode | str | Tidak | "full" | Mode perbandingan: "full" (lengkap), "summary" (ringkasan), atau "percent" (persentase) |
| max_bytes | int | Tidak | 1048576 | Ukuran maksimum yang diizinkan untuk setiap file dalam byte (default 1 MiB) |
Contoh input
qzx compareFiles "file1.py" "file2.py"Bandingkan dua file Python dan tampilkan semua perbedaan
qzx compareFiles "file1.txt" "file2.txt" "summary"Tampilkan ringkasan perbedaan antara dua file teks
qzx compareFiles "version1.js" "version2.js" "percent"Tampilkan persentase kemiripan antara dua file JavaScript
qzx compareFiles "image-a.png" "image-b.png"Periksa apakah dua file biner benar-benar identik menggunakan byte dan SHA-256
Untuk mendapatkan payload terstruktur lengkap, tambahkan --json: qzx compareFiles <file1> <file2> [mode] [max_bytes] --json
Contoh output yang diamati
Ditangkap dengan QZX 0.2.2.0.9 di Windows 11; kode keluar 0. Nilai yang bergantung pada host dan durasi dapat bervariasi.
Perintah contoh: qzx compareFiles ../artifacts/qzx-evidence/compare-files/before.txt ../artifacts/qzx-evidence/compare-files/after.txt full --json
{
"success": true,
"file1": "../artifacts/qzx-evidence/compare-files/before.txt",
"file2": "../artifacts/qzx-evidence/compare-files/after.txt",
"identical": false,
"added_lines": 1,
"removed_lines": 1,
"total_changes": 2,
"diff": "Differences between '../artifacts/qzx-evidence/compare-files/before.txt' and '../artifacts/qzx-evidence/compare-files/after.txt':\n--- ../artifacts/qzx-evidence/compare-files/before.txt\n+++ ../artifacts/qzx-evidence/compare-files/after.txt\n@@ -1,2 +1,2 @@\n shared line\n-before\n+after\n\nStatistics:\n- Added lines: 1\n- Removed lines: 1\n- Total changes: 2",
"message": "Compared '../artifacts/qzx-evidence/compare-files/before.txt' with '../artifacts/qzx-evidence/compare-files/after.txt': 1 added and 1 removed lines.",
"content_type": "text",
"comparison_basis": "decoded_text_lines",
"byte_identical": false,
"bytes_file1": 21,
"bytes_file2": 20,
"encoding_file1": "utf-8",
"encoding_file2": "utf-8",
"encoding_confidence_file1": 1,
"encoding_confidence_file2": 1,
"sha256_file1": "66b132726d57d857c416bf212c2ac4758f8088ffd9144b01fca3f412dd0e163a",
"sha256_file2": "245ea69b327e3ad2ea5f90573f1a6357e076642171ad33720bd183fd7aed18f9",
"similarity_available": true,
"mode": "full",
"max_bytes": 1048576,
"meta": {
"command": "compareFiles",
"command_maturity": {
"stage": "alpha",
"label": "Alpha",
"sequence": 2,
"public_executable": true,
"stability": "interface_may_change",
"summary": "Available for real use and feedback while its interface and behavior can still evolve.",
"promotion_review_required": false,
"assessment_scope": "development_checkout"
},
"duration_ms": 6.208,
"schema_version": 1
}
}Lihat kontrak hasil JSON
{
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"message": {
"type": "string"
},
"error": {
"type": "string"
},
"error_code": {
"type": "string"
},
"remediation": {
"type": "string"
},
"file1": {
"type": "string"
},
"file2": {
"type": "string"
},
"mode": {
"type": "string",
"enum": [
"full",
"summary",
"percent"
]
},
"identical": {
"type": "boolean"
},
"added_lines": {
"type": "integer"
},
"removed_lines": {
"type": "integer"
},
"total_changes": {
"type": "integer"
},
"diff": {
"type": "string"
},
"similarity": {
"type": "number"
},
"lines_file1": {
"type": "integer"
},
"lines_file2": {
"type": "integer"
},
"identical_lines": {
"type": "integer"
},
"changes": {
"type": "integer"
},
"summary": {
"type": "string"
},
"content_type": {
"type": "string",
"enum": [
"text",
"binary"
]
},
"comparison_basis": {
"type": "string"
},
"byte_identical": {
"type": "boolean"
},
"bytes_file1": {
"type": "integer"
},
"bytes_file2": {
"type": "integer"
},
"max_bytes": {
"type": "integer"
},
"encoding_file1": {
"type": [
"string",
"null"
]
},
"encoding_file2": {
"type": [
"string",
"null"
]
},
"encoding_confidence_file1": {
"type": [
"number",
"null"
]
},
"encoding_confidence_file2": {
"type": [
"number",
"null"
]
},
"sha256_file1": {
"type": "string"
},
"sha256_file2": {
"type": "string"
},
"similarity_available": {
"type": "boolean"
},
"meta": {
"type": "object",
"required": [
"command",
"command_maturity",
"duration_ms",
"schema_version"
],
"properties": {
"command": {
"type": "string"
},
"command_maturity": {
"type": "object",
"required": [
"stage",
"label",
"sequence",
"public_executable",
"stability",
"summary",
"promotion_review_required",
"assessment_scope"
],
"properties": {
"stage": {
"type": "string"
},
"label": {
"type": "string"
},
"sequence": {
"type": "integer"
},
"public_executable": {
"type": "boolean"
},
"stability": {
"type": "string"
},
"summary": {
"type": "string"
},
"promotion_review_required": {
"type": "boolean"
},
"assessment_scope": {
"type": "string"
},
"note": {
"type": "string"
},
"review": {
"type": "object",
"required": [
"reviewed_on",
"rationale",
"evidence"
],
"properties": {
"reviewed_on": {
"type": "string",
"format": "date"
},
"rationale": {
"type": "string"
},
"evidence": {
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
},
"replacement": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": true
},
"duration_ms": {
"type": "number"
},
"schema_version": {
"type": "integer"
}
},
"additionalProperties": true
}
},
"additionalProperties": true,
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"message",
"meta",
"success"
]
}Kesalahan dan batasan
Kontrak publik mensyaratkan success=false dan message yang deskriptif saat gagal. Katalog ini belum mendeklarasikan taksonomi kesalahan khusus untuk setiap perintah; periksa hasil dan jangan menyimpulkan kode yang tidak ada.
QZX masih dalam tahap alpha. Dependency opsional, izin, dan kemampuan host dapat mengubah hasil.
Alur bukti: ditangkap dan divalidasi dengan digest.
Bukti dan asal-usul
- Implementasi
- src/qzx/commands/development/compare_files.py
- Kanal dokumentasi
- Dokumentasi pengembangan 0.2.2.0.9 · main · sha256:cfba936e39931c286ca23add0ae546693db17d8b316e7cbc3891d26642d9b7e8
- Ketersediaan
- 0.2.2.0.9 atau lebih lama
Lanjut jelajahi
Perintah terkait
Perintah ini juga termasuk kategori pengembangan. Bandingkan untuk memilih operasi yang paling sesuai bagi tugas Anda.
qzx cleanDevelopmentArtifactsMencari cache, dependency terpasang, dan artefak build yang dihasilkan; secara default hanya menampilkan pratinjau.qzx deployProjectMempratinjau atau men-deploy artefak eksplisit melalui SSH dengan cadangan remote terverifikasi, validasi SHA-256, promosi atomik, pemeriksaan kesehatan, dan rollback otomatis.qzx auditRepositoryMenjalankan audit keamanan dan kualitas pada repositori Git: rahasia, file besar, duplikat, kepatuhan .gitignore, dan lisensi.qzx diagnoseProjectMemeriksa teknologi, dependency, alur validasi, status Git, kualitas kode, dan file besar tanpa menjalankan skrip proyek.