The capy command syncs encrypted secrets with the remote, resolves conflicts, and initializes the project on first run. Sets git hooks, writes keep.lock.
Synopsis
capy [options]
Description
The bare capy command is the main sync loop. It authenticates you (if needed), fetches the remote values for the branch you’re on, and compares three sources: your local .env, the values pinned in keep.lock, and the remote.If all three agree, Capy prints Everything is up to date! and stops. If anything differs, it prints a comparison table and asks what you want to do. Which choices you get depends on which sources differ - Commit and push all local values, Retrieve all pinned values, Retrieve all remote values, Individually resolve, and Continue working. Nothing is pushed unless you pick the commit action. When the result changes keep.lock, commit that tracked file with your code changes.On first run in a project, it interactively initializes the project - picking an org, picking or creating a project, encrypting your existing .env, and writing keep.lock.See Syncing secrets for the full flow.
Options
Flag
Description
--env-path <path>
Use a custom .env file location for this sync.
-v, --verbose
Enable detailed logging on stderr. Useful when debugging sync issues.
-f, --force
Advertised as re-encrypting existing variables. The bare sync implementation does not currently apply this option.
-d, --dry-run
Suppresses the post-initialization offer to add the AI-agent instructions. It does not make the bare sync read-only.
--web
Render supported setup and conflict steps in a local browser instead of terminal prompts.
capy --dry-run is not a safe preview of the bare sync in 0.9.8. The sync can still rewrite .env, update keep.lock, and push to the remote. Use capy status and capy diff to inspect state without syncing.
Examples
# Sync secrets in the current projectcapy# Read secrets from a different .env filecapy --env-path config/.env.local# Sync with detailed loggingcapy --verbose
First-run behavior
On first run (no keep.lock in the project), Capy:
Authenticates you, reusing an existing session if you have one and opening your browser to sign in if you don’t.
Prompts for an organization (or creates one, which generates a seed phrase).
Prompts for a project - New project, or one of the org’s existing ones. If the org has no projects yet, it just asks for a name.
Asks what branch the project should start with: development (the default) or a name you type.
Asks you to confirm, then encrypts every value in your .env and uploads the ciphertext.
Writes a commented-out copy of your original .env to .env.pre-capy.old (gitignored).
Rewrites .env with capy:… snippets and gitignores it.
Writes keep.lock - a small versioning manifest with no keys or secret values. Commit it with your project changes.
Installs post-checkout and post-merge git hooks, which run capy status after branch switches and merges.
If you have no .env (or it holds no variables), Capy stops after writing keep.lock, updating .gitignore, and installing the hooks. It stages keep.lock but leaves the commit to you, and tells you to add secrets and run capy push. If you pick an existing project at step 3, Capy skips the branch prompt and pulls that project’s development branch into the directory instead - again staging keep.lock for you to commit.Capy reinstalls the git hooks whenever a sync completes (it skips the reinstall if you pick Continue working), and the install is idempotent - so capy cleanup removes them only until the next time a sync finishes.
Last modified on October 2, 2026
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Capy","colors":{"primary":"#111827","light":"#F3F4F6","dark":"#1F2937"},"logo":{"light":"https://mintcdn.com/capy-c95c79c0/0lifWkS5AhgCAL5O/logo/light.svg?fit=max\u0026auto=format\u0026n=0lifWkS5AhgCAL5O\u0026q=85\u0026s=6dbaa69a4097411658ee2d1f2f0742d5","dark":"https://mintcdn.com/capy-c95c79c0/0lifWkS5AhgCAL5O/logo/dark.svg?fit=max\u0026auto=format\u0026n=0lifWkS5AhgCAL5O\u0026q=85\u0026s=051c89470aaa2b19badeeb3b1963c140"},"favicon":"https://mintcdn.com/capy-c95c79c0/0lifWkS5AhgCAL5O/favicon.svg?fit=max\u0026auto=format\u0026n=0lifWkS5AhgCAL5O\u0026q=85\u0026s=e9e83bcf39f9961c84f829fe4ffbd771","navbar":{"links":[{"href":"https://github.com/capysc/capy-cli/releases","label":"Releases"}],"primary":{"type":"github","href":"https://github.com/capysc/capy-cli"}},"footer":{"socials":{"github":"https://github.com/capysc"}},"seo":{"metatags":{"og:site_name":"Capy","og:image:width":"1200","og:image:height":"630","twitter:card":"summary_large_image","robots":"index, follow"}},"integrations":{"amplitude":{"apiKey":"cc149792a0bc4296a9cfbab10a095306"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"metadata":{"timestamp":true},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"capy-c95c79c0","hasAudioNarration":false,"actualSubdomain":"capy-c95c79c0","customDomains":["capy.sc"],"gitSource":{"type":"github","owner":"capysc","repo":"docs","deployBranch":"main","isPrivate":true,"contentDirectory":"","mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6afff0c410972e65991ee1b3","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"CLI reference","count":37},{"language":"default","tag":"Deploying","count":9},{"language":"default","tag":"Getting started","count":8},{"language":"default","tag":"Using Capy","count":7},{"language":"default","tag":"Comparisons","count":6},{"language":"default","tag":"Under the hood","count":3},{"language":"default","tag":"Organizations","count":3},{"language":"default","tag":"Team","count":3},{"language":"default","tag":"Branches","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"cli/capy","slug":"/cli/capy","pageMetadata":{"title":"capy Command: Sync Encrypted Secrets","sidebarTitle":"capy","description":"The capy command syncs encrypted secrets with the remote, resolves conflicts, and initializes the project on first run. Sets git hooks, writes keep.lock.","href":"/cli/capy"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"The capy command syncs encrypted secrets with the remote, resolves conflicts, and initializes the project on first run. Sets git hooks, writes keep.lock.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"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={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`synopsis`,children:`Synopsis`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--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:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`capy`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [options]`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`description`,children:`Description`}),`\n`,_jsxs(_components.p,{children:[`The bare `,_jsx(_components.code,{children:`capy`}),` command is the main sync loop. It authenticates you (if needed), fetches the remote values for the branch you’re on, and compares three sources: your local `,_jsx(_components.code,{children:`.env`}),`, the values pinned in `,_jsx(_components.code,{children:`keep.lock`}),`, and the remote.`]}),`\n`,_jsxs(_components.p,{children:[`If all three agree, Capy prints `,_jsx(_components.code,{children:`Everything is up to date!`}),` and stops. If anything differs, it prints a comparison table and asks what you want to do. Which choices you get depends on which sources differ - `,_jsx(_components.strong,{children:`Commit and push all local values`}),`, `,_jsx(_components.strong,{children:`Retrieve all pinned values`}),`, `,_jsx(_components.strong,{children:`Retrieve all remote values`}),`, `,_jsx(_components.strong,{children:`Individually resolve`}),`, and `,_jsx(_components.strong,{children:`Continue working`}),`. Nothing is pushed unless you pick the commit action. When the result changes `,_jsx(_components.code,{children:`keep.lock`}),`, commit that tracked file with your code changes.`]}),`\n`,_jsxs(_components.p,{children:[`On first run in a project, it interactively initializes the project - picking an org, picking or creating a project, encrypting your existing `,_jsx(_components.code,{children:`.env`}),`, and writing `,_jsx(_components.code,{children:`keep.lock`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/using/syncing-secrets`,children:`Syncing secrets`}),` for the full flow.`]}),`\n`,_jsx(Heading,{level:`2`,id:`options`,children:`Options`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Flag`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--env-path \u003cpath>`})}),_jsxs(_components.td,{children:[`Use a custom `,_jsx(_components.code,{children:`.env`}),` file location for this sync.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`-v, --verbose`})}),_jsx(_components.td,{children:`Enable detailed logging on stderr. Useful when debugging sync issues.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`-f, --force`})}),_jsx(_components.td,{children:`Advertised as re-encrypting existing variables. The bare sync implementation does not currently apply this option.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`-d, --dry-run`})}),_jsx(_components.td,{children:`Suppresses the post-initialization offer to add the AI-agent instructions. It does not make the bare sync read-only.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--web`})}),_jsx(_components.td,{children:`Render supported setup and conflict steps in a local browser instead of terminal prompts.`})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`capy --dry-run`}),` is not a safe preview of the bare sync in 0.9.8. The sync can still rewrite `,_jsx(_components.code,{children:`.env`}),`, update `,_jsx(_components.code,{children:`keep.lock`}),`, and push to the remote. Use `,_jsx(_components.code,{children:`capy status`}),` and `,_jsx(_components.code,{children:`capy diff`}),` to inspect state without syncing.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Sync secrets in the current project`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`capy`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Read secrets from a different .env file`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`capy`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --env-path`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` config/.env.local`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Sync with detailed logging`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`capy`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --verbose`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`first-run-behavior`,children:`First-run behavior`}),`\n`,_jsxs(_components.p,{children:[`On first run (no `,_jsx(_components.code,{children:`keep.lock`}),` in the project), Capy:`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Authenticates you, reusing an existing session if you have one and opening your browser to sign in if you don’t.`}),`\n`,_jsx(_components.li,{children:`Prompts for an organization (or creates one, which generates a seed phrase).`}),`\n`,_jsxs(_components.li,{children:[`Prompts for a project - `,_jsx(_components.strong,{children:`New project`}),`, or one of the org’s existing ones. If the org has no projects yet, it just asks for a name.`]}),`\n`,_jsxs(_components.li,{children:[`Asks what branch the project should start with: `,_jsx(_components.code,{children:`development`}),` (the default) or a name you type.`]}),`\n`,_jsxs(_components.li,{children:[`Asks you to confirm, then encrypts every value in your `,_jsx(_components.code,{children:`.env`}),` and uploads the ciphertext.`]}),`\n`,_jsxs(_components.li,{children:[`Writes a commented-out copy of your original `,_jsx(_components.code,{children:`.env`}),` to `,_jsx(_components.code,{children:`.env.pre-capy.old`}),` (gitignored).`]}),`\n`,_jsxs(_components.li,{children:[`Rewrites `,_jsx(_components.code,{children:`.env`}),` with `,_jsx(_components.code,{children:`capy:…`}),` snippets and gitignores it.`]}),`\n`,_jsxs(_components.li,{children:[`Writes `,_jsx(_components.code,{children:`keep.lock`}),` - a small versioning manifest with no keys or secret values. Commit it with your project changes.`]}),`\n`,_jsxs(_components.li,{children:[`Installs `,_jsx(_components.code,{children:`post-checkout`}),` and `,_jsx(_components.code,{children:`post-merge`}),` git hooks, which run `,_jsx(_components.code,{children:`capy status`}),` after branch switches and merges.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`If you have no `,_jsx(_components.code,{children:`.env`}),` (or it holds no variables), Capy stops after writing `,_jsx(_components.code,{children:`keep.lock`}),`, updating `,_jsx(_components.code,{children:`.gitignore`}),`, and installing the hooks. It stages `,_jsx(_components.code,{children:`keep.lock`}),` but leaves the commit to you, and tells you to add secrets and run `,_jsx(_components.code,{children:`capy push`}),`. If you pick an existing project at step 3, Capy skips the branch prompt and pulls that project’s `,_jsx(_components.code,{children:`development`}),` branch into the directory instead - again staging `,_jsx(_components.code,{children:`keep.lock`}),` for you to commit.`]}),`\n`,_jsxs(_components.p,{children:[`Capy reinstalls the git hooks whenever a sync completes (it skips the reinstall if you pick `,_jsx(_components.strong,{children:`Continue working`}),`), and the install is idempotent - so `,_jsx(_components.code,{children:`capy cleanup`}),` removes them only until the next time a sync finishes.`]})]})}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":{"config":{},"pageMetadata":{"title":"capy Command: Sync Encrypted Secrets","sidebarTitle":"capy","description":"The capy command syncs encrypted secrets with the remote, resolves conflicts, and initializes the project on first run. Sets git hooks, writes keep.lock.","href":"/cli/capy"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Synopsis","slug":"synopsis","depth":2,"children":[]},{"title":"Description","slug":"description","depth":2,"children":[]},{"title":"Options","slug":"options","depth":2,"children":[]},{"title":"Examples","slug":"examples","depth":2,"children":[]},{"title":"First-run behavior","slug":"first-run-behavior","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"capy-c95c79c0","siteName":"Capy","title":"capy Command: Sync Encrypted Secrets - Capy","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-02T18:01:49.072Z","gitLastModified":"2026-10-02T02:52:41.000Z","originalFileLocation":"cli/capy.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=\"description\" content=\"The capy command syncs encrypted secrets with the remote, resolves conflicts, and initializes the project on first run. Sets git hooks, writes keep.lock.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Capy\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index, follow\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/capy-c95c79c0/PO8F9vHytDqmbRar/_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=\"/docs/mintlify-assets/_mintlify/favicons/capy-c95c79c0/PO8F9vHytDqmbRar/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/capy-c95c79c0/PO8F9vHytDqmbRar/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/capy-c95c79c0/PO8F9vHytDqmbRar/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/capy-c95c79c0/PO8F9vHytDqmbRar/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/capy-c95c79c0/PO8F9vHytDqmbRar/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/capy-c95c79c0/PO8F9vHytDqmbRar/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/capy-c95c79c0/PO8F9vHytDqmbRar/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/capy-c95c79c0/PO8F9vHytDqmbRar/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"capy Command: Sync Encrypted Secrets - Capy\">\u003cmeta data-mint-head property=\"og:description\" content=\"The capy command syncs encrypted secrets with the remote, resolves conflicts, and initializes the project on first run. Sets git hooks, writes keep.lock.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Capy\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://capy.sc/docs/cli/capy\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://capy-c95c79c0.mintlify.site/docs/_mintlify/api/og/v2?division=CLI+reference\u0026amp;title=capy+Command%3A+Sync+Encrypted+Secrets\u0026amp;description=The+capy+command+syncs+encrypted+secrets+with+the+remote%2C+resolves+conflicts%2C+and+initializes+the+project+on+first+run.+Sets+git+hooks%2C+writes+keep.lock.\u0026amp;theme=f09b04d0a98ab37048027f8b\u0026amp;signature=7860f98a864d7547a297ba92c2b63d89aed6301ea34af990c83a21f62900325f\">\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=\"capy Command: Sync Encrypted Secrets - Capy\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"The capy command syncs encrypted secrets with the remote, resolves conflicts, and initializes the project on first run. Sets git hooks, writes keep.lock.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://capy-c95c79c0.mintlify.site/docs/_mintlify/api/og/v2?division=CLI+reference\u0026amp;title=capy+Command%3A+Sync+Encrypted+Secrets\u0026amp;description=The+capy+command+syncs+encrypted+secrets+with+the+remote%2C+resolves+conflicts%2C+and+initializes+the+project+on+first+run.+Sets+git+hooks%2C+writes+keep.lock.\u0026amp;theme=f09b04d0a98ab37048027f8b\u0026amp;signature=7860f98a864d7547a297ba92c2b63d89aed6301ea34af990c83a21f62900325f\">\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=\"/docs/mintlify-assets/_mintlify/favicons/capy-c95c79c0/PO8F9vHytDqmbRar/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Capy\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#111827\">\u003clink data-mint-head rel=\"canonical\" href=\"https://capy.sc/docs/cli/capy\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/cli/capy.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://capy.sc/#organization\",\"name\":\"Capy\",\"url\":\"https://capy.sc\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/capy-c95c79c0/0lifWkS5AhgCAL5O/logo/light.svg?fit=max\u0026auto=format\u0026n=0lifWkS5AhgCAL5O\u0026q=85\u0026s=6dbaa69a4097411658ee2d1f2f0742d5\"}},{\"@type\":\"WebSite\",\"@id\":\"https://capy.sc/docs#website\",\"name\":\"Capy\",\"url\":\"https://capy.sc/docs\",\"publisher\":{\"@id\":\"https://capy.sc/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://capy.sc/docs/cli/capy#webpage\",\"url\":\"https://capy.sc/docs/cli/capy\",\"name\":\"capy Command: Sync Encrypted Secrets\",\"description\":\"The capy command syncs encrypted secrets with the remote, resolves conflicts, and initializes the project on first run. Sets git hooks, writes keep.lock.\",\"dateModified\":\"2026-10-02T02:52:41.000Z\",\"isPartOf\":{\"@id\":\"https://capy.sc/docs#website\"},\"breadcrumb\":{\"@id\":\"https://capy.sc/docs/cli/capy#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://capy.sc/docs/cli/capy#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Capy\",\"item\":\"https://capy.sc/docs\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"capy Command: Sync Encrypted Secrets\",\"item\":\"https://capy.sc/docs/cli/capy\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://capy.sc/docs/cli/capy#article\",\"headline\":\"capy Command: Sync Encrypted Secrets\",\"name\":\"capy Command: Sync Encrypted Secrets\",\"description\":\"The capy command syncs encrypted secrets with the remote, resolves conflicts, and initializes the project on first run. Sets git hooks, writes keep.lock.\",\"url\":\"https://capy.sc/docs/cli/capy\",\"mainEntityOfPage\":{\"@id\":\"https://capy.sc/docs/cli/capy#webpage\"},\"dateModified\":\"2026-10-02T02:52:41.000Z\",\"publisher\":{\"@id\":\"https://capy.sc/#organization\"},\"isPartOf\":{\"@id\":\"https://capy.sc/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Capy\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Capy\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/cli/capy.md","siteName":"Capy","nav":{"global":null,"groups":[{"group":" ","pages":[{"title":"Capy: Git-Native Secrets Manager for Engineering Teams","sidebarTitle":"Overview","href":"/index"}]},{"group":"Getting started","pages":[{"title":"Install the Capy CLI","sidebarTitle":"Install","icon":"download","href":"/getting-started/install"},{"title":"Manage Node.js Environment Variables Securely (Capy)","sidebarTitle":"Node.js","icon":"node-js","href":"/getting-started/nodejs"},{"title":"Next.js Environment Variables: Encrypted Secrets","sidebarTitle":"Next.js","icon":"react","href":"/getting-started/nextjs"},{"title":"Python Secrets Management: Encrypted .env Files","sidebarTitle":"Python","icon":"python","href":"/getting-started/python"},{"title":"Go Environment Variables: Secrets Manager for Go Apps","sidebarTitle":"Go","icon":"golang","href":"/getting-started/go"},{"title":"Ruby \u0026 Rails Secrets Management with Capy","sidebarTitle":"Ruby","icon":"gem","href":"/getting-started/ruby"},{"title":"Rust Secrets Management: Encrypted Env for Cargo","sidebarTitle":"Rust","icon":"rust","href":"/getting-started/rust"},{"title":"Encrypted Secrets for PHP, Java, Elixir, Deno \u0026 More","sidebarTitle":"Other runtimes","icon":"terminal","href":"/getting-started/other-runtimes"}]},{"group":"Using Capy","pages":[{"title":"Sync Encrypted .env Across Your Team (Capy)","sidebarTitle":"Syncing secrets","icon":"arrows-rotate","href":"/using/syncing-secrets"},{"title":"Questions Capy Asks Agents: Elicitations","sidebarTitle":"Agent questions","icon":"robot","href":"/using/agent-questions"},{"title":"Adding secrets","sidebarTitle":"Adding secrets","icon":"plus","href":"/using/adding-secrets"},{"title":"Edit Secrets: Capy TUI vs. Editing .env Directly","sidebarTitle":"Editing secrets","icon":"pen-to-square","href":"/using/editing-secrets"},{"title":"Removing secrets","sidebarTitle":"Removing secrets","icon":"minus","href":"/using/removing-secrets"},{"title":"How capy run Decrypts Secrets at Runtime","sidebarTitle":"Running your app","icon":"play","href":"/using/running-your-app"},{"title":"Capy CLI license","sidebarTitle":"License \u0026 AGPL","href":"/using/license"}]},{"group":"Deploying","pages":[{"title":"Deploy Encrypted Secrets to Production with Capy","sidebarTitle":"Overview","icon":"rocket","href":"/using/deploying"},{"title":"Vercel","sidebarTitle":"Vercel","icon":"triangle","href":"/using/deploying/vercel"},{"title":"Cloudflare Workers and Pages","sidebarTitle":"Cloudflare","icon":"cloudflare","href":"/using/deploying/cloudflare"},{"title":"Docker and containers","sidebarTitle":"Docker","icon":"docker","href":"/using/deploying/docker"},{"title":"VPS and self-managed servers","sidebarTitle":"VPS / droplet","icon":"server","href":"/using/deploying/vps"},{"title":"Fly.io","sidebarTitle":"Fly.io","icon":"plane","href":"/using/deploying/fly"},{"title":"Railway, Render, and Heroku","sidebarTitle":"Railway / Render / Heroku","icon":"server","href":"/using/deploying/railway-render-heroku"},{"title":"GitHub Actions","sidebarTitle":"GitHub Actions","icon":"github","href":"/using/deploying/github-actions"},{"title":"AWS Lambda","sidebarTitle":"AWS Lambda","icon":"aws","href":"/using/deploying/aws-lambda"}]},{"group":"Organizations","pages":[{"title":"Capy Organizations: Cryptographic Tenant Boundary","sidebarTitle":"Organizations","icon":"building","href":"/using/organizations/overview"},{"title":"Switch Between Capy Organizations on One Machine","sidebarTitle":"Switching organizations","icon":"arrows-left-right","href":"/using/organizations/switching"},{"title":"Move Your Capy Identity to a New Computer","sidebarTitle":"Switching computers","icon":"laptop","href":"/using/organizations/switching-computers"}]},{"group":"Branches","pages":[{"title":"Branch-Aware Secrets: Per-Environment .env Files","sidebarTitle":"Branches","icon":"code-branch","href":"/using/branches/overview"},{"title":"Protected Branches: Lock Down Production Secrets","sidebarTitle":"Protected branches","icon":"shield","href":"/using/branches/protected"}]},{"group":"Team","pages":[{"title":"Invite Teammates to Capy: Share Encrypted Access","sidebarTitle":"Inviting users","icon":"user-plus","href":"/using/team/inviting"},{"title":"Capy Roles: Owner, Admin, Project Admin, Member","sidebarTitle":"Roles","icon":"user-shield","href":"/using/team/roles"},{"title":"Remove a Teammate: O(1) Revocation in Capy","sidebarTitle":"Kicking users","description":"Kick a teammate from Capy in O(1) to block future service-assisted key unwraps. Rotate or rekey material that may already have been copied.","icon":"user-minus","href":"/using/team/kicking"}]},{"group":"CLI reference","pages":[{"title":"capy Command: Sync Encrypted Secrets","sidebarTitle":"capy","href":"/cli/capy"},{"title":"capy run: Inject Decrypted Secrets at Runtime","sidebarTitle":"capy run","description":"Run any command with decrypted secrets in its process environment. Capy supports local mode and either deployed runtime-pair format, with full signal forwarding.","href":"/cli/run"},{"title":"capy status: Show Drift Between Local \u0026 Remote","sidebarTitle":"capy status","href":"/cli/status"},{"title":"capy edit: Interactive TUI for Secret Editing","sidebarTitle":"capy edit","href":"/cli/edit"},{"title":"capy add: Add Secrets","sidebarTitle":"capy add","href":"/cli/add"},{"title":"capy remove: Delete Secrets","sidebarTitle":"capy remove","href":"/cli/remove"},{"title":"capy list: List Variables on a Branch","sidebarTitle":"capy list","href":"/cli/list"},{"title":"capy push: Publish Local Secret Changes","sidebarTitle":"capy push","href":"/cli/push"},{"title":"capy connect: Link a Credential Provider","sidebarTitle":"capy connect","href":"/cli/connect"},{"title":"capy rotate: Rotate Managed Credentials","sidebarTitle":"capy rotate","href":"/cli/rotate"},{"title":"capy deploy: Set Up Encrypted Production Secrets","sidebarTitle":"capy deploy","href":"/cli/deploy"},{"title":"capy agents: Add Capy Instructions for Coding Agents","sidebarTitle":"capy agents","href":"/cli/agents"},{"title":"capy help: Inspect the Command Reference","sidebarTitle":"capy help","href":"/cli/help"},{"title":"capy transport: Send Keys to a Browser","sidebarTitle":"capy transport","href":"/cli/transport"},{"title":"capy pair: Pair This Machine Through a Browser","sidebarTitle":"capy pair","href":"/cli/pair"},{"title":"capy lock: Lock a Local-Only Key","sidebarTitle":"capy lock","href":"/cli/lock"},{"title":"capy invite: Add a Teammate to Your Organization","sidebarTitle":"capy invite","href":"/cli/invite"},{"title":"capy redeem: Accept an Invite to a Capy Org","sidebarTitle":"capy redeem","href":"/cli/redeem"},{"title":"capy kick: Remove a Teammate from Your Org","sidebarTitle":"capy kick","href":"/cli/kick"},{"title":"capy users: Interactive Team \u0026 Role Management","sidebarTitle":"capy users","href":"/cli/users"},{"title":"capy projects: List Organization Projects","sidebarTitle":"capy projects","href":"/cli/projects"},{"title":"capy project: Create, Delete, and Restore Projects","sidebarTitle":"capy project","href":"/cli/project"},{"title":"capy secrets: Inspect Secret Names Across an Organization","sidebarTitle":"capy secrets","href":"/cli/secrets"},{"title":"capy grant-branch: Scriptable Branch Access","sidebarTitle":"capy grant-branch","href":"/cli/grant-branch"},{"title":"capy revoke-branch: Scriptable Branch Revoke","sidebarTitle":"capy revoke-branch","href":"/cli/revoke-branch"},{"title":"capy branch: List, Delete, Switch Secret Branches","sidebarTitle":"capy branch","href":"/cli/branch"},{"title":"capy checkout: Switch or Create a Secret Branch","sidebarTitle":"capy checkout","href":"/cli/checkout"},{"title":"capy org: Switch Your Active Organization","sidebarTitle":"capy org","href":"/cli/org"},{"title":"capy info: Show Current Session \u0026 Project","sidebarTitle":"capy info","href":"/cli/info"},{"title":"capy byoc: Connect to a Self-Hosted Capy Instance","sidebarTitle":"capy byoc","href":"/cli/byoc"},{"title":"capy profile and use: Manage CLI Profiles","sidebarTitle":"capy profile","href":"/cli/profile"},{"title":"capy logout: End Session and Clear Cached Keys","sidebarTitle":"capy logout","href":"/cli/logout"},{"title":"capy recover: Restore a Lost Master Key","sidebarTitle":"capy recover","href":"/cli/recover"},{"title":"capy decrypt: Decrypt Secrets During Recovery","sidebarTitle":"capy decrypt","href":"/cli/decrypt"},{"title":"capy end-recover: Clean Up Recovery Files","sidebarTitle":"capy end-recover","href":"/cli/end-recover"},{"title":"capy system: Manage Connector Credentials","sidebarTitle":"capy system","href":"/cli/system"},{"title":"capy cleanup: Remove Capy Git Hooks","sidebarTitle":"capy cleanup","href":"/cli/cleanup"}]},{"group":"Under the hood","pages":[{"title":"Capy Architecture: How CLI and Service Fit Together","sidebarTitle":"Architecture","icon":"sitemap","href":"/internals/architecture"},{"title":"Zero-Trust Secrets Management: How Capy Works","sidebarTitle":"Zero trust","icon":"shield-halved","href":"/internals/zero-trust"},{"title":"Capy Cryptography: BIP-39 to AES-256-GCM","sidebarTitle":"Cryptography","icon":"shield-halved","href":"/internals/cryptography"}]},{"group":"Comparisons","pages":[{"title":"Best Secrets Manager: Capy vs. Doppler, 1Password \u0026 More","sidebarTitle":"Choosing a secrets tool","href":"/comparisons/index"},{"title":"Capy vs. 1Password CLI: Secrets for Developers","sidebarTitle":"Capy and 1Password CLI","href":"/comparisons/1password"},{"title":"Capy vs. Doppler: Secrets Management Comparison","sidebarTitle":"Capy and Doppler","href":"/comparisons/doppler"},{"title":"Capy vs. Infisical: Client- vs. Server-Side E2EE","sidebarTitle":"Capy and Infisical","href":"/comparisons/infisical"},{"title":"Capy vs. AWS Secrets Manager: Different Jobs","sidebarTitle":"Capy and AWS Secrets Manager","href":"/comparisons/aws-secrets-manager"},{"title":"Capy vs. SOPS: Productized vs. DIY Secret Encryption","sidebarTitle":"Capy and SOPS","href":"/comparisons/sops"}]}]},"basePath":"","title":"capy Command: Sync Encrypted Secrets - Capy","deploymentId":"dpl_53YqbBPsHdrqSGqXiWPGU7csRVod","buildId":"dpl_53YqbBPsHdrqSGqXiWPGU7csRVod","dynamics":[],"chunks":[]}