[{"data":1,"prerenderedAt":372},["ShallowReactive",2],{"docs:\u002Fen\u002Freference\u002Fcli":3},{"page":4,"untranslated":371,"translated":364},{"id":5,"title":6,"body":7,"description":361,"extension":362,"meta":363,"navigation":364,"path":365,"publishedAt":366,"seo":367,"stem":368,"updatedAt":369,"__hash__":370},"docs_en\u002Fen\u002Freference\u002Fcli.md","CLI",{"type":8,"value":9,"toc":350},"minimark",[10,14,40,62,67,70,117,172,177,230,234,259,263,266,292,327,331,346],[11,12,6],"h1",{"id":13},"cli",[15,16,17,18,22,23,26,27,29,30,33,34,36,37,39],"p",{},"The ",[19,20,21],"code",{},"tsumugi"," package includes a CLI for setup.",[24,25],"br",{},"\nYou do not need to install it separately.",[24,28],{},"\nIn a project where you have added the package, run ",[19,31,32],{},"npx tsumugi",".",[24,35],{},"\nWhen you run it without arguments, it starts in interactive mode.",[24,38],{},"\nIn environments that are not a TTY, such as pipes and CI, it does not start in interactive mode, prints the usage, and exits.",[41,42,47],"pre",{"className":43,"code":44,"language":45,"meta":46,"style":46},"language-bash shiki shiki-themes github-light github-dark","npx tsumugi\n","bash","",[19,48,49],{"__ignoreMap":46},[50,51,54,58],"span",{"class":52,"line":53},"line",1,[50,55,57],{"class":56},"sScJk","npx",[50,59,61],{"class":60},"sZZnC"," tsumugi\n",[63,64,66],"h2",{"id":65},"tsumugi-init","tsumugi init",[15,68,69],{},"Sets up Tsumugi in your project.",[41,71,73],{"className":43,"code":72,"language":45,"meta":46,"style":46},"npx tsumugi init [--name \u003Cname>] [--format jsonc|toml]\n",[19,74,75],{"__ignoreMap":46},[50,76,77,79,82,85,89,93,96,99,102,105,108,111,114],{"class":52,"line":53},[50,78,57],{"class":56},[50,80,81],{"class":60}," tsumugi",[50,83,84],{"class":60}," init",[50,86,88],{"class":87},"sVt8B"," [--name ",[50,90,92],{"class":91},"szBVR","\u003C",[50,94,95],{"class":60},"nam",[50,97,98],{"class":87},"e",[50,100,101],{"class":91},">",[50,103,104],{"class":60},"]",[50,106,107],{"class":87}," [--format ",[50,109,110],{"class":60},"jsonc",[50,112,113],{"class":91},"|",[50,115,116],{"class":56},"toml]\n",[15,118,119,122,123,126,127,33,130,132,133,136,137,140,141,143,144,147,148,151,152,33,155,157,158,161,162,126,165,168,169,33],{},[19,120,121],{},"init"," creates resources with ",[19,124,125],{},"wrangler queues create \u003Cname>"," and ",[19,128,129],{},"wrangler d1 create \u003Cname>",[24,131],{},"\nIf no wrangler configuration file exists, it generates a new one and writes the ",[19,134,135],{},"database_id"," that ",[19,138,139],{},"wrangler d1 create"," printed.",[24,142],{},"\nNext, it generates ",[19,145,146],{},"src\u002Findex.ts",", ",[19,149,150],{},"src\u002Fperformers\u002F",", and ",[19,153,154],{},".dev.vars",[24,156],{},"\nFinally, it runs ",[19,159,160],{},"wrangler d1 migrations apply"," (with ",[19,163,164],{},"--local",[19,166,167],{},"--remote",") and ",[19,170,171],{},"wrangler types",[173,174,176],"h3",{"id":175},"オプション","Options",[178,179,180,193],"table",{},[181,182,183],"thead",{},[184,185,186,190],"tr",{},[187,188,189],"th",{},"Option",[187,191,192],{},"Description",[194,195,196,218],"tbody",{},[184,197,198,204],{},[199,200,201],"td",{},[19,202,203],{},"--name \u003Cname>",[199,205,206,207,210,211,213,214,217],{},"The name of the Worker. If omitted, it uses the ",[19,208,209],{},"name"," in an existing configuration file, the ",[19,212,209],{}," in ",[19,215,216],{},"package.json",", or the directory name, in that order",[184,219,220,225],{},[199,221,222],{},[19,223,224],{},"--format \u003Cjsonc|toml>",[199,226,227,228],{},"The format of the configuration file to generate. The default is ",[19,229,110],{},[173,231,233],{"id":232},"既存ファイルの扱い","Handling of existing files",[15,235,236,238,239,241,242,147,245,248,249,252,253,255,256,258],{},[19,237,121],{}," does not modify existing files.",[24,240],{},"\nIf a wrangler configuration file (",[19,243,244],{},"wrangler.json",[19,246,247],{},"wrangler.jsonc",", or ",[19,250,251],{},"wrangler.toml",") already exists, it prints the content to add in the format of that file.",[24,254],{},"\nAmong the template files such as ",[19,257,146],{},", it does not regenerate those that already exist.",[63,260,262],{"id":261},"tsumugi-add-performer","tsumugi add-performer",[15,264,265],{},"Adds a performer.",[41,267,269],{"className":43,"code":268,"language":45,"meta":46,"style":46},"npx tsumugi add-performer \u003CNAME>\n",[19,270,271],{"__ignoreMap":46},[50,272,273,275,277,280,283,286,289],{"class":52,"line":53},[50,274,57],{"class":56},[50,276,81],{"class":60},[50,278,279],{"class":60}," add-performer",[50,281,282],{"class":91}," \u003C",[50,284,285],{"class":60},"NAM",[50,287,288],{"class":87},"E",[50,290,291],{"class":91},">\n",[15,293,294,297,298,33,301,303,304,33,307,309,310,312,313,315,316,319,320,323,324,33],{},[19,295,296],{},"add-performer"," generates a performer class in ",[19,299,300],{},"src\u002Fperformers\u002F\u003Cname>.ts",[24,302],{},"\nIt appends one export line to ",[19,305,306],{},"src\u002Fperformers\u002Findex.ts",[24,308],{},"\nThe name can be in any of these formats: kebab-case, camelCase, PascalCase, or SNAKE_CASE.",[24,311],{},"\nThe class name is converted to PascalCase, and the file name is converted to kebab-case.",[24,314],{},"\nFor example, ",[19,317,318],{},"send-mail"," is generated as the class ",[19,321,322],{},"SendMail"," and the file ",[19,325,326],{},"send-mail.ts",[173,328,330],{"id":329},"service-bindingの設定","Configuring a Service Binding",[15,332,333,334,337,338,340,342,343,345],{},"To call this performer from another Worker, add the ",[19,335,336],{},"services"," value to the caller's configuration file.",[24,339],{},[19,341,296],{}," prints the value you need to add.",[24,344],{},"\nIf the performer runs in the same Worker, you do not need to add it.",[347,348,349],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}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);}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}",{"title":46,"searchDepth":351,"depth":351,"links":352},3,[353,358],{"id":65,"depth":354,"text":66,"children":355},2,[356,357],{"id":175,"depth":351,"text":176},{"id":232,"depth":351,"text":233},{"id":261,"depth":354,"text":262,"children":359},[360],{"id":329,"depth":351,"text":330},"The commands in the CLI included in the tsumugi package, and the options and behavior of tsumugi init and tsumugi add-performer","md",{},true,"\u002Fen\u002Freference\u002Fcli","2026-07-22",{"title":6,"description":361},"en\u002Freference\u002Fcli","2026-10-25","w4W6HY8RXbORHbhyrYWEaO_bfYlo391xft9Pc3u4V2A",false,1794027576987]