aggrega edit-document
นำ
รูป
aggrega edit-document <edit> <file> [flags]คำ
Apply one bounded structured edit to a document in the workspace.
The edit is named first and the document second. One call adds one entry under one container, or sets one scalar, and it can do nothing else:
add-component add a component instance under a components container attach-feature attach a Feature to the node you name wire-edge wire a connection inside one of that node's sockets set-value set one value on that node
There is no edit that deletes, replaces a block you already wrote, reorders anything, or writes bytes you supply verbatim. The edits this command applies are add-component, attach-feature, wire-edge, set-value, and a name outside that set is refused rather than interpreted.
Name the node with --node, once per path segment, from the document root. It is a segment at a time rather than one dotted string because a dot is a legal character in a name you type, so a joined path could address a key nobody wrote and the entry would be created there rather than refused:
aggrega edit-document add-component app.yaml \ --node spec --node components --name web --value example/service
aggrega edit-document wire-edge app.yaml \ --node spec --node components --node web \ --socket database --name db --value spec.components.store
For add-component the path names the components container itself, because the entry being added is the node. For the other three it names the node the edit is about, and the container follows from the edit.
--name is the key the entry is written under: the instance name, the attachment's name, the connection's alias, or the value's key. --value is what that entry carries, and what it means follows from the edit — the entity the entry requests, the node a connection points at, or the scalar a value is set to. It is read as a YAML scalar, so --value 3 sets a number, --value true a boolean, and --value '"3"' the string; omitting it sets nothing at all.
Every byte the edit does not touch survives. The document is parsed only to locate the container and the line its block ends at, so comments, blank lines, quoting style, folded and literal scalars and the trailing-newline shape all carry through, and the nesting step is measured from the document's own indentation rather than imposed. The same request against the same document produces the same bytes.
The result has to be a document you could have typed, and that is what the write is gated on: the composed document is checked against its own kind's schema and reaches disk only if that passes. A request that would produce something the schema refuses is refused, naming the property the schema would not admit and where, and the file is left byte-for-byte as it was — so a refused edit is indistinguishable from one never attempted and you can retry a corrected request against the document you started with.
An entry that is already there, carrying what you asked for, is a no-op. An entry of that name carrying something else is refused rather than replaced.
--dry-run does everything the plain command does except write: the edited document goes to standard output as content, naming the file it is for, and nothing is created — for a caller that puts the result in front of someone before it is saved. Every other behaviour is the write's, the schema gate included, so a request the write would refuse is refused under --dry-run too and its exit code predicts the write's. Without it the document is written.
Whether what you wire is semantically admissible is not decided here. Whether a socket is one the producer declares, or whether a Feature's applicability is satisfied, is what aggrega validate answers.แฟล็ก
| แฟล็ก | ค่า | คำ |
|---|---|---|
--dry-run | false | ทำ |
--name | — | คีย์ |
--node | [] | หนึ่ง |
--socket | — | ซ็อกเก็ต |
--value | — | สิ่ง |
สิ่งที่คำสั่งนี้ทำ
aggrega edit-document <edit> <file> นำ
aggrega edit-document add-component storefront.aggregate.yaml \ --node spec --node components \ --name checkout --value core/api-server:1.0.0คำaggrega serve รายงาน
เอกสาร
the document named leads outside the workspace through a link, and an edit is only applied to a document the workspace carries: "shared/storefront.aggregate.yaml"หาก
หนึ่งการเรียก หนึ่งรายการ และชุดนี้ปิด
มี
| การ | สิ่ง |
|---|---|
add-component | อินสแตนซ์ |
attach-feature | การ |
wire-edge | การ |
set-value | หนึ่ง |
ไม่มี
รายการ
storefront.aggregate.yaml already carries that entry; nothing was writtenรายการ
คุณระบุโหนดเป็นเส้นทางทีละส่วน
--node ใส่
aggrega edit-document wire-edge storefront.aggregate.yaml \ --node spec --node components --node web \ --socket database --name replica --value storeใช้add-component อาจ
สำหรับ add-component เส้นfeatures ของuses และvalues ของ
--name คือ--socket อ่านwire-edge และ
ค่ารักษาชนิดที่อักขระของค่านั้นบ่งบอก
--value ถูก
aggrega edit-document set-value storefront.aggregate.yaml \ --node spec --node components --node web --name workers --value 4 values: replicas: 3 workers: 4ดัง--value 4 ตั้ง--value true ตั้ง--value '"4"' ตั้ง4 — เครื่องหมาย--value ไม่
ทุกอย่างที่คุณไม่ได้แก้ไขยังอยู่ครบ และคำขอเดียวกันให้ไบต์เดียวกัน
เอกสาร
เมื่อ
สิ่งที่ได้ต้องเป็นเอกสารที่คุณพิมพ์เองได้
การ
the edit was refused because the resulting document would not be valid, and nothingwas written: document envelope validation failed (Release, at prod.release.yaml);15:7: spec.components.web.values: … unexpected property: "values"ไฟล์
สิ่งaggrega validate โดย
ดูผลก่อนบันทึก
--dry-run ทำ
aggrega edit-document attach-feature storefront.aggregate.yaml \ --node spec --node components --node web \ --name tls --value core/tls:1.0.0 --dry-rundocuments: - path: storefront.aggregate.yaml content: | # The storefront application. ...หาก
พฤติกรรม--dry-run ด้วย โดย
การแก้ไขเดียวกันจากตัวแก้ไขหรือผู้ช่วย
ไบต์aggrega serve เข้าaggrega/editDocument และaggrega mcp เข้า
จุด
ตัวอย่าง
เพิ่ม
aggrega edit-document add-component storefront.aggregate.yaml \ --node spec --node components --name checkout --value core/api-server:1.0.0แนบ Feature กับ
aggrega edit-document attach-feature storefront.aggregate.yaml \ --node spec --node subsystems --node billing --node components --node ledger \ --name audit-log --value core/observability/audit-log:1.0.0ตั้ง
aggrega edit-document set-value storefront.aggregate.yaml \ --node spec --node subsystems --node billing --node components --node ledger \ --name replicas --value 5ทบทวน
aggrega edit-document wire-edge storefront.aggregate.yaml \ --node spec --node components --node web \ --socket cache --name sessions --value redis --dry-runหากaggrega serve