[{"data":1,"prerenderedAt":966},["ShallowReactive",2],{"$f8E53SlKmXtdr7r1Gh4c6if1TBWlJstbrlc95ojxyA3Y":3},{"slug":4,"title":5,"description":6,"source":7,"document":8,"toc":942,"editUrl":960,"prev":961,"next":963},"ecosystem\u002Fcli-reference","CLI reference","Every fr command and flag, from scaffolding to Cargo wrapper to DB migrations.","---\ntitle: CLI reference\ndescription: Every fr command and flag, from scaffolding to Cargo wrapper to DB migrations.\n---\n\n# CLI reference\n\nThe `fr` CLI is a thin, friendly wrapper over `cargo` plus Ferrite conveniences. Its exit code mirrors `cargo`'s — 0 success, 1 failure, 101 panic — so piping into CI is predictable.\n\n## Global flags\n\n```\n-d, --debug      verbose output\n    --quiet      only errors\n-V, --version    print version\n-h, --help       print help\n```\n\n## Commands\n\n### build\n\n```bash\nfr build [-d] [--release]\n```\n\nThin wrapper over `cargo build` (keeps your toolchain). `--release` maps to `cargo build --release`.\n\n### run\n\n```bash\nfr run\nfr run -- --args-for-the-app\n```\n\n`cargo run`, with `-d` lifted to `--verbose`.\n\n### gen\n\n```bash\nfr gen\n```\n\nPrints what the build would generate — a preview of the entity (`Repository\u003CE>`), route, and OpenAPI artifacts from the compile-time inventory.\n\n### new\n\n```bash\nfr new \u003Capp_name> [--path=\u003Cpath>]\n```\n\nScaffold a new Ferrite application in `.\u002F\u003Capp_name>`.\n\n### add\n\n```bash\nfr add \u003Cecosystem-crate>\n```\n\nImport a first-party ecosystem crate into `Cargo.toml` **and** the corresponding `main.rs` snippet (module import + required env vars). Current catalog:\n\n| Short name | Crate | Module \u002F entries |\n| --- | --- | --- |\n| `auth-jwt` | `ferrite-auth-jwt` | `AuthModule` (requires `JWT_SECRET`) |\n| `auth-oauth` | `ferrite-auth-oauth` | `OAuthModule` (env per provider) |\n| `cache-redis` | `ferrite-cache-redis` | `CacheModule` |\n| `cqrs` | `ferrite-cqrs` | `CqrsModule` |\n| `ferrite-log` | `ferrite-log` | logging entry |\n| `graphql` | `ferrite-graphql` | `GraphQLModule` |\n| `grpc` | `ferrite-grpc` | `GrpcModuleImpl` |\n| `health` | `ferrite-health` | `HealthModule` |\n| `i18n` | `ferrite-i18n` | `I18nModuleImpl`, lints for `LOCALE_DIR` |\n| `kafka` | `ferrite-kafka` | `KafkaModuleImpl` |\n| `nats` | `ferrite-nats` | `NatsModuleImpl` |\n| `orm` | `ferrite-orm` | ORM entry (in-memory store) |\n| `orm-sqlx` | `ferrite-orm-sqlx` | provider registration only (stub) |\n| `orm-diesel` | `ferrite-orm-diesel` | provider registration only (stub) |\n| `rate-limit` | `ferrite-throttler` | `ThrottlerModule` |\n| `queue` | `ferrite-queue` | `QueueModuleImpl` |\n| `scheduler` | `ferrite-scheduler` | `CronModuleImpl` |\n| `swagger` | `ferrite-swagger` | `SwaggerModule`, lints for `SWAGGER_*` envs |\n| `ws` | `ferrite-ws` | WebSocket entries |\n\n### test\n\n```bash\nfr test [--coverage] [--release] [-d]\n```\n\nWrapper over `cargo test`. `--coverage` passes extra lint\u002Ftest gates (and can report test counts).\n\n### bib\n\nGenerate a `bib` (third-party attribution \u002F license notice) file from the workspace:\n\n```bash\nfr bib > THIRD_PARTY.md\n```\n\n### doctor\n\n```bash\nfr doctor [--verbose]\n```\n\nValidate environment conventions and surface \"expected set but missing\" env vars across imported modules:\n\n| Check | Behavior |\n| --- | --- |\n| `JWT_SECRET` missing & auth modules present | warning + hint |\n| `DATABASE_URL` missing & ORM sea present | warning + hint |\n| Unknown\u002Fmisspelled `fr add` crate | error listing the catalog |\n| `SWAGGER_*`, `LOCALE_DIR`, `NATS_URL`, `KAFKA_BROKERS` cross-checked | hint |\n\n### openapi\n\n```bash\nfr openapi export -o \u003Coutput.json>\n```\n\n> **Note:** currently writes a static placeholder file. For a real spec use `GET \u002Fopenapi.json` from `ferrite-swagger` at runtime, or call `build_openapi()` in a test.\n\n### db\n\nRun the SeaORM migration harness:\n\n```bash\nfr db migrate-create \u003Cname>      # new migration up\u002Fdown pair\nfr db migrate                    # apply pending\nfr db revert                     # roll back last applied\nfr db seed                       # run seeds\u002F*.sql\nfr db status                     # applied vs pending report\n```\n\nUses your app binary via `FERRITE_DB_ACTION`; requires `ferrite-orm-sea` wired into the app.\n\n### doctor output shape\n\nExit 0 with warnings\u002Ferrors printed. Exit 1 if the environment is unusable.\n\n### compgen \u002F completions\n\nBuilt-in clap shell completions are available via the `-h` help paths (bash\u002Fzsh\u002Ffish\u002Fpowershell) for power users.\n\n## Next steps\n\n- [Crates](\u002Fdocs\u002Fecosystem\u002Fcrates).\n- [Roadmap](\u002Fdocs\u002Fecosystem\u002Froadmap).",{"frontmatter":9,"meta":10,"nodes":62},{"title":5,"description":6},{"toc":11},{"title":12,"searchDepth":13,"depth":14,"links":15},"On This Page",2,3,[16,19,59],{"id":17,"depth":13,"text":18},"global-flags","Global flags",{"id":20,"depth":13,"text":21,"children":22},"commands","Commands",[23,26,29,32,35,38,41,44,47,50,53,56],{"id":24,"depth":14,"text":25},"commands-build","build",{"id":27,"depth":14,"text":28},"commands-run","run",{"id":30,"depth":14,"text":31},"commands-gen","gen",{"id":33,"depth":14,"text":34},"commands-new","new",{"id":36,"depth":14,"text":37},"commands-add","add",{"id":39,"depth":14,"text":40},"commands-test","test",{"id":42,"depth":14,"text":43},"commands-bib","bib",{"id":45,"depth":14,"text":46},"commands-doctor","doctor",{"id":48,"depth":14,"text":49},"commands-openapi","openapi",{"id":51,"depth":14,"text":52},"commands-db","db",{"id":54,"depth":14,"text":55},"commands-doctor-output-shape","doctor output shape",{"id":57,"depth":14,"text":58},"commands-compgen-completions","compgen \u002F completions",{"id":60,"depth":13,"text":61},"next-steps","Next steps",[63,67,83,86,116,118,121,140,155,157,181,194,196,207,214,216,243,249,251,271,287,635,637,651,662,664,670,687,689,703,706,771,773,800,818,820,823,898,909,911,914,916,923,925],[64,65,5],"h1",{"id":66},"cli-reference",[68,69,70,71,75,76,79,80,82],"p",{},"The ",[72,73,74],"code",{},"fr"," CLI is a thin, friendly wrapper over ",[72,77,78],{},"cargo"," plus Ferrite conveniences. Its exit code mirrors ",[72,81,78],{},"'s — 0 success, 1 failure, 101 panic — so piping into CI is predictable.",[84,85,18],"h2",{"id":17},[87,88,90],"pre",{"class":89},"shiki shiki-themes github-light github-dark dark:github-dark",[72,91,92,100,101,100,106,100,111],{},[93,94,97],"span",{"class":95,"style":96},"line","display: inline",[93,98,99],{},"-d, --debug      verbose output","\n",[93,102,103],{"class":95,"style":96},[93,104,105],{},"    --quiet      only errors",[93,107,108],{"class":95,"style":96},[93,109,110],{},"-V, --version    print version",[93,112,113],{"class":95,"style":96},[93,114,115],{},"-h, --help       print help",[84,117,21],{"id":20},[119,120,25],"h3",{"id":24},[87,122,124],{"language":123,"class":89},"bash",[72,125,127],{"class":126},"language-bash",[93,128,129,132,136],{"class":95,"style":96},[93,130,74],{"style":131},"color:#6F42C1;--shiki-dark:#B392F0",[93,133,135],{"style":134},"color:#032F62;--shiki-dark:#9ECBFF"," build",[93,137,139],{"style":138},"color:#24292E;--shiki-dark:#E1E4E8"," [-d] [--release]",[68,141,142,143,146,147,150,151,154],{},"Thin wrapper over ",[72,144,145],{},"cargo build"," (keeps your toolchain). ",[72,148,149],{},"--release"," maps to ",[72,152,153],{},"cargo build --release",".",[119,156,28],{"id":27},[87,158,159],{"language":123,"class":89},[72,160,161,100,168],{"class":126},[93,162,163,165],{"class":95,"style":96},[93,164,74],{"style":131},[93,166,167],{"style":134}," run",[93,169,170,172,174,178],{"class":95,"style":96},[93,171,74],{"style":131},[93,173,167],{"style":134},[93,175,177],{"style":176},"color:#005CC5;--shiki-dark:#79B8FF"," --",[93,179,180],{"style":176}," --args-for-the-app",[68,182,183,186,187,190,191,154],{},[72,184,185],{},"cargo run",", with ",[72,188,189],{},"-d"," lifted to ",[72,192,193],{},"--verbose",[119,195,31],{"id":30},[87,197,198],{"language":123,"class":89},[72,199,200],{"class":126},[93,201,202,204],{"class":95,"style":96},[93,203,74],{"style":131},[93,205,206],{"style":134}," gen",[68,208,209,210,213],{},"Prints what the build would generate — a preview of the entity (",[72,211,212],{},"Repository\u003CE>","), route, and OpenAPI artifacts from the compile-time inventory.",[119,215,34],{"id":33},[87,217,218],{"language":123,"class":89},[72,219,220],{"class":126},[93,221,222,224,227,231,234,237,240],{"class":95,"style":96},[93,223,74],{"style":131},[93,225,226],{"style":134}," new",[93,228,230],{"style":229},"color:#D73A49;--shiki-dark:#F97583"," \u003C",[93,232,233],{"style":134},"app_nam",[93,235,236],{"style":138},"e",[93,238,239],{"style":229},">",[93,241,242],{"style":138}," [--path=\u003Cpath>]",[68,244,245,246,154],{},"Scaffold a new Ferrite application in ",[72,247,248],{},".\u002F\u003Capp_name>",[119,250,37],{"id":36},[87,252,253],{"language":123,"class":89},[72,254,255],{"class":126},[93,256,257,259,262,264,267,269],{"class":95,"style":96},[93,258,74],{"style":131},[93,260,261],{"style":134}," add",[93,263,230],{"style":229},[93,265,266],{"style":134},"ecosystem-crat",[93,268,236],{"style":138},[93,270,239],{"style":229},[68,272,273,274,277,278,282,283,286],{},"Import a first-party ecosystem crate into ",[72,275,276],{},"Cargo.toml"," ",[279,280,281],"strong",{},"and"," the corresponding ",[72,284,285],{},"main.rs"," snippet (module import + required env vars). Current catalog:",[288,289,290,306],"table",{},[291,292,293],"thead",{},[294,295,296,300,303],"tr",{},[297,298,299],"th",{},"Short name",[297,301,302],{},"Crate",[297,304,305],{},"Module \u002F entries",[307,308,309,332,350,367,384,398,415,432,449,470,487,504,519,534,548,565,582,599,620],"tbody",{},[294,310,311,317,322],{},[312,313,314],"td",{},[72,315,316],{},"auth-jwt",[312,318,319],{},[72,320,321],{},"ferrite-auth-jwt",[312,323,324,327,328,331],{},[72,325,326],{},"AuthModule"," (requires ",[72,329,330],{},"JWT_SECRET",")",[294,333,334,339,344],{},[312,335,336],{},[72,337,338],{},"auth-oauth",[312,340,341],{},[72,342,343],{},"ferrite-auth-oauth",[312,345,346,349],{},[72,347,348],{},"OAuthModule"," (env per provider)",[294,351,352,357,362],{},[312,353,354],{},[72,355,356],{},"cache-redis",[312,358,359],{},[72,360,361],{},"ferrite-cache-redis",[312,363,364],{},[72,365,366],{},"CacheModule",[294,368,369,374,379],{},[312,370,371],{},[72,372,373],{},"cqrs",[312,375,376],{},[72,377,378],{},"ferrite-cqrs",[312,380,381],{},[72,382,383],{},"CqrsModule",[294,385,386,391,395],{},[312,387,388],{},[72,389,390],{},"ferrite-log",[312,392,393],{},[72,394,390],{},[312,396,397],{},"logging entry",[294,399,400,405,410],{},[312,401,402],{},[72,403,404],{},"graphql",[312,406,407],{},[72,408,409],{},"ferrite-graphql",[312,411,412],{},[72,413,414],{},"GraphQLModule",[294,416,417,422,427],{},[312,418,419],{},[72,420,421],{},"grpc",[312,423,424],{},[72,425,426],{},"ferrite-grpc",[312,428,429],{},[72,430,431],{},"GrpcModuleImpl",[294,433,434,439,444],{},[312,435,436],{},[72,437,438],{},"health",[312,440,441],{},[72,442,443],{},"ferrite-health",[312,445,446],{},[72,447,448],{},"HealthModule",[294,450,451,456,461],{},[312,452,453],{},[72,454,455],{},"i18n",[312,457,458],{},[72,459,460],{},"ferrite-i18n",[312,462,463,466,467],{},[72,464,465],{},"I18nModuleImpl",", lints for ",[72,468,469],{},"LOCALE_DIR",[294,471,472,477,482],{},[312,473,474],{},[72,475,476],{},"kafka",[312,478,479],{},[72,480,481],{},"ferrite-kafka",[312,483,484],{},[72,485,486],{},"KafkaModuleImpl",[294,488,489,494,499],{},[312,490,491],{},[72,492,493],{},"nats",[312,495,496],{},[72,497,498],{},"ferrite-nats",[312,500,501],{},[72,502,503],{},"NatsModuleImpl",[294,505,506,511,516],{},[312,507,508],{},[72,509,510],{},"orm",[312,512,513],{},[72,514,515],{},"ferrite-orm",[312,517,518],{},"ORM entry (in-memory store)",[294,520,521,526,531],{},[312,522,523],{},[72,524,525],{},"orm-sqlx",[312,527,528],{},[72,529,530],{},"ferrite-orm-sqlx",[312,532,533],{},"provider registration only (stub)",[294,535,536,541,546],{},[312,537,538],{},[72,539,540],{},"orm-diesel",[312,542,543],{},[72,544,545],{},"ferrite-orm-diesel",[312,547,533],{},[294,549,550,555,560],{},[312,551,552],{},[72,553,554],{},"rate-limit",[312,556,557],{},[72,558,559],{},"ferrite-throttler",[312,561,562],{},[72,563,564],{},"ThrottlerModule",[294,566,567,572,577],{},[312,568,569],{},[72,570,571],{},"queue",[312,573,574],{},[72,575,576],{},"ferrite-queue",[312,578,579],{},[72,580,581],{},"QueueModuleImpl",[294,583,584,589,594],{},[312,585,586],{},[72,587,588],{},"scheduler",[312,590,591],{},[72,592,593],{},"ferrite-scheduler",[312,595,596],{},[72,597,598],{},"CronModuleImpl",[294,600,601,606,611],{},[312,602,603],{},[72,604,605],{},"swagger",[312,607,608],{},[72,609,610],{},"ferrite-swagger",[312,612,613,466,616,619],{},[72,614,615],{},"SwaggerModule",[72,617,618],{},"SWAGGER_*"," envs",[294,621,622,627,632],{},[312,623,624],{},[72,625,626],{},"ws",[312,628,629],{},[72,630,631],{},"ferrite-ws",[312,633,634],{},"WebSocket entries",[119,636,40],{"id":39},[87,638,639],{"language":123,"class":89},[72,640,641],{"class":126},[93,642,643,645,648],{"class":95,"style":96},[93,644,74],{"style":131},[93,646,647],{"style":134}," test",[93,649,650],{"style":138}," [--coverage] [--release] [-d]",[68,652,653,654,657,658,661],{},"Wrapper over ",[72,655,656],{},"cargo test",". ",[72,659,660],{},"--coverage"," passes extra lint\u002Ftest gates (and can report test counts).",[119,663,43],{"id":42},[68,665,666,667,669],{},"Generate a ",[72,668,43],{}," (third-party attribution \u002F license notice) file from the workspace:",[87,671,672],{"language":123,"class":89},[72,673,674],{"class":126},[93,675,676,678,681,684],{"class":95,"style":96},[93,677,74],{"style":131},[93,679,680],{"style":134}," bib",[93,682,683],{"style":229}," >",[93,685,686],{"style":134}," THIRD_PARTY.md",[119,688,46],{"id":45},[87,690,691],{"language":123,"class":89},[72,692,693],{"class":126},[93,694,695,697,700],{"class":95,"style":96},[93,696,74],{"style":131},[93,698,699],{"style":134}," doctor",[93,701,702],{"style":138}," [--verbose]",[68,704,705],{},"Validate environment conventions and surface \"expected set but missing\" env vars across imported modules:",[288,707,708,718],{},[291,709,710],{},[294,711,712,715],{},[297,713,714],{},"Check",[297,716,717],{},"Behavior",[307,719,720,730,740,752],{},[294,721,722,727],{},[312,723,724,726],{},[72,725,330],{}," missing & auth modules present",[312,728,729],{},"warning + hint",[294,731,732,738],{},[312,733,734,737],{},[72,735,736],{},"DATABASE_URL"," missing & ORM sea present",[312,739,729],{},[294,741,742,749],{},[312,743,744,745,748],{},"Unknown\u002Fmisspelled ",[72,746,747],{},"fr add"," crate",[312,750,751],{},"error listing the catalog",[294,753,754,768],{},[312,755,756,758,759,758,761,758,764,767],{},[72,757,618],{},", ",[72,760,469],{},[72,762,763],{},"NATS_URL",[72,765,766],{},"KAFKA_BROKERS"," cross-checked",[312,769,770],{},"hint",[119,772,49],{"id":48},[87,774,775],{"language":123,"class":89},[72,776,777],{"class":126},[93,778,779,781,784,787,790,792,795,798],{"class":95,"style":96},[93,780,74],{"style":131},[93,782,783],{"style":134}," openapi",[93,785,786],{"style":134}," export",[93,788,789],{"style":176}," -o",[93,791,230],{"style":229},[93,793,794],{"style":134},"output.jso",[93,796,797],{"style":138},"n",[93,799,239],{"style":229},[801,802,803,806,807,810,811,813,814,817],"blockquote",{},[279,804,805],{},"Note:"," currently writes a static placeholder file. For a real spec use ",[72,808,809],{},"GET \u002Fopenapi.json"," from ",[72,812,610],{}," at runtime, or call ",[72,815,816],{},"build_openapi()"," in a test.",[119,819,52],{"id":51},[68,821,822],{},"Run the SeaORM migration harness:",[87,824,825],{"language":123,"class":89},[72,826,827,100,850,100,862,100,874,100,886],{"class":126},[93,828,829,831,834,837,839,842,844,846],{"class":95,"style":96},[93,830,74],{"style":131},[93,832,833],{"style":134}," db",[93,835,836],{"style":134}," migrate-create",[93,838,230],{"style":229},[93,840,841],{"style":134},"nam",[93,843,236],{"style":138},[93,845,239],{"style":229},[93,847,849],{"style":848},"color:#6A737D;--shiki-dark:#6A737D","      # new migration up\u002Fdown pair",[93,851,852,854,856,859],{"class":95,"style":96},[93,853,74],{"style":131},[93,855,833],{"style":134},[93,857,858],{"style":134}," migrate",[93,860,861],{"style":848},"                    # apply pending",[93,863,864,866,868,871],{"class":95,"style":96},[93,865,74],{"style":131},[93,867,833],{"style":134},[93,869,870],{"style":134}," revert",[93,872,873],{"style":848},"                     # roll back last applied",[93,875,876,878,880,883],{"class":95,"style":96},[93,877,74],{"style":131},[93,879,833],{"style":134},[93,881,882],{"style":134}," seed",[93,884,885],{"style":848},"                       # run seeds\u002F*.sql",[93,887,888,890,892,895],{"class":95,"style":96},[93,889,74],{"style":131},[93,891,833],{"style":134},[93,893,894],{"style":134}," status",[93,896,897],{"style":848},"                     # applied vs pending report",[68,899,900,901,904,905,908],{},"Uses your app binary via ",[72,902,903],{},"FERRITE_DB_ACTION","; requires ",[72,906,907],{},"ferrite-orm-sea"," wired into the app.",[119,910,55],{"id":54},[68,912,913],{},"Exit 0 with warnings\u002Ferrors printed. Exit 1 if the environment is unusable.",[119,915,58],{"id":57},[68,917,918,919,922],{},"Built-in clap shell completions are available via the ",[72,920,921],{},"-h"," help paths (bash\u002Fzsh\u002Ffish\u002Fpowershell) for power users.",[84,924,61],{"id":60},[926,927,928,936],"ul",{},[929,930,931,154],"li",{},[932,933,935],"a",{"href":934},"\u002Fdocs\u002Fecosystem\u002Fcrates","Crates",[929,937,938,154],{},[932,939,941],{"href":940},"\u002Fdocs\u002Fecosystem\u002Froadmap","Roadmap",{"title":12,"searchDepth":13,"depth":14,"links":943},[944,945,959],{"id":17,"depth":13,"text":18},{"id":20,"depth":13,"text":21,"children":946},[947,948,949,950,951,952,953,954,955,956,957,958],{"id":24,"depth":14,"text":25},{"id":27,"depth":14,"text":28},{"id":30,"depth":14,"text":31},{"id":33,"depth":14,"text":34},{"id":36,"depth":14,"text":37},{"id":39,"depth":14,"text":40},{"id":42,"depth":14,"text":43},{"id":45,"depth":14,"text":46},{"id":48,"depth":14,"text":49},{"id":51,"depth":14,"text":52},{"id":54,"depth":14,"text":55},{"id":57,"depth":14,"text":58},{"id":60,"depth":13,"text":61},"https:\u002F\u002Fgithub.com\u002Fj4flmao\u002Fferrite_rs\u002Fedit\u002Fmain\u002Fdocs\u002Fcontent\u002Fecosystem\u002Fcli-reference.md",{"title":455,"slug":962},"techniques\u002Fi18n",{"title":964,"slug":965},"Ecosystem crates","ecosystem\u002Fcrates",1789565439198]