The morph clean command is used to clear compile and cache files on a project.It can be used to clean up hidden files and other files in the project once when internal errors occur or when compilation does not work.
Shell
morph clean
boolean
With this option is specified, all directories, including frontend, will be deleted from the hidden files (.morph/ directory) at the project root.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Docs","colors":{"primary":"#111827","light":"#d1d5db","dark":"#111827"},"favicon":"/favicon.svg","styling":{"eyebrows":null,"codeblocks":"dark"},"logo":{"light":"https://mintcdn.com/queue-4c50ebb3/_HQi-05AKdEsS8di/assets/images/morph_logo_svg.svg?fit=max\u0026auto=format\u0026n=_HQi-05AKdEsS8di\u0026q=85\u0026s=a69926375f0832eee99cb53ed852c802","dark":"https://mintcdn.com/queue-4c50ebb3/_HQi-05AKdEsS8di/assets/images/morph_logo_svg_w.svg?fit=max\u0026auto=format\u0026n=_HQi-05AKdEsS8di\u0026q=85\u0026s=71a98ebfbcf4edc1b10f96852deffb78"},"navbar":{"links":[{"label":"Blog","href":"https://www.morphdb.io/blogs"}],"primary":{"type":"button","label":"Website","href":"https://www.morphdb.io"}},"footer":{"socials":{"x":"https://x.com/morphdbHQ","github":"https://github.com/useMorph","linkedin":"https://www.linkedin.com/company/morphdbhq"}},"navigation":{"global":{"anchors":[{"anchor":"Changelog","href":"https://www.morph-data.io/changelog","icon":"rss"},{"anchor":"Connectors","href":"https://www.morph-data.io/tools/connectors/database","icon":"plug"},{"anchor":"Code Snippets","href":"https://www.morph-data.io/tools/snippets/undefined","icon":"brackets-curly"},{"anchor":"Components","href":"https://morph-components.vercel.app/docs/introduction","icon":"code"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"queue-4c50ebb3","hasAudioNarration":false,"actualSubdomain":"queue-4c50ebb3","customDomains":["docs.morph-data.io"],"gitSource":{"type":"github","owner":"morph-data","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae92230380856db55854503:success","clientVersion":"0.0.4138","searchFilterCounts":[{"language":"default","tag":"Guides","count":82},{"language":"default","tag":"Reference","count":60},{"language":"default","tag":"Advanced","count":42},{"language":"default","tag":"Connectors","count":34},{"language":"default","tag":"CLI","count":20},{"language":"default","tag":"Framework","count":10},{"language":"default","tag":"フレームワーク","count":10},{"language":"default","tag":"Deprecated","count":10},{"language":"default","tag":"morph_lib.ai","count":10},{"language":"default","tag":"morph_lib.database","count":10}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"reference/en/cli-commands/clean","slug":"/reference/en/cli-commands/clean","pageMetadata":{"title":"clean","description":null,"href":"/reference/en/cli-commands/clean"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,ParamField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`morph clean`}),` command is used to clear compile and cache files on a project.`]}),`\n`,_jsx(_components.p,{children:`It can be used to clean up hidden files and other files in the project once when internal errors occur or when compilation does not work.`}),`\n`,_jsx(CodeBlock,{filename:`Shell`,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`morph`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` clean`})]}),`\n`]})})}),`\n`,_jsx(ParamField,{body:`--force`,type:`boolean`,requered:false,id:`param-force`,children:_jsxs(_components.p,{children:[`With this option is specified, all directories, including `,_jsx(_components.code,{children:`frontend`}),`, will be deleted from the hidden files (`,_jsx(_components.code,{children:`.morph/`}),` directory) at the project root.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"clean","description":null,"href":"/reference/en/cli-commands/clean"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"subdomain":"queue-4c50ebb3","siteName":"Docs","title":"clean - Docs","navMaps":{"firstHrefInVersion":{"English":{"href":"/reference/en/cli-commands/clean","matchLevel":0},"日本語":{"href":"/reference/ja/cli-commands/clean","matchLevel":1}},"firstHrefInLanguage":{}},"lastModified":"2026-01-07T03:58:53.128Z","originalFileLocation":"reference/en/cli-commands/clean.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/queue-4c50ebb3/rEhumAjdG_2O8Lak/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/queue-4c50ebb3/rEhumAjdG_2O8Lak/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/queue-4c50ebb3/rEhumAjdG_2O8Lak/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/queue-4c50ebb3/rEhumAjdG_2O8Lak/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/queue-4c50ebb3/rEhumAjdG_2O8Lak/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/queue-4c50ebb3/rEhumAjdG_2O8Lak/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/queue-4c50ebb3/rEhumAjdG_2O8Lak/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/queue-4c50ebb3/rEhumAjdG_2O8Lak/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/queue-4c50ebb3/rEhumAjdG_2O8Lak/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"clean - Docs\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.morph-data.io/reference/en/cli-commands/clean\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://queue-4c50ebb3.mintlify.site/_mintlify/api/og/v2?division=CLI\u0026amp;title=clean\u0026amp;theme=1ea9e3a1164f35c7bbbbf9ab\u0026amp;signature=2cfce5972c6be3c79c603244047371751fd02ea0acf68ada99341c0a6887e6f6\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"clean - Docs\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://queue-4c50ebb3.mintlify.site/_mintlify/api/og/v2?division=CLI\u0026amp;title=clean\u0026amp;theme=1ea9e3a1164f35c7bbbbf9ab\u0026amp;signature=2cfce5972c6be3c79c603244047371751fd02ea0acf68ada99341c0a6887e6f6\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/queue-4c50ebb3/rEhumAjdG_2O8Lak/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#111827\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.morph-data.io/reference/en/cli-commands/clean\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/reference/en/cli-commands/clean.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.morph-data.io/#organization\",\"name\":\"Docs\",\"url\":\"https://docs.morph-data.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/queue-4c50ebb3/_HQi-05AKdEsS8di/assets/images/morph_logo_svg.svg?fit=max\u0026auto=format\u0026n=_HQi-05AKdEsS8di\u0026q=85\u0026s=a69926375f0832eee99cb53ed852c802\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.morph-data.io#website\",\"name\":\"Docs\",\"url\":\"https://docs.morph-data.io\",\"publisher\":{\"@id\":\"https://docs.morph-data.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.morph-data.io/reference/en/cli-commands/clean#webpage\",\"url\":\"https://docs.morph-data.io/reference/en/cli-commands/clean\",\"name\":\"clean\",\"dateModified\":\"2026-01-07T03:58:53.128Z\",\"isPartOf\":{\"@id\":\"https://docs.morph-data.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.morph-data.io/reference/en/cli-commands/clean#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.morph-data.io/reference/en/cli-commands/clean#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"CLI\",\"item\":\"https://docs.morph-data.io/reference/en/cli-commands/version\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"clean\",\"item\":\"https://docs.morph-data.io/reference/en/cli-commands/clean\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.morph-data.io/reference/en/cli-commands/clean#article\",\"headline\":\"clean\",\"name\":\"clean\",\"url\":\"https://docs.morph-data.io/reference/en/cli-commands/clean\",\"mainEntityOfPage\":{\"@id\":\"https://docs.morph-data.io/reference/en/cli-commands/clean#webpage\"},\"dateModified\":\"2026-01-07T03:58:53.128Z\",\"publisher\":{\"@id\":\"https://docs.morph-data.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.morph-data.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/reference/en/cli-commands/clean.md","siteName":"Docs","nav":{"global":{"anchors":[{"anchor":"Changelog","href":"https://www.morph-data.io/changelog","icon":"rss"},{"anchor":"Connectors","href":"https://www.morph-data.io/tools/connectors/database","icon":"plug"},{"anchor":"Code Snippets","href":"https://www.morph-data.io/tools/snippets/undefined","icon":"brackets-curly"},{"anchor":"Components","href":"https://morph-components.vercel.app/docs/introduction","icon":"code"}]},"versions":[{"version":"English","tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":"/docs/en/getting-started/why-morph"}]},{"tab":"Reference","groups":[{"group":"Framework","pages":[{"title":"morph_project.yml","href":"/reference/en/framework/morph-project"}]},{"group":"SQL","pages":[{"title":"config","href":"/reference/en/sql/config"},{"title":"load_data","href":"/reference/en/sql/load_data"}]},{"group":"Python","pages":[{"title":"MorphGlobalContext","href":"/reference/en/python/morph-global-context"},{"title":"@morph.func","href":"/reference/en/python/morph-func"},{"title":"@morph.load_data","href":"/reference/en/python/morph-load_data"},{"title":"@morph.variables","href":"/reference/en/python/morph-variables"}]},{"group":"morph_lib.database","pages":[{"title":"execute_sql","href":"/reference/en/morph_lib/database/execute_sql"},{"title":"insert_records","href":"/reference/en/morph_lib/database/insert_records"},{"title":"update_records","href":"/reference/en/morph_lib/database/update_records"},{"title":"insert_or_update_records","href":"/reference/en/morph_lib/database/insert_or_update_records"},{"title":"delete_records","href":"/reference/en/morph_lib/database/delete_records"}]},{"group":"morph_lib.api","pages":[{"title":"get_auth_token","href":"/reference/en/morph_lib/api/get_auth_token"}]},{"group":"morph_lib.stream","pages":[{"title":"create_chunk","href":"/reference/en/morph_lib/stream/create_chunk"},{"title":"stream_chat","href":"/reference/en/morph_lib/stream/stream_chat"}]},{"group":"CLI","pages":[{"title":"--version","href":"/reference/en/cli-commands/version"},{"title":"run","href":"/reference/en/cli-commands/run"},{"title":"compile","description":null,"href":"/reference/en/cli-commands/compile"},{"title":"clean","href":"/reference/en/cli-commands/clean"},{"title":"init","description":null,"href":"/reference/en/cli-commands/init"},{"title":"new","href":"/reference/en/cli-commands/new"},{"title":"config","href":"/reference/en/cli-commands/config"},{"title":"deploy","href":"/reference/en/cli-commands/deploy"},{"title":"serve","href":"/reference/en/cli-commands/serve"},{"title":"context","href":"/reference/en/cli-commands/context"}]},{"group":"Deprecated","pages":[{"group":"morph_lib.ai","pages":[{"title":"text_to_sql","href":"/reference/en/morph_lib/ai/text_to_sql"},{"title":"text_to_plotly","href":"/reference/en/morph_lib/ai/text_to_plotly"},{"title":"text_to_matplotlib","href":"/reference/en/morph_lib/ai/text_to_matplotlib"},{"title":"text_to_markdown","href":"/reference/en/morph_lib/ai/text_to_markdown"},{"title":"text_to_html","href":"/reference/en/morph_lib/ai/text_to_html"}]}]}]},{"tab":"Troubleshooting","pages":[{"title":"Troubleshooting","href":"/troubleshooting/en/cli/deployment-issues"}]}]},{"version":"日本語","pages":[{"title":"日本語","href":"/reference/ja/cli-commands/clean"}]}]},"basePath":"","title":"clean - Docs","buildId":"dpl_715YoAgvjTGBDdo8RtXmHKM22b5p","deploymentId":"dpl_715YoAgvjTGBDdo8RtXmHKM22b5p","dynamics":[],"chunks":[]}