1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3872],{15868:(e,s,n)=>{n.d(s,{A:()=>i});var t=n(65162),r=n(62540);function i({header:e,inline:s,updated:n,version:i}){return(0,r.jsx)(t.A,{text:`v${i}`,variant:n?"success":"info",className:e?"absolute right-0 top-1.5":s?"inline-block ml-1":"ml-2"})}},33983:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>l,contentTitle:()=>c,default:()=>u,frontMatter:()=>a,metadata:()=>t,toc:()=>d});const t=JSON.parse('{"id":"commands/query/tasks","title":"query tasks","description":"Use the moon query tasks sub-command to query task information for all projects in the project","source":"@site/docs/commands/query/tasks.mdx","sourceDirName":"commands/query","slug":"/commands/query/tasks","permalink":"/docs/commands/query/tasks","draft":false,"unlisted":false,"editUrl":"https://github.com/moonrepo/moon/tree/master/website/docs/commands/query/tasks.mdx","tags":[],"version":"current","frontMatter":{"title":"query tasks","sidebar_label":"tasks","toc_max_heading_level":6},"sidebar":"docs","previous":{"title":"projects","permalink":"/docs/commands/query/projects"},"next":{"title":"run","permalink":"/docs/commands/run"}}');var r=n(62540),i=n(43023),o=n(15868);const a={title:"query tasks",sidebar_label:"tasks",toc_max_heading_level:6},c=void 0,l={},d=[{value:"Arguments",id:"arguments",level:3},{value:"Options",id:"options",level:3},{value:"Affected",id:"affected",level:4},{value:"Filters<VersionLabel></VersionLabel>",id:"filters",level:4},{value:"Configuration",id:"configuration",level:3}];function h(e){const s={a:"a",code:"code",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.p,{children:["Use the ",(0,r.jsx)(s.code,{children:"moon query tasks"})," sub-command to query task information for all projects in the project\ngraph. The tasks list can be filtered by passing a ",(0,r.jsx)(s.a,{href:"../../concepts/query-lang",children:"query statement"})," as\nan argument, or by using ",(0,r.jsx)(s.a,{href:"#options",children:"options"})," arguments."]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-shell",children:'# Find all tasks grouped by project\n$ moon query tasks\n\n# Find all tasks from projects with an id that matches "react"\n$ moon query tasks --id react\n$ moon query tasks "task~react"\n'})}),"\n",(0,r.jsx)(s.p,{children:"This will output a list of projects as JSON. The output has the following structure:"}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ts",children:"{\n\ttasks: Record<string, Record<string, Task>>,\n\toptions: QueryOptions,\n}\n"})}),"\n",(0,r.jsx)(s.h3,{id:"arguments",children:"Arguments"}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.code,{children:"[query]"})," - An optional ",(0,r.jsx)(s.a,{href:"../../concepts/query-lang",children:"query statement"})," to filter projects with. When\nprovided, all ",(0,r.jsx)(s.a,{href:"#filters",children:"filter options"})," are ignored. ",(0,r.jsx)(o.A,{version:"1.4.0"})]}),"\n"]}),"\n",(0,r.jsx)(s.h3,{id:"options",children:"Options"}),"\n",(0,r.jsx)(s.h4,{id:"affected",children:"Affected"}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.code,{children:"--affected"})," - Filter tasks that have been affected by changed files."]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.code,{children:"--downstream"}),' - Include downstream dependents of queried tasks. Supports "none" (default),\n"direct", "deep".',"\n",(0,r.jsx)(o.A,{version:"1.30.0"}),"\n"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.code,{children:"--upstream"}),' - Include upstream dependencies of queried tasks. Supports "none", "direct", "deep"\n(default).',"\n",(0,r.jsx)(o.A,{version:"1.30.0"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(s.h4,{id:"filters",children:["Filters",(0,r.jsx)(o.A,{version:"1.30.0"})]}),"\n",(0,r.jsx)(s.p,{children:"All option values are case-insensitive regex patterns."}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.code,{children:"--command <regex>"})," - Filter tasks that match this command."]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.code,{children:"--id <regex>"})," - Filter tasks that match this ID."]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.code,{children:"--project <regex>"})," - Filter tasks that belong to this project."]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.code,{children:"--script <regex>"})," - Filter tasks that match this script."]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.code,{children:"--toolchain <regex>"})," - Filter tasks of this toolchain. ",(0,r.jsx)(o.A,{version:"1.31.0"})]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.code,{children:"--tags <regex>"})," - Filter tasks that have the following tags. ",(0,r.jsx)(o.A,{version:"2.3.0"})]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.code,{children:"--type <regex>"})," - Filter tasks of this type."]}),"\n"]}),"\n",(0,r.jsx)(s.h3,{id:"configuration",children:"Configuration"}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"../../config/workspace#projects",children:(0,r.jsx)(s.code,{children:"projects"})})," in ",(0,r.jsx)(s.code,{children:".moon/workspace.*"})]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"../../config/project#tasks",children:(0,r.jsx)(s.code,{children:"tasks"})})," in ",(0,r.jsx)(s.code,{children:"moon.*"})]}),"\n"]})]})}function u(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},43023:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>a});var t=n(63696);const r={},i=t.createContext(r);function o(e){const s=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),t.createElement(i.Provider,{value:s},e.children)}},65162:(e,s,n)=>{n.d(s,{A:()=>a});var t=n(11750),r=n(74599),i=n(62540);const o={failure:"bg-red-100 text-red-900",info:"bg-pink-100 text-pink-900",success:"bg-green-100 text-green-900",warning:"bg-orange-100 text-orange-900"};function a({className:e,icon:s,text:n,variant:a}){return(0,i.jsxs)("span",{className:(0,t.A)("inline-flex items-center px-1 py-0.5 rounded text-xs font-bold uppercase",a?o[a]:"bg-gray-100 text-gray-800",e),children:[s&&(0,i.jsx)(r.A,{icon:s,className:"mr-1"}),n]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.