PageSourceSearch

https://app.nottana.com/assets/CXi4Iszm.js

js nottana.com collected 2026-10-02 01:37:55 UTC 9,031 bytes, 1 lines download raw bytes

1import{j as e,B as t,w as n,T as s,P as i}from"./DYw7LMfG.js";import{C as r}from"./D0A6qmcW.js";import{I as o,C as a,i as l}from"./DNA11vdE.js";import{L as h}from"./UqzzAnT4.js";import"./DXvvCRrN.js";import"./BFMbySPq.js";const d=({src:n,alt:i,caption:r})=>e.jsxs(t,{sx:{my:3},children:[e.jsx(t,{component:"img",src:`/docs/cli/env-import/${n}`,alt:i,loading:"lazy",sx:{width:"100%",display:"block",borderRadius:"14px",border:"1px solid",borderColor:"divider",boxShadow:"0 8px 24px rgba(15, 23, 42, 0.10)"}}),r&&e.jsx(s,{variant:"caption",sx:{display:"block",mt:1,color:"text.secondary"},children:r})]});d.propTypes={src:i.string.isRequired,alt:i.string.isRequired,caption:i.node};const c=({n:n,title:i,children:r})=>e.jsxs(t,{component:"section",sx:{mt:6},"data-testid":`import-env-step-${n}`,children:[e.jsxs(s,{component:"h2",sx:{fontSize:"1.35rem",fontWeight:600,mb:1.5},children:[n,". ",i]}),r]});c.propTypes={n:i.number.isRequired,title:i.string.isRequired,children:i.node};const p=({children:t})=>e.jsx(s,{sx:{fontSize:"1rem",lineHeight:1.7,mb:2},children:t});p.propTypes={children:i.node};const u=({children:n})=>e.jsx(t,{component:"pre",sx:{fontFamily:"monospace",fontSize:13,p:1.75,my:2,borderRadius:"10px",border:"1px solid",borderColor:"divider",backgroundColor:"action.hover",overflowX:"auto"},children:n});u.propTypes={children:i.node};const m=()=>{const i=l();return e.jsxs(t,{sx:{height:"100dvh",overflowY:"auto",WebkitOverflowScrolling:"touch"},"data-testid":"cli-import-env-scroll",children:[!i&&e.jsx(r,{}),e.jsxs(n,{maxWidth:"md",sx:{py:{xs:3,md:8},pb:{xs:12,md:14}},"data-testid":"cli-import-env",children:[e.jsx(s,{component:"h1",sx:{fontSize:{xs:"1.9rem",md:"2.4rem"},fontWeight:700,mb:2},children:"Move a project’s .env into your vault"}),e.jsxs(p,{children:["You have a project with a working ",e.jsx(o,{children:".env"}),". This walks you through putting those values in Nottana, getting back a file you can safely commit, and running your app with the real values injected — about five minutes, most of it reading."]}),e.jsxs(p,{children:[e.jsx("strong",{children:"Nothing is deleted and nothing is sent anywhere."})," Your file is read in the browser, never uploaded. The original stays on your disk exactly as it was until you choose to replace it."]}),e.jsxs(p,{children:["You will need the CLI installed and signed in:"," ",e.jsx(o,{children:"npm install -g @nottana/cli"})," then"," ",e.jsx(o,{children:"nottana login"}),". Full command reference is on"," ",e.jsx(t,{component:h,to:"/cli",sx:{color:"primary.main"},children:"the CLI page"}),"."]}),e.jsxs(c,{n:1,title:"Open the importer",children:[e.jsxs(p,{children:["In the web app go to ",e.jsx("strong",{children:"Settings → Developers"})," and press ",e.jsx("strong",{children:"Import a .env file"}),". It is desktop only — picking a file and reviewing seventy rows is not a phone job."]}),e.jsx(d,{src:"01-settings-developers.png",alt:"The Developers tab in Settings, showing the Import a .env file button",caption:"Settings → Developers. The same tab holds terminal sign-in."})]}),e.jsxs(c,{n:2,title:"Give it your file",children:[e.jsxs(p,{children:["Drag the file in, or press ",e.jsx("strong",{children:"Choose a file"}),". A"," ",e.jsx(o,{children:".env"})," is hidden by default in the macOS picker — press"," ",e.jsx(o,{children:"Cmd"})," ",e.jsx(o,{children:"Shift"})," ",e.jsx(o,{children:"."})," to reveal dotfiles. You can also paste the contents instead."]}),e.jsx(d,{src:"02-drop-your-env.png",alt:"The import wizard before a file is chosen, with a drop zone",caption:"The file is parsed in your browser. It is never uploaded."})]}),e.jsxs(c,{n:3,title:"See what it found",children:[e.jsx(p,{children:"The first step is a count and one worked example, so you know what is about to happen before you look at a table of seventy rows."}),e.jsx(d,{src:"03-step-1-your-file.png",alt:"Step 1 of the wizard, showing how many variables were found"})]}),e.jsxs(c,{n:4,title:"Choose what moves",children:[e.jsx(p,{children:"Secrets are ticked, configuration is not. That split is a starting point, not a filter — every line is listed and you can change any of them. Values are masked; the eye reveals one."}),e.jsxs(p,{children:[e.jsx("strong",{children:"Configuration is deliberately left behind."})," Putting"," ",e.jsx(o,{children:"PORT=3000"})," behind a vault lookup adds a network round trip and a way to fail to a value that was never secret."]}),e.jsx(d,{src:"04-step-2-choose-what-to-import.png",alt:"The wizard table with secrets pre-selected and config unselected",caption:"Four secrets ticked, three config values left alone. VITE_ values are config: they are compiled into the browser bundle, so they are already public."})]}),e.jsxs(c,{n:5,title:"Decide about commented-out values",children:[e.jsxs(p,{children:["Commented-out lines are copied to the new file exactly as they are, so a credential sitting behind a ",e.jsx(o,{children:"#"})," would still be committed. This step offers them: keep one and its value moves into the vault instead, with the comment rewritten in place."]}),e.jsx(p,{children:"This step only appears when your file has some."}),e.jsx(d,{src:"05-step-3-commented-out.png",alt:"The commented-out step, offering retired values"})]}),e.jsxs(c,{n:6,title:"Name it, and read the preview",children:[e.jsx(p,{children:"One item holds every value you picked, as custom fields. The preview is the whole file you are about to get."}),e.jsxs(p,{children:["The vault shows as ",e.jsx(o,{children:"<your vault>"})," here on purpose — you have not chosen one yet, and a plausible guess would be worse than a placeholder. A reference to a vault that does not exist fails loudly; a reference to the ",e.jsx("em",{children:"wrong"})," vault fails silently, by returning a different secret."]}),e.jsx(d,{src:"06-step-4-name-it-and-finish.png",alt:"The final wizard step with the item name and the full preview"})]}),e.jsxs(c,{n:7,title:"Pick a vault and save",children:[e.jsxs(p,{children:["The item opens with everything filled 
1in and the vault picker already showing. Choose one, or create one, then ",e.jsx("strong",{children:"Save"}),"."]}),e.jsx(p,{children:"Back here returns to the wizard with your whole review intact, so changing your mind costs nothing."}),e.jsx(d,{src:"07-choose-a-vault.png",alt:"The new item, pre-filled from the import, with the vault picker open",caption:"Save is unavailable until a vault is chosen — the file cannot be written before then."})]}),e.jsxs(c,{n:8,title:"Take the file",children:[e.jsxs(p,{children:["Saving hands you the rewritten file and names it. Every value you imported is now a ",e.jsx(o,{children:"nottana://"})," reference, so it is safe to commit — that is the whole point. Replace your"," ",e.jsx(o,{children:".env"})," with it when you are ready."]}),e.jsxs(p,{children:["It is written ",e.jsx("em",{children:"after"})," the save because the references name the vault, and the vault is not known until then."]})]}),e.jsxs(c,{n:9,title:"Run your app through Nottana",children:[e.jsxs(p,{children:["A ",e.jsx(o,{children:".env"})," full of references is inert to every other tool: read normally, your app receives the reference string instead of the secret and fails somewhere confusing."," ",e.jsx(o,{children:"nottana run"})," is what resolves them."]}),e.jsx(u,{children:"nottana run --env-file .env -- npm start"}),e.jsxs(p,{children:["Replace ",e.jsx(o,{children:"npm start"})," with however you normally start it. Each process needs its own — an API and a front end are two commands."]}),e.jsxs(p,{children:[e.jsxs("strong",{children:[e.jsx(o,{children:"--env-file"})," has no default."]})," ","Without it, ",e.jsx(o,{children:"run"})," only resolves references already in your environment and your file is ignored."]})]}),e.jsxs(c,{n:10,title:"If something does not resolve",children:[e.jsx(p,{children:"The run stops rather than passing a reference through, and names what failed. The usual causes:"}),e.jsxs(p,{children:[e.jsx("strong",{children:"No vault key on this machine."})," Run"," ",e.jsx(o,{children:"nottana unlock"}),", or keep one for a while with ",e.jsx(o,{children:"nottana login --store-key --120"})," — the number is the flag, in minutes, up to 720."]}),e.jsxs(p,{children:[e.jsx("strong",{children:"“No item matching …”"})," Vault and item names are matched exactly. If the item is right, check the vault spelling — the message names the vaults it did find."]}),e.jsxs(p,{children:[e.jsx("strong",{children:"“matches 2 items — which one?”"})," Two items share a title in one vault. Nottana refuses rather than guessing; rename one, or use the ",e.jsx(o,{children:"--id"})," it prints."]})]}),e.jsx(t,{sx:{mt:6,pt:3,borderTop:"1px solid",borderColor:"divider"},children:e.jsxs(p,{children:["Every command in detail is on"," ",e.jsx(t,{component:h,to:"/cli",sx:{color:"primary.main"},children:"the CLI page"}),"."]})})]}),!i&&e.jsx(a,{backgroundColor:"white",fullWidth:!0})]})};export{m as default};

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.