본문으로 건너뛰기

파일 · 명령 참조

qzx readFile

기능

파일 내용을 읽고 표시합니다.

명령 성숙도: Alpha

실제 사용과 피드백에 사용할 수 있지만 인터페이스와 동작은 아직 바뀔 수 있습니다. 현재 개발 체크아웃에 대한 평가입니다. 이후의 각 불변 릴리스 태그는 해당 버전에 포함된 정확한 평가를 보존합니다. PyPI 0.2.2.0.15에서 사용할 수 있습니다. 문서는 alpha 체크아웃 0.2.2.0.15에 해당합니다.

동작 및 내장 보호

상태를 변경하지 않고 검사합니다

이 작업은 직접 실행됩니다

네이티브 프로그램을 호출하지 않고 작동합니다

네트워크를 사용하지 않고 작동합니다

권한 상승 없이 작동하도록 설계되었습니다

이 안전 분류는 2026-10-08에 Claude Opus 5.5 (Anthropic)가 구현 다이제스트 sha256:b747b8875f49807a91ee577a8604addb5c6fcdd6720c4f89271eddc9fae5fdff를 기준으로 검토했습니다.

정확한 구문

qzx readFile <file_path> [max_lines] [max_bytes] [offset] [encoding] [expected_fingerprint] --json

매개변수

밀거나 가로 스크롤 막대를 사용해 모든 열을 확인하세요.

이름유형필수기본값설명
file_pathstr예선언되지 않음읽을 텍스트 파일 경로
max_linesint아니요선언되지 않음페이지당 최대 줄 수입니다. 생략하면 max_bytes 범위 안에서 줄 수를 제한하지 않습니다. 0이면 내용을 읽지 않습니다.
max_bytesint아니요65536페이지당 원본 바이트 수입니다(1~16777216, 기본값 65536). 인코딩 감지를 위해 4바이트를 추가로 읽습니다. 불완전한 문자는 다음 페이지에 남겨 둡니다.
offsetint아니요00부터 시작하는 원본 바이트 위치입니다. 텍스트 중복이나 손실을 피하려면 반환된 next_read 값을 그대로 사용해 계속 읽으세요.
encodingstr아니요"auto"auto는 Unicode BOM을 감지하며, BOM이 없으면 UTF-8을 요구합니다. UTF-8/16/32, ASCII, Latin-1, CP1252, CP437, CP850을 명시할 수 있으며 엄격하게 디코딩합니다.
expected_fingerprintstr아니요선언되지 않음next_read에서 가져오는 선택적 stat 메타데이터 지문 토큰입니다. 페이지 사이의 일반적인 파일 변경을 거부합니다. 내용 해시나 변경 불가능한 스냅샷은 아닙니다.

입력 예제

qzx readFile myfile.txt

Unicode와 원래 줄바꿈을 유지하며 최대 64 KiB의 텍스트 읽기

qzx readFile myfile.txt 10 --json

바이트 한도 안에서 처음 10줄을 읽고 next_read 확인하기

qzx readFile "path with spaces/myfile.txt"

경로에 공백이 포함된 파일 읽기

qzx readFile application.log --max-bytes 4096 --offset 0 --json

크기를 제한하여 로그 읽기를 시작하고 반환된 next_read 값으로 계속하기

qzx readFile legacy.txt --encoding cp1252 --json

Windows-1252로 알려진 파일을 악센트 문자를 대체하지 않고 읽기

전체 구조화 페이로드를 받으려면 --json을 추가하세요: qzx readFile <file_path> [max_lines] [max_bytes] [offset] [encoding] [expected_fingerprint] --json

대표 출력 예제

이 예시 JSON은 현재 구현이 뒷받침하는 결과 계약에서 파생됩니다. 기록된 실행이라고 주장하지 않고 명령이 반환할 수 있는 내용을 보여 주며, 값은 입력, 장비, 권한 및 선택 도구에 따라 달라집니다.

예제 명령: qzx readFile myfile.txt --json

{
    "success": true,
    "message": "Reads and displays the content of a file. In this illustrative example, the command completed successfully.",
    "meta": {
        "command": "readFile",
        "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": 0,
        "schema_version": 1
    },
    "content": "Example file contents.\nSecond line.",
    "details": {
        "summary": "Additional structured context is included here."
    }
}
JSON 결과 계약 보기
{
    "type": "object",
    "properties": {
        "success": {
            "type": "boolean"
        },
        "message": {
            "type": "string"
        },
        "content": {
            "type": "string"
        },
        "details": {
            "type": "object"
        },
        "error_code": {
            "type": "string"
        },
        "error": {
            "type": "string"
        },
        "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
        }
    },
    "required": [
        "message",
        "meta",
        "success"
    ],
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": true
}

오류 및 제한

공개 계약은 실패 시 success=false와 설명적인 message를 요구합니다. 이 카탈로그는 아직 명령별 오류 분류 체계를 선언하지 않으므로 결과를 확인하고 존재하지 않는 코드를 추정하지 마세요.

QZX는 alpha 단계입니다. 선택적 종속성, 권한 및 호스트 기능에 따라 결과가 달라질 수 있습니다.

근거 흐름: 결정론적 자동 캡처 준비 완료.

근거 및 출처

테스트
같은 모듈 이름의 전용 테스트 파일을 찾지 못했지만 테스트 커버리지가 전혀 없다는 뜻은 아닙니다.
문서 채널
개발 문서 0.2.2.0.15 · main · sha256:b91acee86268edb7cb018a94e089ff8e95835eda3f2cf08b39796c0ab9654693
제공 여부
0.2.2.0.15 또는 이전

계속 살펴보기

이 명령들도 파일 범주에 속합니다. 비교하여 작업에 가장 적합한 작업을 선택하세요.

모든 QZX 명령 살펴보기