[{"data":1,"prerenderedAt":963},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fmain\u002Fcli":3},{"id":4,"title":5,"body":6,"description":951,"extension":952,"group":953,"meta":954,"navigation":955,"order":956,"path":957,"section":499,"seo":958,"source":959,"stem":960,"version":961,"__hash__":962},"docs\u002Fdocs\u002Fmain\u002Fcli.md","CLI reference",{"type":7,"value":8,"toc":936},"minimark",[9,14,45,49,103,113,126,130,223,309,318,322,389,411,415,487,505,509,563,573,577,613,628,632,657,667,671,678,689,693,708,716,720,732,736,778,788,792,903,929,932],[10,11,13],"h2",{"id":12},"install-and-create-a-project","Install and create a project",[15,16,17,18,23,24,28,29,32,33,36,37,40,41,44],"p",{},"Follow ",[19,20,22],"a",{"href":21},"\u002Fdocs\u002Fmain\u002Finstallation\u002F","installation"," for the pinned CLI. Run ",[25,26,27],"code",{},"gonex new shop --module example.com\u002Facme\u002Fshop",", then ",[25,30,31],{},"cd shop"," and ",[25,34,35],{},"go mod tidy",". Continue with ",[25,38,39],{},"go tool gonex"," inside the generated application. The command forms below use the executable name; prefix it with ",[25,42,43],{},"go tool"," in your project.",[10,46,48],{"id":47},"project-creation","Project creation",[50,51,56],"pre",{"className":52,"code":53,"language":54,"meta":55,"style":55},"language-sh shiki shiki-themes light-plus light-plus dark-plus","gonex new NAME --module IMPORT_PATH [--framework-version VERSION] [--arch monolith|microservices] [--dry-run]\n","sh","",[25,57,58],{"__ignoreMap":55},[59,60,63,67,71,74,78,81,85,88,91,94,97,100],"span",{"class":61,"line":62},"line",1,[59,64,66],{"class":65},"swoLU","gonex",[59,68,70],{"class":69},"sFD8J"," new",[59,72,73],{"class":69}," NAME",[59,75,77],{"class":76},"stxUP"," --module",[59,79,80],{"class":69}," IMPORT_PATH",[59,82,84],{"class":83},"s_Yst"," [--framework-version ",[59,86,87],{"class":69},"VERSION]",[59,89,90],{"class":83}," [--arch ",[59,92,93],{"class":69},"monolith",[59,95,96],{"class":83},"|",[59,98,99],{"class":65},"microservices]",[59,101,102],{"class":83}," [--dry-run]\n",[15,104,105,106,108,109,112],{},"The architecture defaults to ",[25,107,93],{},". The framework version defaults to the installed CLI’s resolved module version, including Go pseudo-versions. A CLI built locally must receive an explicit valid ",[25,110,111],{},"--framework-version",". The destination must not exist.",[15,114,115,116,119,120,122,123,125],{},"Install with ",[25,117,118],{},"go install github.com\u002Famkargar\u002Fgonex\u002Fcmd\u002Fgonex@3ca54b46cb42"," for this snapshot, or pin a reviewed commit\u002Fpublished tag. Generated apps include a tool directive: inside the app use ",[25,121,39],{}," for the commands below. Microservices workspaces also have a root tool module; run ",[25,124,35],{}," there after creation.",[10,127,129],{"id":128},"modules-and-services","Modules and services",[50,131,133],{"className":52,"code":132,"language":54,"meta":55,"style":55},"gonex create module NAME [--transport http|none|grpc|http,grpc] [--http-version vN] [--db] [--service NAME] [--dry-run]\ngonex create service NAME [--dry-run]\ngonex create client PROVIDER --service CONSUMER --module MODULE [--version v1] [--dry-run]\n",[25,134,135,177,191],{"__ignoreMap":55},[59,136,137,139,142,145,147,150,153,155,158,160,163,165,168,171,174],{"class":61,"line":62},[59,138,66],{"class":65},[59,140,141],{"class":69}," create",[59,143,144],{"class":69}," module",[59,146,73],{"class":69},[59,148,149],{"class":83}," [--transport ",[59,151,152],{"class":69},"http",[59,154,96],{"class":83},[59,156,157],{"class":65},"none",[59,159,96],{"class":83},[59,161,162],{"class":65},"grpc",[59,164,96],{"class":83},[59,166,167],{"class":65},"http,grpc]",[59,169,170],{"class":83}," [--http-version ",[59,172,173],{"class":69},"vN]",[59,175,176],{"class":83}," [--db] [--service NAME] [--dry-run]\n",[59,178,180,182,184,187,189],{"class":61,"line":179},2,[59,181,66],{"class":65},[59,183,141],{"class":69},[59,185,186],{"class":69}," service",[59,188,73],{"class":69},[59,190,102],{"class":83},[59,192,194,196,198,201,204,207,210,212,215,218,221],{"class":61,"line":193},3,[59,195,66],{"class":65},[59,197,141],{"class":69},[59,199,200],{"class":69}," client",[59,202,203],{"class":69}," PROVIDER",[59,205,206],{"class":76}," --service",[59,208,209],{"class":69}," CONSUMER",[59,211,77],{"class":76},[59,213,214],{"class":69}," MODULE",[59,216,217],{"class":83}," [--version ",[59,219,220],{"class":69},"v1]",[59,222,102],{"class":83},[224,225,226,239],"table",{},[227,228,229],"thead",{},[230,231,232,236],"tr",{},[233,234,235],"th",{},"Option",[233,237,238],{},"Behavior",[240,241,242,259,269,279,289,299],"tbody",{},[230,243,244,250],{},[245,246,247],"td",{},[25,248,249],{},"--transport",[245,251,252,253,255,256,258],{},"Defaults to ",[25,254,152],{},"; ",[25,257,157],{}," creates only the business core",[230,260,261,266],{},[245,262,263],{},[25,264,265],{},"--http-version",[245,267,268],{},"Starts an HTTP module directly in a version package, without legacy routes",[230,270,271,276],{},[245,272,273],{},[25,274,275],{},"--db",[245,277,278],{},"Adds a store interface, GORM adapter, model and explicit migration",[230,280,281,286],{},[245,282,283],{},[25,284,285],{},"--service",[245,287,288],{},"Selects the owning service in a microservices workspace",[230,290,291,296],{},[245,292,293],{},[25,294,295],{},"--version",[245,297,298],{},"Selects the provider's Protobuf API major for a client skeleton",[230,300,301,306],{},[245,302,303],{},[25,304,305],{},"--dry-run",[245,307,308],{},"Validates and prints the proposed plan without changing project files",[15,310,311,314,315,317],{},[25,312,313],{},"create service"," requires a microservices workspace. A client skeleton uses real generated service constructors but leaves domain mapping and injection to the developer. Run ",[25,316,35],{}," in each affected module after adding dependencies.",[10,319,321],{"id":320},"adapter-changes","Adapter changes",[50,323,325],{"className":52,"code":324,"language":54,"meta":55,"style":55},"gonex module version NAME --http vN [--policy preserve|replace] [--prefix PATH] [--service NAME] [--dry-run]\ngonex module enable NAME --grpc [--service NAME] [--dry-run]\n",[25,326,327,369],{"__ignoreMap":55},[59,328,329,331,333,336,338,341,344,347,350,352,355,358,361,364,367],{"class":61,"line":62},[59,330,66],{"class":65},[59,332,144],{"class":69},[59,334,335],{"class":69}," version",[59,337,73],{"class":69},[59,339,340],{"class":76}," --http",[59,342,343],{"class":69}," vN",[59,345,346],{"class":83}," [--policy ",[59,348,349],{"class":69},"preserve",[59,351,96],{"class":83},[59,353,354],{"class":65},"replace]",[59,356,357],{"class":83}," [--prefix ",[59,359,360],{"class":69},"PATH]",[59,362,363],{"class":83}," [--service ",[59,365,366],{"class":69},"NAME]",[59,368,102],{"class":83},[59,370,371,373,375,378,380,383,385,387],{"class":61,"line":179},[59,372,66],{"class":65},[59,374,144],{"class":69},[59,376,377],{"class":69}," enable",[59,379,73],{"class":69},[59,381,382],{"class":76}," --grpc",[59,384,363],{"class":83},[59,386,366],{"class":69},[59,388,102],{"class":83},[15,390,391,392,32,394,397,398,401,402,32,406,410],{},"Versioning defaults to ",[25,393,349],{},[25,395,396],{},"\u002Fapi\u002FvN",". ",[25,399,400],{},"replace"," stops registering legacy routes while retaining their source. Existing version packages are not overwritten. Enabling gRPC preserves handwritten source and requires the supported injectable service factory. See ",[19,403,405],{"href":404},"\u002Fdocs\u002Fmain\u002Fversioning\u002F","HTTP versions",[19,407,409],{"href":408},"\u002Fdocs\u002Fmain\u002Fmicroservices\u002F","microservices",".",[10,412,414],{"id":413},"run-and-verify","Run and verify",[50,416,418],{"className":52,"code":417,"language":54,"meta":55,"style":55},"gonex run [--service NAME]\ngonex build [--os OS] [--arch ARCH] [--out FILE] [--service NAME]\ngonex check [--service NAME]\ngonex --help\ngonex --version\n",[25,419,420,432,460,471,479],{"__ignoreMap":55},[59,421,422,424,427,429],{"class":61,"line":62},[59,423,66],{"class":65},[59,425,426],{"class":69}," run",[59,428,363],{"class":83},[59,430,431],{"class":69},"NAME]\n",[59,433,434,436,439,442,445,447,450,453,456,458],{"class":61,"line":179},[59,435,66],{"class":65},[59,437,438],{"class":69}," build",[59,440,441],{"class":83}," [--os ",[59,443,444],{"class":69},"OS]",[59,446,90],{"class":83},[59,448,449],{"class":69},"ARCH]",[59,451,452],{"class":83}," [--out ",[59,454,455],{"class":69},"FILE]",[59,457,363],{"class":83},[59,459,431],{"class":69},[59,461,462,464,467,469],{"class":61,"line":193},[59,463,66],{"class":65},[59,465,466],{"class":69}," check",[59,468,363],{"class":83},[59,470,431],{"class":69},[59,472,474,476],{"class":61,"line":473},4,[59,475,66],{"class":65},[59,477,478],{"class":76}," --help\n",[59,480,482,484],{"class":61,"line":481},5,[59,483,66],{"class":65},[59,485,486],{"class":76}," --version\n",[15,488,489,492,493,397,497,500,501,504],{},[25,490,491],{},"run"," invokes the Go executable path for the project; the application displays its bound address and writes structured lifecycle\u002Frequest logs. See ",[19,494,496],{"href":495},"\u002Fdocs\u002Fmain\u002Flogging\u002F","logging",[25,498,499],{},"build"," writes an application executable; ",[25,502,503],{},"check"," runs tests, vet and package compilation. Child command failures preserve their exit codes. A workspace command must identify a service when selection is ambiguous.",[10,506,508],{"id":507},"openapi","OpenAPI",[50,510,512],{"className":52,"code":511,"language":54,"meta":55,"style":55},"gonex openapi generate [--out openapi.json] [--http-version vN] [--service NAME] [--dry-run]\ngonex openapi validate [--file openapi.json] [--against BASELINE] [--service NAME]\n",[25,513,514,539],{"__ignoreMap":55},[59,515,516,518,521,524,526,529,531,533,535,537],{"class":61,"line":62},[59,517,66],{"class":65},[59,519,520],{"class":69}," openapi",[59,522,523],{"class":69}," generate",[59,525,452],{"class":83},[59,527,528],{"class":69},"openapi.json]",[59,530,170],{"class":83},[59,532,173],{"class":69},[59,534,363],{"class":83},[59,536,366],{"class":69},[59,538,102],{"class":83},[59,540,541,543,545,548,551,553,556,559,561],{"class":61,"line":179},[59,542,66],{"class":65},[59,544,520],{"class":69},[59,546,547],{"class":69}," validate",[59,549,550],{"class":83}," [--file ",[59,552,528],{"class":69},[59,554,555],{"class":83}," [--against ",[59,557,558],{"class":69},"BASELINE]",[59,560,363],{"class":83},[59,562,431],{"class":69},[15,564,565,566,568,569,572],{},"Generation executes the project's initialization\u002Fexport path without starting listeners, validates the result and writes the output. It exports the legacy document unless ",[25,567,265],{}," selects a registered major. Validation is offline; ",[25,570,571],{},"--against"," additionally runs conservative compatibility checks against a baseline. A generation dry run does not execute project code.",[10,574,576],{"id":575},"database-migrations","Database migrations",[50,578,580],{"className":52,"code":579,"language":54,"meta":55,"style":55},"gonex db migrate [--service NAME] [--dry-run]\ngonex db status [--service NAME] [--dry-run]\n",[25,581,582,598],{"__ignoreMap":55},[59,583,584,586,589,592,594,596],{"class":61,"line":62},[59,585,66],{"class":65},[59,587,588],{"class":69}," db",[59,590,591],{"class":69}," migrate",[59,593,363],{"class":83},[59,595,366],{"class":69},[59,597,102],{"class":83},[59,599,600,602,604,607,609,611],{"class":61,"line":179},[59,601,66],{"class":65},[59,603,588],{"class":69},[59,605,606],{"class":69}," status",[59,608,363],{"class":83},[59,610,366],{"class":69},[59,612,102],{"class":83},[15,614,615,616,619,620,623,624,410],{},"Configure ",[25,617,618],{},"DATABASE_URL"," and, where needed, ",[25,621,622],{},"DATABASE_DIALECT"," in the executable's environment. Migrations are explicit; serving does not automatically change schemas. Dry runs do not connect to the database. See ",[19,625,627],{"href":626},"\u002Fdocs\u002Fmain\u002Fdatabase\u002F","database behavior",[10,629,631],{"id":630},"protobuf-contracts","Protobuf contracts",[50,633,635],{"className":52,"code":634,"language":54,"meta":55,"style":55},"gonex grpc generate [--dry-run]\ngonex grpc check\n",[25,636,637,648],{"__ignoreMap":55},[59,638,639,641,644,646],{"class":61,"line":62},[59,640,66],{"class":65},[59,642,643],{"class":69}," grpc",[59,645,523],{"class":69},[59,647,102],{"class":83},[59,649,650,652,654],{"class":61,"line":179},[59,651,66],{"class":65},[59,653,643],{"class":69},[59,655,656],{"class":69}," check\n",[15,658,659,660,662,663,410],{},"Run from a supported project\u002Fworkspace, service or contracts root. Generation compiles and checks contracts, then invokes pinned official plugins and stages the resulting files. Dry runs omit plugins and writes. ",[25,661,503],{}," compares descriptors to the stored baseline. Neither command substitutes for the release workflow's Buf gate; see ",[19,664,666],{"href":665},"\u002Fdocs\u002Fmain\u002Fgrpc\u002F","gRPC contracts",[10,668,670],{"id":669},"generator-safety","Generator safety",[15,672,673,674,677],{},"Generators plan and validate paths and collisions before writes. They reject traversal, symlinks and handwritten-file overwrites, hash-check tool-owned registries and support dry runs. ",[25,675,676],{},".gonex.json"," records ownership metadata; do not delete it to bypass a conflict.",[15,679,680,681,684,685,410],{},"New projects use a staged rename. Existing projects use an exclusive lock, staging and rollback on ordinary application errors; multi-file updates are not power-loss atomic. After an interrupted process, inspect ",[25,682,683],{},".gonex.lock"," and proposed changes before recovering. See ",[19,686,688],{"href":687},"\u002Fdocs\u002Fmain\u002Fquick-start\u002F#generator-safety","getting started",[10,690,692],{"id":691},"upgrade-your-application-dependency","Upgrade your application dependency",[15,694,695,696,699,700,703,704,707],{},"Select a reviewed target with ",[25,697,698],{},"go get -tool github.com\u002Famkargar\u002Fgonex\u002Fcmd\u002Fgonex@TARGET",". Resolve its canonical module version with ",[25,701,702],{},"go list -m github.com\u002Famkargar\u002Fgonex",", then run ",[25,705,706],{},"go tool gonex upgrade --framework-version CANONICAL_VERSION --dry-run",". Review and apply without --dry-run, followed by go mod tidy, tests and contract comparisons.",[15,709,710,711,715],{},"Upgrade updates the dependency\u002Ftool and .gonex.json version metadata. It preserves handwritten code and registries; it does not migrate application code or database schemas. Review the ",[19,712,714],{"href":713},"\u002Fdocs\u002Fmain\u002Fproduction-readiness\u002F","readiness and release gates"," before promoting a candidate.",[10,717,719],{"id":718},"local-microservices-workflow","Local microservices workflow",[15,721,17,722,726,727,731],{},[19,723,725],{"href":724},"\u002Fdocs\u002Fmain\u002Fmicroservices-quickstart\u002F","First microservice call"," for explicit client profiles and wiring, dev\u002Fdoctor and independently published contracts. Existing generated paths and TLS defaults are retained. ",[19,728,730],{"href":729},"\u002Fdocs\u002Fmain\u002Fmicroservices-compatibility\u002F","Compatibility"," explains skeleton\u002Fexample\u002Fraw profiles, version coexistence and generation checks.",[10,733,735],{"id":734},"help-for-every-command","Help for every command",[50,737,739],{"className":52,"code":738,"language":54,"meta":55,"style":55},"gonex -h\ngonex build --help\ngonex create module -h\ngonex help create client\n",[25,740,741,748,756,766],{"__ignoreMap":55},[59,742,743,745],{"class":61,"line":62},[59,744,66],{"class":65},[59,746,747],{"class":76}," -h\n",[59,749,750,752,754],{"class":61,"line":179},[59,751,66],{"class":65},[59,753,438],{"class":69},[59,755,478],{"class":76},[59,757,758,760,762,764],{"class":61,"line":193},[59,759,66],{"class":65},[59,761,141],{"class":69},[59,763,144],{"class":69},[59,765,747],{"class":76},[59,767,768,770,773,775],{"class":61,"line":473},[59,769,66],{"class":65},[59,771,772],{"class":69}," help",[59,774,141],{"class":69},[59,776,777],{"class":69}," client\n",[15,779,780,781,784,785,410],{},"Help is grouped by task. Command-specific help lists only relevant options and\nworks outside an application without generating files. Color is automatic on\nsupported terminals and disabled for redirected output, ",[25,782,783],{},"TERM=dumb"," and\n",[25,786,787],{},"NO_COLOR",[10,789,791],{"id":790},"build-for-an-operating-system-and-architecture","Build for an operating system and architecture",[50,793,795],{"className":52,"code":794,"language":54,"meta":55,"style":55},"go tool gonex build --os windows --arch amd64\ngo tool gonex build --os windows --arch arm64\ngo tool gonex build --os linux --arch amd64\ngo tool gonex build --os linux --arch arm64\ngo tool gonex build --os linux --arch amd64 --out .\u002Frelease\u002Fserver\n",[25,796,797,822,841,860,878],{"__ignoreMap":55},[59,798,799,802,805,808,810,813,816,819],{"class":61,"line":62},[59,800,801],{"class":65},"go",[59,803,804],{"class":69}," tool",[59,806,807],{"class":69}," gonex",[59,809,438],{"class":69},[59,811,812],{"class":76}," --os",[59,814,815],{"class":69}," windows",[59,817,818],{"class":76}," --arch",[59,820,821],{"class":69}," amd64\n",[59,823,824,826,828,830,832,834,836,838],{"class":61,"line":179},[59,825,801],{"class":65},[59,827,804],{"class":69},[59,829,807],{"class":69},[59,831,438],{"class":69},[59,833,812],{"class":76},[59,835,815],{"class":69},[59,837,818],{"class":76},[59,839,840],{"class":69}," arm64\n",[59,842,843,845,847,849,851,853,856,858],{"class":61,"line":193},[59,844,801],{"class":65},[59,846,804],{"class":69},[59,848,807],{"class":69},[59,850,438],{"class":69},[59,852,812],{"class":76},[59,854,855],{"class":69}," linux",[59,857,818],{"class":76},[59,859,821],{"class":69},[59,861,862,864,866,868,870,872,874,876],{"class":61,"line":473},[59,863,801],{"class":65},[59,865,804],{"class":69},[59,867,807],{"class":69},[59,869,438],{"class":69},[59,871,812],{"class":76},[59,873,855],{"class":69},[59,875,818],{"class":76},[59,877,840],{"class":69},[59,879,880,882,884,886,888,890,892,894,897,900],{"class":61,"line":481},[59,881,801],{"class":65},[59,883,804],{"class":69},[59,885,807],{"class":69},[59,887,438],{"class":69},[59,889,812],{"class":76},[59,891,855],{"class":69},[59,893,818],{"class":76},[59,895,896],{"class":69}," amd64",[59,898,899],{"class":76}," --out",[59,901,902],{"class":69}," .\u002Frelease\u002Fserver\n",[15,904,905,906,909,910,784,913,916,917,920,921,924,925,928],{},"Gonex uses ",[25,907,908],{},"go build -o \u003Cfile> ."," underneath. Target options map to ",[25,911,912],{},"GOOS",[25,914,915],{},"GOARCH",", defaulting to environment values or the current machine. Supported\npairs are checked against ",[25,918,919],{},"go tool dist list",". The default executable is\n",[25,922,923],{},"dist\u002F\u003Cos>-\u003Carch>\u002F\u003Capp>",", with ",[25,926,927],{},".exe"," on Windows. Custom relative output paths\nresolve from the selected application\u002Fservice root.",[15,930,931],{},"Successful output shows the target and file path; a run command appears only for\nnative targets. Cross-compilation can require a target C toolchain when a\ndependency uses CGO. Compiler diagnostics and failure exit codes remain visible.",[933,934,935],"style",{},"html pre.shiki code .swoLU, html code.shiki .swoLU{--shiki-light:#795E26;--shiki-default:#795E26;--shiki-dark:#DCDCAA}html pre.shiki code .sFD8J, html code.shiki .sFD8J{--shiki-light:#A31515;--shiki-default:#A31515;--shiki-dark:#CE9178}html pre.shiki code .stxUP, html code.shiki .stxUP{--shiki-light:#0000FF;--shiki-default:#0000FF;--shiki-dark:#569CD6}html pre.shiki code .s_Yst, html code.shiki .s_Yst{--shiki-light:#000000;--shiki-default:#000000;--shiki-dark:#D4D4D4}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":55,"searchDepth":179,"depth":179,"links":937},[938,939,940,941,942,943,944,945,946,947,948,949,950],{"id":12,"depth":179,"text":13},{"id":47,"depth":179,"text":48},{"id":128,"depth":179,"text":129},{"id":320,"depth":179,"text":321},{"id":413,"depth":179,"text":414},{"id":507,"depth":179,"text":508},{"id":575,"depth":179,"text":576},{"id":630,"depth":179,"text":631},{"id":669,"depth":179,"text":670},{"id":691,"depth":179,"text":692},{"id":718,"depth":179,"text":719},{"id":734,"depth":179,"text":735},{"id":790,"depth":179,"text":791},"Reference Gonex commands for safe project scaffolding, modules, API versions, gRPC generation and database migrations.","md","APPLICATION DESIGN",{},true,80,"\u002Fdocs\u002Fmain\u002Fcli",{"title":5,"description":951},"cli.md","docs\u002Fmain\u002Fcli","main","smoX7eO3YcszQ_5hP5nwwDCSB8IiykbkTVVWe2ZGglY",1792521640298]