[{"data":1,"prerenderedAt":435},["ShallowReactive",2],{"project-40191510":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":29,"sentiment":30,"stance_mix":31,"scored_comments":36,"aspects":37,"strip":44,"post_text":47,"what":48,"said":62,"maker_in_thread":149,"shape":154,"grid":159,"attempts":396,"same_week":397,"maker_shows":244,"maker_hidden":427,"reader_version":428,"card":429},"40191510","Dotenv","Dotenv, if it is a Unix utility","title","Show HN: Dotenv, if it is a Unix utility","https:\u002F\u002Fgithub.com\u002Fgyf304\u002Fdotenv","github.com","gyf304",1714335946,2024,225,100,338,3515,10,"notable","dev_tools","environment variable loader","cli",[24,25,26,27,28],"dotenv","env file","environment variables","unix utility","shell","roasted",-0.444,{"positive":32,"neutral":33,"mixed":34,"critical":35},2,6,0,12,20,{"idea":38,"docs":40,"design":42,"execution":43},{"positive":32,"critical":39},11,{"positive":34,"critical":41},1,{"positive":34,"critical":34},{"positive":34,"critical":34},[45,34,34,34,34,34,45,41,41,34,34,41,34,41,45,41,34,34,34,34,34,34,34,41,41,34,46,45,34,34,41,45,41,34,41,34,34,34,34,41],3,5,"I like the idea of using dotenv files, but I dislike having to use different language-specific libraries to read them.\n\nTo solve this, I created a small utility that lets you prefix any command with \"dotenv\" to load the \".env\" file.\n\nThis is how I imagine dotenv would work if it had started as a UNIX utility rather than a Node.js library.",{"problem":49,"audience":55,"pricing":55,"motivation":56,"time_to_build":55,"stack":60,"openness":61,"stage":61,"team_size":61},{"value":50,"source":51,"evidence":52},"Loading .env files without using language-specific libraries","maker",[53],{"id":54},"post",null,{"value":57,"source":51,"evidence":58},"Dislikes using different language-specific libraries to read dotenv files",[59],{"id":54},[],"unknown",{"praise":63,"objections":72,"requests":114,"questions":121,"alternatives":126},[64],{"value":65,"source":66,"evidence":67},"Explicit invocation avoids hidden environment behavior","commenter",[68],{"id":69,"by":70,"text":71},"40192340","kelnos","I've used direnv, but I think a nice property of OP's dotenv is that it's explicit: if I want to pass env vars, I run my program under it. If I don't, then I don't. There's no…",[73,88,99],{"value":74,"source":66,"evidence":75},"Sourcing .env in shell is simpler and already works",[76,80,84],{"id":77,"by":78,"text":79},"40192333","mongol","Would not sh -c '. .env; echo $MY_VAR' do the same thing? (I am not in front of a shell at the moment.)",{"id":81,"by":82,"text":83},"40194948","tuyiown","Please just see this `env -S \"$(cat .env)\" \u003Ccmd>` Believe it or not that’s all you need. > S, --split-string=S process and split S into separate arguments; used to pass multiple…",{"id":85,"by":86,"text":87},"40195295","prmoustache","I don't understand what more it does than sourcing a file on your shell would? Anyone can explain?",{"value":89,"source":66,"evidence":90},"Existing tools like direnv and dotenvx already cover this",[91,95],{"id":92,"by":93,"text":94},"40192111","petepete","I think direnv already does a good job in this space, and it's already available in your package manager. https:\u002F\u002Fdirenv.net\u002F",{"id":96,"by":97,"text":98},"40192399","grounder","Compare with dotenvx - https:\u002F\u002Fgithub.com\u002Fdotenvx\u002Fdotenvx This is my current tool of choice.",{"value":100,"source":66,"evidence":101},"Whitespace and comment handling breaks naive env $(cat .env) approaches",[102,106,110],{"id":103,"by":104,"text":105},"40195680","ibotty","This will fail with comments. Of course you can script around that as well (I have done so), but it's not bulletproof. It makes sense to have a dedicated tool for the job.",{"id":107,"by":108,"text":109},"40194241","arjvik","Has whitespace handling issues... but valiant effort!",{"id":111,"by":112,"text":113},"40195202","fire_lake","When your environment variable values have spaces (e.g. some connection strings) this doesn’t work iirc",[115],{"value":116,"source":66,"evidence":117},"Compatibility with Docker env file format",[118],{"id":119,"by":112,"text":120},"40195205","Does this accept the exact same format (including quotes and whitespace) as a Docker env file? That’s a key feature for me",[122],{"value":123,"source":66,"evidence":124},"What does it do beyond sourcing a file in the shell",[125],{"id":85,"by":86,"text":87},[127,131,135,142],{"value":128,"source":66,"evidence":129},"direnv",[130],{"id":92,"by":93,"text":94},{"value":132,"source":66,"evidence":133},"dotenvx",[134],{"id":96,"by":97,"text":98},{"value":136,"source":66,"evidence":137},"shdotenv",[138],{"id":139,"by":140,"text":141},"40192258","miohtama","There is also shdotenv that allows you to load different .env file formats and convert between them, e.g. for UNIX shell. https:\u002F\u002Fgithub.com\u002Fko1nksm\u002Fshdotenv",{"value":143,"source":66,"evidence":144},"dotenv-cli npm package",[145],{"id":146,"by":147,"text":148},"40194070","vishvananda","Doesn’t this already exist as https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fdotenv-cli ?",{"comments":41,"answered":34,"key":150},[151],{"id":152,"text":153},"40193158","This is a very neat project that seems to accomplish the same goal and have some extra features.",{"commenters":155,"max_depth":156,"maker_replies":41,"first_comment_mins":157,"lifespan_hours":158},62,9,59,157,[160,162,164,168,171,174,176,179,182,185,188,191,194,196,199,203,206,209,212,215,216,219,221,224,226,227,231,233,236,239,240,243,245,246,249,252,255,258,260,263,266,268,270,272,274,276,279,281,283,285,288,291,294,295,296,298,301,303,306,309,312,316,319,321,323,325,329,332,335,336,339,343,348,351,353,355,357,360,362,364,366,371,374,377,380,382,385,387,391,394],[92,34,41,161,93,34],"project\u002Fcritical\u002Fidea",[69,34,46,163,70,34],"project\u002Fpositive\u002Fidea",[165,34,34,166,167,34],"40192678","commenter\u002Fneutral\u002Fnone","TheRoque",[169,34,34,166,170,34],"40193003","3836293648",[172,34,34,166,173,34],"40193799","macintux",[175,34,34,166,167,34],"40204877",[177,34,34,166,178,34],"40194351","cortesoft",[180,34,34,166,181,34],"40194434","malicka",[183,34,34,166,184,34],"40195224","jeffhuys",[186,34,34,166,187,34],"40199386","withinboredom",[189,34,34,166,190,34],"40194532","kreetx",[192,34,34,166,193,34],"40195323","steezeburger",[195,34,34,166,190,34],"40195618",[197,34,34,166,198,34],"40198295","heurist",[200,34,45,201,202,34],"40192798","project\u002Fneutral\u002Fidea","reissbaker",[204,34,34,166,205,34],"40196553","frou_dh",[207,34,41,161,208,34],"40193755","hk1337",[210,34,34,166,211,34],"40195254","toastal",[213,34,34,166,214,34],"40201298","cheptsov",[81,41,41,161,82,34],[217,41,34,166,218,34],"40195413","kazinator",[220,41,34,166,218,34],"40195460",[222,41,34,166,223,34],"40196679","cholindo",[225,41,34,166,218,34],"40201189",[103,41,34,166,104,34],[228,41,41,229,230,34],"40197693","project\u002Fcritical\u002Fdocs","SOLAR_FIELDS",[232,41,34,166,82,34],"40195849",[234,41,34,166,235,34],"40196138","userb",[237,41,34,166,238,34],"40196942","chasil",[96,32,41,161,97,34],[241,45,34,242,218,34],"40201233","other\u002Fneutral\u002Fnone",[139,244,45,201,140,34],4,[152,244,34,242,11,41],[247,244,34,166,248,34],"40195322","sirwitti",[250,46,34,242,251,34],"40192130","tester457",[253,33,41,161,254,34],"40193634","whalesalad",[256,33,34,166,257,34],"40193713","netcraft",[259,33,34,166,254,34],"40193728",[261,33,34,166,262,34],"40194901","sureglymop",[264,33,34,166,265,34],"40195313","silversmith",[267,33,34,166,173,34],"40193815",[269,33,34,166,254,34],"40193962",[271,33,34,166,173,34],"40193982",[273,33,34,166,254,34],"40194015",[275,33,34,166,173,34],"40194034",[277,33,34,166,278,34],"40194381","colimbarna",[280,33,34,166,181,34],"40194493",[282,33,34,166,278,34],"40194576",[284,33,34,166,278,34],"40194504",[286,33,34,166,287,34],"40194238","GolDDranks",[289,33,34,166,290,34],"40200416","johnisgood",[292,33,41,161,293,34],"40193993","bentinata",[107,33,34,166,108,34],[111,33,34,166,112,34],[77,297,41,161,78,34],7,[299,297,34,166,300,34],"40192354","mixmastamyk",[302,297,34,166,70,34],"40192372",[304,297,34,166,305,34],"40192375","iokanuon",[307,297,46,163,308,34],"40192810","datascienced",[310,297,34,166,311,34],"40193444","emmanueloga_",[313,297,45,314,315,34],"40193644","project\u002Fneutral\u002Fnone","geysersam",[317,297,34,166,318,34],"40195101","kilroy123",[320,297,34,166,305,34],"40199420",[322,297,34,166,311,34],"40203945",[324,297,34,166,305,34],"40263266",[326,327,34,166,328,34],"40196868",8,"iDon",[330,156,34,166,331,34],"40198447","andy_ppp",[333,18,34,166,334,34],"40200964","belthesar",[146,39,41,161,147,34],[337,35,34,166,338,34],"40193860","supriyo-biswas",[340,341,34,166,342,34],"40195825",13,"wodenokoto",[344,345,45,346,347,34],"40193967",14,"project\u002Fneutral\u002Fdesign","KevinMS",[119,349,45,350,112,34],15,"project\u002Fneutral\u002Fexecution",[85,352,41,161,86,34],16,[354,352,34,166,193,34],"40195336",[356,352,34,166,218,34],"40195467",[358,352,34,166,359,34],"40196371","maple3142",[361,352,41,161,86,34],"40197026",[363,352,34,166,86,34],"40195774",[365,352,34,166,193,34],"40237385",[367,368,34,369,370,34],"40193012",17,"other\u002Fneutral\u002Fidea","kzrdude",[372,368,34,242,373,34],"40193313","fyrn_",[375,368,34,242,376,34],"40194267","forrestthewoods",[378,368,34,242,379,34],"40195021","imtringued",[381,368,34,242,376,34],"40195293",[383,368,34,242,384,34],"40195998","bandie91",[386,368,34,242,376,34],"40197846",[388,389,45,314,390,34],"40194932",18,"bitwize",[392,389,41,161,393,34],"40195106","masklinn",[395,389,34,166,390,34],"40196032",[],[398,403,407,412,417,422],{"id":399,"name":400,"points":401,"category":402},"40159278","NAND",420,"learning_science",{"id":404,"name":405,"points":406,"category":20},"40210627","Extension.js",381,{"id":408,"name":409,"points":410,"category":411},"40213562","where to stream",335,"consumer_social",{"id":413,"name":414,"points":415,"category":416},"40222051","Factful",222,"ai",{"id":418,"name":419,"points":420,"category":421},"40173237","Lanki",206,"productivity",{"id":423,"name":424,"points":425,"category":426},"40175087","tscircuit",197,"hardware",false,"v2",{"id":430,"name":5,"line":6,"ai":427,"cat":20,"year":13,"points":14,"comments":15,"rec":29,"s":431,"top":18,"kw":432,"maker":11,"domain":10,"tier":19,"attempts":34,"strip":433,"url":9,"mix":434,"praise":65,"objection":74,"sub":21},40191510,-0.44,[24,25,26,27,28],"3000003110010131000000011053001310100001",[32,33,34,35],1794036653890]