[{"data":1,"prerenderedAt":1196},["ShallowReactive",2],{"docs-\u002Fdocs\u002Freference\u002Fcli":3},{"id":4,"title":5,"body":6,"description":1188,"extension":1189,"meta":1190,"navigation":1191,"path":1192,"seo":1193,"stem":1194,"__hash__":1195},"docs\u002Fdocs\u002Freference\u002Fcli.md","CLI",{"type":7,"value":8,"toc":1159},"minimark",[9,13,22,32,37,102,167,171,264,269,275,412,418,422,428,431,435,441,451,455,461,464,468,474,514,518,524,557,560,564,568,574,584,588,594,625,635,639,775,779,785,792,796,802,832,836,842,880,884,890,908,912,918,925,929,935,992,996,1002,1064,1072,1076,1082,1089,1093,1099,1105,1109,1115,1148],[10,11,5],"h1",{"id":12},"cli",[14,15,16,17,21],"p",{},"Every command has the same shape, and every verb takes its spec with ",[18,19,20],"code",{},"--config",".",[23,24,30],"pre",{"className":25,"code":27,"language":28,"meta":29},[26],"language-text","sg \u003Cgroup> \u003Cverb> [flags]\nsg help | sg version            # also: sg --help, sg --version\nsg \u003Cgroup> --help               # list a group's verbs\nsg \u003Cgroup> \u003Cverb> --help        # one verb's flags\n","text","",[18,31,27],{"__ignoreMap":29},[33,34,36],"h2",{"id":35},"conventions","Conventions",[38,39,40,64,74,92],"ul",{},[41,42,43,47,48,51,52,55,56,59,60,63],"li",{},[44,45,46],"strong",{},"Confirmation."," Commands that change something print their plan and ask ",[18,49,50],{},"… [y\u002FN]:",". Only an answer starting with ",[18,53,54],{},"y"," or ",[18,57,58],{},"Y"," continues. ",[18,61,62],{},"--yes"," skips the question and nothing else.",[41,65,66,69,70,73],{},[44,67,68],{},"Fresh plans."," Apply commands always build their own plan just before acting. An earlier ",[18,71,72],{},"plan"," output is never reused.",[41,75,76,79,80,83,84,87,88,91],{},[44,77,78],{},"List flags."," ",[18,81,82],{},"--target",", ",[18,85,86],{},"--force-volume-share"," and ",[18,89,90],{},"--confirm-root-data"," can be repeated or take comma-separated values.",[41,93,94,97,98,101],{},[44,95,96],{},"The ledger."," Every command opens the ledger next to its spec: ",[18,99,100],{},"\u003Cspec-dir>\u002F.sg\u002Fstate.db"," by default.",[103,104,105,121],"table",{},[106,107,108],"thead",{},[109,110,111,115,118],"tr",{},[112,113,114],"th",{},"Exit code",[112,116,117],{},"Means",[112,119,120],{},"Output",[122,123,124,138,154],"tbody",{},[109,125,126,132,135],{},[127,128,129],"td",{},[18,130,131],{},"0",[127,133,134],{},"Success, help, a completed read-only report (even one showing drift), or a declined confirmation",[127,136,137],{},"stdout",[109,139,140,145,148],{},[127,141,142],{},[18,143,144],{},"1",[127,146,147],{},"Runtime failure, safety refusal or configuration error",[127,149,150,153],{},[18,151,152],{},"sg \u003Cgroup> \u003Cverb>: \u003Cerror>"," on stderr",[109,155,156,161,164],{},[127,157,158],{},[18,159,160],{},"2",[127,162,163],{},"Usage error: bad or missing flag, unexpected argument, unknown group or verb",[127,165,166],{},"the error plus usage, on stderr",[33,168,170],{"id":169},"sg-machine","sg machine",[103,172,173,183],{},[106,174,175],{},[109,176,177,180],{},[112,178,179],{},"Verb",[112,181,182],{},"Effect",[122,184,185,201,210,223,233,249],{},[109,186,187,192],{},[127,188,189],{},[18,190,191],{},"init",[127,193,194,195,198,199],{},"Local only. Interviews you and writes ",[18,196,197],{},"machine.yaml",", or validates and registers an existing one with ",[18,200,20],{},[109,202,203,207],{},[127,204,205],{},[18,206,72],{},[127,208,209],{},"Read-only. Connects over SSH and prints ordered changes with risk grades",[109,211,212,217],{},[127,213,214],{},[18,215,216],{},"create",[127,218,219,222],{},[44,220,221],{},"Changes the host."," Applies the plan",[109,224,225,230],{},[127,226,227],{},[18,228,229],{},"status",[127,231,232],{},"Read-only. Recorded state, drift, last-applied times. Never repairs",[109,234,235,240],{},[127,236,237],{},[18,238,239],{},"rollback",[127,241,242,244,245,248],{},[44,243,221],{}," Undoes the last run's changes, in reverse, ",[18,246,247],{},"sg","-owned only",[109,250,251,256],{},[127,252,253],{},[18,254,255],{},"destroy",[127,257,258,260,261,263],{},[44,259,221],{}," Tears down every recorded ",[18,262,247],{}," artifact, in reverse",[265,266,268],"h3",{"id":267},"sg-machine-init","sg machine init",[23,270,273],{"className":271,"code":272,"language":28,"meta":29},[26],"sg machine init [--config \u003Cmachine.yaml>] [interview flags]\n",[18,274,272],{"__ignoreMap":29},[103,276,277,290],{},[106,278,279],{},[109,280,281,284,287],{},[112,282,283],{},"Flag",[112,285,286],{},"Default",[112,288,289],{},"Meaning",[122,291,292,303,316,331,350,366,383,397],{},[109,293,294,298,300],{},[127,295,296],{},[18,297,20],{},[127,299],{},[127,301,302],{},"Validate and register an existing spec. No interview",[109,304,305,310,313],{},[127,306,307],{},[18,308,309],{},"--name",[127,311,312],{},"asked",[127,314,315],{},"Machine name",[109,317,318,323,325],{},[127,319,320],{},[18,321,322],{},"--address",[127,324,312],{},[127,326,327,328,330],{},"Host address ",[18,329,247],{}," reaches over SSH",[109,332,333,338,340],{},[127,334,335],{},[18,336,337],{},"--key-path",[127,339,312],{},[127,341,342,343,346,347,349],{},"Controller-local SSH ",[44,344,345],{},"private"," key ",[18,348,247],{}," connects with",[109,351,352,357,359],{},[127,353,354],{},[18,355,356],{},"--deploy-public-key-path",[127,358,312],{},[127,360,361,362,365],{},"Controller-local ",[44,363,364],{},"public"," key installed for the deploy user",[109,367,368,373,375],{},[127,369,370],{},[18,371,372],{},"--distro",[127,374,312],{},[127,376,377,55,380],{},[18,378,379],{},"ubuntu-22.04",[18,381,382],{},"ubuntu-24.04",[109,384,385,390,394],{},[127,386,387],{},[18,388,389],{},"--output",[127,391,392],{},[18,393,197],{},[127,395,396],{},"File to write",[109,398,399,404,409],{},[127,400,401],{},[18,402,403],{},"--force",[127,405,406],{},[18,407,408],{},"false",[127,410,411],{},"Overwrite an existing output file",[14,413,414,415,417],{},"The interview flags can't be combined with ",[18,416,20],{},". Registration never contacts the host or reads key contents.",[265,419,421],{"id":420},"sg-machine-plan","sg machine plan",[23,423,426],{"className":424,"code":425,"language":28,"meta":29},[26],"sg machine plan --config \u003Cmachine.yaml>\n",[18,427,425],{"__ignoreMap":29},[14,429,430],{},"Connects only after local checks pass. Uploads nothing and records no history. Refuses if the Tailscale auth key variable is unset or empty.",[265,432,434],{"id":433},"sg-machine-create","sg machine create",[23,436,439],{"className":437,"code":438,"language":28,"meta":29},[26],"sg machine create --config \u003Cmachine.yaml> [--yes]\n",[18,440,438],{"__ignoreMap":29},[14,442,443,444,87,447,450],{},"All eight changes are executable in this build. ",[18,445,446],{},"storage.zfs",[18,448,449],{},"install.lxd"," hold data and are never removed by rollback.",[265,452,454],{"id":453},"sg-machine-status","sg machine status",[23,456,459],{"className":457,"code":458,"language":28,"meta":29},[26],"sg machine status --config \u003Cmachine.yaml>\n",[18,460,458],{"__ignoreMap":29},[14,462,463],{},"Drift is reported, never repaired. A completed report exits 0.",[265,465,467],{"id":466},"sg-machine-rollback","sg machine rollback",[23,469,472],{"className":470,"code":471,"language":28,"meta":29},[26],"sg machine rollback --config \u003Cmachine.yaml> [--all] [--force] [--yes]\n",[18,473,471],{"__ignoreMap":29},[103,475,476,484],{},[106,477,478],{},[109,479,480,482],{},[112,481,283],{},[112,483,289],{},[122,485,486,496,505],{},[109,487,488,493],{},[127,489,490],{},[18,491,492],{},"--all",[127,494,495],{},"Select every currently applied change, not just the most recent run's",[109,497,498,502],{},[127,499,500],{},[18,501,403],{},[127,503,504],{},"Skip changes named as irreversible. Never bypasses safety or ownership checks",[109,506,507,511],{},[127,508,509],{},[18,510,62],{},[127,512,513],{},"Approve the shown plan without asking",[265,515,517],{"id":516},"sg-machine-destroy","sg machine destroy",[23,519,522],{"className":520,"code":521,"language":28,"meta":29},[26],"sg machine destroy --config \u003Cmachine.yaml> [--with-packages] [--yes]\n",[18,523,521],{"__ignoreMap":29},[103,525,526,534],{},[106,527,528],{},[109,529,530,532],{},[112,531,283],{},[112,533,289],{},[122,535,536,549],{},[109,537,538,543],{},[127,539,540],{},[18,541,542],{},"--with-packages",[127,544,545,546,548],{},"Also remove packages ",[18,547,247],{}," installed. Kept by default",[109,550,551,555],{},[127,552,553],{},[18,554,62],{},[127,556,513],{},[14,558,559],{},"Deletes recorded instances and the pool file. Refuses on a recorded cluster member.",[33,561,563],{"id":562},"sg-cluster","sg cluster",[265,565,567],{"id":566},"sg-cluster-create","sg cluster create",[23,569,572],{"className":570,"code":571,"language":28,"meta":29},[26],"sg cluster create --config \u003Ccluster.yaml> [--yes]\n",[18,573,571],{"__ignoreMap":29},[14,575,576,577,579,580,583],{},"Needs three or more ",[18,578,247],{},"-created members with identical LXD channels; ",[18,581,582],{},"members[0]"," bootstraps. Shows its plan and asks once. Membership grants shared root-level trust.",[265,585,587],{"id":586},"sg-cluster-destroy","sg cluster destroy",[23,589,592],{"className":590,"code":591,"language":28,"meta":29},[26],"sg cluster destroy --config \u003Ccluster.yaml> [--with-machines] [--yes]\n",[18,593,591],{"__ignoreMap":29},[103,595,596,604],{},[106,597,598],{},[109,599,600,602],{},[112,601,283],{},[112,603,289],{},[122,605,606,616],{},[109,607,608,613],{},[127,609,610],{},[18,611,612],{},"--with-machines",[127,614,615],{},"Full machine teardown of every recorded member. Currently the only teardown that completes",[109,617,618,622],{},[127,619,620],{},[18,621,62],{},[127,623,624],{},"Approve the shown plans without asking",[14,626,627,628,630,631,634],{},"Without ",[18,629,612],{}," it refuses with ",[18,632,633],{},"sg:cluster-teardown-unsupported"," on the pinned LXD version.",[33,636,638],{"id":637},"sg-application","sg application",[103,640,641,652],{},[106,642,643],{},[109,644,645,647,649],{},[112,646,179],{},[112,648,182],{},[112,650,651],{},"Generation?",[122,653,654,666,677,693,704,719,734,747,761],{},[109,655,656,660,663],{},[127,657,658],{},[18,659,191],{},[127,661,662],{},"Local only. Validates and registers the spec",[127,664,665],{},"no",[109,667,668,672,675],{},[127,669,670],{},[18,671,72],{},[127,673,674],{},"Read-only. Prints the plan and its hash",[127,676,665],{},[109,678,679,684,690],{},[127,680,681],{},[18,682,683],{},"deploy",[127,685,686,689],{},[44,687,688],{},"Changes the cluster."," Deploys and verifies health and exposure",[127,691,692],{},"yes, on a verified OK finish",[109,694,695,699,702],{},[127,696,697],{},[18,698,229],{},[127,700,701],{},"Read-only. State and health; never repairs",[127,703,665],{},[109,705,706,711,717],{},[127,707,708],{},[18,709,710],{},"restart",[127,712,713,716],{},[44,714,715],{},"Interrupts service."," Restarts instances and verifies health",[127,718,665],{},[109,720,721,726,731],{},[127,722,723],{},[18,724,725],{},"scale",[127,727,728],{},[44,729,730],{},"Edits the spec and the cluster",[127,732,733],{},"yes",[109,735,736,741,745],{},[127,737,738],{},[18,739,740],{},"upgrade",[127,742,743],{},[44,744,730],{},[127,746,733],{},[109,748,749,753,758],{},[127,750,751],{},[18,752,239],{},[127,754,755,757],{},[44,756,688],{}," Redeploys generation N-1",[127,759,760],{},"yes (N+1)",[109,762,763,767,773],{},[127,764,765],{},[18,766,255],{},[127,768,769,772],{},[44,770,771],{},"Deletes"," owned instances and volumes",[127,774,665],{},[265,776,778],{"id":777},"sg-application-init","sg application init",[23,780,783],{"className":781,"code":782,"language":28,"meta":29},[26],"sg application init --config \u003Capplication.yaml>\n",[18,784,782],{"__ignoreMap":29},[14,786,787,788,791],{},"Prints ",[18,789,790],{},"\u003Cfile>: valid (genesis\u002Fv1). registered \u003Capp> on cluster \u003Ccluster>."," Never rewrites the spec or moves an existing binding.",[265,793,795],{"id":794},"sg-application-plan","sg application plan",[23,797,800],{"className":798,"code":799,"language":28,"meta":29},[26],"sg application plan --config \u003Capplication.yaml> [--force-volume-share \u003Cvolume>] [--confirm-root-data \u003Cinstance>]\n",[18,801,799],{"__ignoreMap":29},[103,803,804,812],{},[106,805,806],{},[109,807,808,810],{},[112,809,283],{},[112,811,289],{},[122,813,814,823],{},[109,815,816,820],{},[127,817,818],{},[18,819,86],{},[127,821,822],{},"Volume approved for same-member sharing. Repeatable",[109,824,825,829],{},[127,826,827],{},[18,828,90],{},[127,830,831],{},"Instance acknowledged as carrying service data on its root disk. Affects the preview only",[265,833,835],{"id":834},"sg-application-deploy","sg application deploy",[23,837,840],{"className":838,"code":839,"language":28,"meta":29},[26],"sg application deploy --config \u003Capplication.yaml> [--yes] [--force-volume-share \u003Cvolume>] [--confirm-root-data \u003Cinstance>]\n",[18,841,839],{"__ignoreMap":29},[103,843,844,852],{},[106,845,846],{},[109,847,848,850],{},[112,849,283],{},[112,851,289],{},[122,853,854,863,871],{},[109,855,856,860],{},[127,857,858],{},[18,859,62],{},[127,861,862],{},"Deploy the fresh plan without asking",[109,864,865,869],{},[127,866,867],{},[18,868,86],{},[127,870,822],{},[109,872,873,877],{},[127,874,875],{},[18,876,90],{},[127,878,879],{},"Instance acknowledged as carrying service data on its root disk. Permits only a restart that keeps the root disk",[265,881,883],{"id":882},"sg-application-status","sg application status",[23,885,888],{"className":886,"code":887,"language":28,"meta":29},[26],"sg application status --config \u003Capplication.yaml>\n",[18,889,887],{"__ignoreMap":29},[14,891,892,893,83,896,83,899,83,902,83,905,21],{},"Columns: ",[18,894,895],{},"INSTANCE",[18,897,898],{},"STATE",[18,900,901],{},"HEALTH",[18,903,904],{},"MEMBER",[18,906,907],{},"DRIFT",[265,909,911],{"id":910},"sg-application-restart","sg application restart",[23,913,916],{"className":914,"code":915,"language":28,"meta":29},[26],"sg application restart --config \u003Capplication.yaml> [group|instance] [--yes]\n",[18,917,915],{"__ignoreMap":29},[14,919,920,921,924],{},"At most one selector: a group name, an instance key (",[18,922,923],{},"web-0",") or a full instance name. No selector means every owned instance. A selector that matches nothing refuses.",[265,926,928],{"id":927},"sg-application-scale","sg application scale",[23,930,933],{"className":931,"code":932,"language":28,"meta":29},[26],"sg application scale --config \u003Capplication.yaml> \u003Cgroup> --count \u003Cn> [--target \u003Cinstance=member>] [--dry-run] [--yes]\n",[18,934,932],{"__ignoreMap":29},[103,936,937,945],{},[106,938,939],{},[109,940,941,943],{},[112,942,283],{},[112,944,289],{},[122,946,947,960,973,983],{},[109,948,949,954],{},[127,950,951],{},[18,952,953],{},"--count",[127,955,956,957,959],{},"Desired instance count. Required; ",[18,958,131],{}," is valid; negative is a usage error",[109,961,962,966],{},[127,963,964],{},[18,965,82],{},[127,967,968,969,972],{},"The ",[44,970,971],{},"complete"," resulting placement. Repeat for every resulting instance",[109,974,975,980],{},[127,976,977],{},[18,978,979],{},"--dry-run",[127,981,982],{},"Preview the edited spec and the deploy plan. No writes, no prompt",[109,984,985,989],{},[127,986,987],{},[18,988,62],{},[127,990,991],{},"Commit and deploy without asking",[265,993,995],{"id":994},"sg-application-upgrade","sg application upgrade",[23,997,1000],{"className":998,"code":999,"language":28,"meta":29},[26],"sg application upgrade --config \u003Capplication.yaml> \u003Cgroup> [--image \u003Cimage>] [--service \u003Cname> --version \u003Cversion>] [--dry-run] [--yes]\n",[18,1001,999],{"__ignoreMap":29},[103,1003,1004,1012],{},[106,1005,1006],{},[109,1007,1008,1010],{},[112,1009,283],{},[112,1011,289],{},[122,1013,1014,1024,1034,1047,1056],{},[109,1015,1016,1021],{},[127,1017,1018],{},[18,1019,1020],{},"--image",[127,1022,1023],{},"Replacement image for the group",[109,1025,1026,1031],{},[127,1027,1028],{},[18,1029,1030],{},"--service",[127,1032,1033],{},"The service whose version changes",[109,1035,1036,1041],{},[127,1037,1038],{},[18,1039,1040],{},"--version",[127,1042,1043,1044],{},"The new release. Never ",[18,1045,1046],{},"latest",[109,1048,1049,1053],{},[127,1050,1051],{},[18,1052,979],{},[127,1054,1055],{},"Preview without writes or prompts",[109,1057,1058,1062],{},[127,1059,1060],{},[18,1061,62],{},[127,1063,991],{},[14,1065,1066,1067,55,1069,1071],{},"At least one of ",[18,1068,1020],{},[18,1070,1040],{}," is required.",[265,1073,1075],{"id":1074},"sg-application-rollback","sg application rollback",[23,1077,1080],{"className":1078,"code":1079,"language":28,"meta":29},[26],"sg application rollback --config \u003Capplication.yaml> [--yes]\n",[18,1081,1079],{"__ignoreMap":29},[14,1083,1084,1085,1088],{},"Redeploys generation N-1's recorded spec as generation N+1. Refuses with ",[18,1086,1087],{},"sg:rollback-unavailable"," when there's no valid N-1.",[265,1090,1092],{"id":1091},"sg-application-destroy","sg application destroy",[23,1094,1097],{"className":1095,"code":1096,"language":28,"meta":29},[26],"sg application destroy --config \u003Capplication.yaml> [--yes] [--force-volume-share \u003Cvolume>]\n",[18,1098,1096],{"__ignoreMap":29},[14,1100,1101,1102,21],{},"Removes owned instances and their volumes. Unowned artifacts print as ",[18,1103,1104],{},"retained: \u003Ckind> \u003Cname> is not owned by sg",[33,1106,1108],{"id":1107},"sg-panel","sg panel",[23,1110,1113],{"className":1111,"code":1112,"language":28,"meta":29},[26],"sg panel [--listen \u003Caddr:port>]\n",[18,1114,1112],{"__ignoreMap":29},[103,1116,1117,1127],{},[106,1118,1119],{},[109,1120,1121,1123,1125],{},[112,1122,283],{},[112,1124,286],{},[112,1126,289],{},[122,1128,1129],{},[109,1130,1131,1136,1141],{},[127,1132,1133],{},[18,1134,1135],{},"--listen",[127,1137,1138],{},[18,1139,1140],{},"127.0.0.1:7070",[127,1142,1143,1144,1147],{},"Loopback, or ",[18,1145,1146],{},"tailnet:\u003Cport>"," for this host's verified tailnet address",[14,1149,1150,1153,1154,21],{},[18,1151,1152],{},"panel"," is a single verb, not a group. Extra arguments are a usage error. See ",[1155,1156,1158],"a",{"href":1157},"\u002Fdocs\u002Fpanel","The admin panel",{"title":29,"searchDepth":1160,"depth":1160,"links":1161},2,[1162,1163,1172,1176,1187],{"id":35,"depth":1160,"text":36},{"id":169,"depth":1160,"text":170,"children":1164},[1165,1167,1168,1169,1170,1171],{"id":267,"depth":1166,"text":268},3,{"id":420,"depth":1166,"text":421},{"id":433,"depth":1166,"text":434},{"id":453,"depth":1166,"text":454},{"id":466,"depth":1166,"text":467},{"id":516,"depth":1166,"text":517},{"id":562,"depth":1160,"text":563,"children":1173},[1174,1175],{"id":566,"depth":1166,"text":567},{"id":586,"depth":1166,"text":587},{"id":637,"depth":1160,"text":638,"children":1177},[1178,1179,1180,1181,1182,1183,1184,1185,1186],{"id":777,"depth":1166,"text":778},{"id":794,"depth":1166,"text":795},{"id":834,"depth":1166,"text":835},{"id":882,"depth":1166,"text":883},{"id":910,"depth":1166,"text":911},{"id":927,"depth":1166,"text":928},{"id":994,"depth":1166,"text":995},{"id":1074,"depth":1166,"text":1075},{"id":1091,"depth":1166,"text":1092},{"id":1107,"depth":1160,"text":1108},"Every sg command and flag, the conventions they share, and their exit codes.","md",{},true,"\u002Fdocs\u002Freference\u002Fcli",{"title":5,"description":1188},"docs\u002Freference\u002Fcli","VdZYe-NoFHoX0TtjXy11y6Z1iQm4KabYZ7x7Xf0kddM",1796464240886]