claude-code-switch
Version:
A CLI tool for managing and switching Claude Code model providers
1 lines • 11.8 kB
JavaScript
const a0_0x303a8f=a0_0x1d53;(function(_0x2a7023,_0x264d60){const _0x581bc3=a0_0x1d53,_0x240732=_0x2a7023();while(!![]){try{const _0xb6d845=-parseInt(_0x581bc3(0x206))/0x1*(parseInt(_0x581bc3(0x221))/0x2)+parseInt(_0x581bc3(0x213))/0x3+parseInt(_0x581bc3(0x1ea))/0x4+parseInt(_0x581bc3(0x220))/0x5+parseInt(_0x581bc3(0x22e))/0x6+parseInt(_0x581bc3(0x22b))/0x7*(parseInt(_0x581bc3(0x234))/0x8)+-parseInt(_0x581bc3(0x20a))/0x9*(parseInt(_0x581bc3(0x22f))/0xa);if(_0xb6d845===_0x264d60)break;else _0x240732['push'](_0x240732['shift']());}catch(_0x4c4fce){_0x240732['push'](_0x240732['shift']());}}}(a0_0x324c,0x61815));const a0_0x2d49d7=(function(){const _0x21a803=a0_0x1d53,_0x3d5992={};_0x3d5992[_0x21a803(0x23a)]='qblEw';const _0x19db59=_0x3d5992;let _0x25765a=!![];return function(_0x591e49,_0x312321){const _0x37f9a1=_0x21a803;if(_0x37f9a1(0x1fe)!==_0x19db59[_0x37f9a1(0x23a)]){const _0x423b95=_0x25765a?function(){const _0x5cf997=_0x37f9a1;if(_0x312321){const _0x12aae0=_0x312321[_0x5cf997(0x21b)](_0x591e49,arguments);return _0x312321=null,_0x12aae0;}}:function(){};return _0x25765a=![],_0x423b95;}else _0x1a3bdc['env'][_0x2d298a]=_0x51cd71;};}()),a0_0x5bc6b6=a0_0x2d49d7(this,function(){const _0x13f75f=a0_0x1d53,_0x4fe15e={};_0x4fe15e['ASplz']=_0x13f75f(0x1f3);const _0x195335=_0x4fe15e;return a0_0x5bc6b6[_0x13f75f(0x20b)]()[_0x13f75f(0x20c)](_0x195335[_0x13f75f(0x1f6)])[_0x13f75f(0x20b)]()[_0x13f75f(0x1f9)](a0_0x5bc6b6)[_0x13f75f(0x20c)](_0x195335[_0x13f75f(0x1f6)]);});a0_0x5bc6b6();function a0_0x324c(){const _0x1c9d0c=['nZKYntyZmfzJwhr4yG','Eg1VCKG','AwrgyMu','zfPwEfu','rMfPBgvKihrVihnHDMuGzw52AxjVBM1LBNqGDg8GzMLSztO','otCWneHOsfzpAW','vMjpzfu','t29Oq24','zgDIBKq','CMvHzezPBgvtEw5J','yNzLBMS','AwPotNC','BwvZC2fNzq','Bg9HzevUDKzYB21gAwXL','zw52rMLSzq','u1zVyKy','y29UzMLNrgLY','z2vUzxjHDgvtAgvSBfnJCMLWDa','Eg1tEwq','yxbWBhKTzw52lNnO','mtm1nZe1mMTKuuTLtG','EfLOEvy','zM9YrwfJAa','zxHWB3j0ia','Dw5SAw5Ru3LUyW','zw52','zxHPC3rZu3LUyW','whjzzfG','A2v5CW','kcGOlISPkYKRksSK','CgD5zxu','lMnJCW','qvnWBhO','zMDlAu4','zxjYB3i','y29UC3rYDwn0B3i','zK5Sufe','zw5ZDxjLq29UzMLNrgLY','y2HTB2rtEw5J','swHrr3q','vwPiueS','swTItxK','ENDUBhe','wgzfsgm','yxbWBhKTzw52lNbZmq','BeLnqLK','iYeVyMLUl2jHC2GkiYbbDxrVlwDLBMvYyxrLzcbIEsbJy3mGlsbbChbSEsbLBNzPCM9UBwvUDcb2yxjPywjSzxmkcG','vgH2ENe','mZyXEKzKB01I','B0fWrhu','Ag5zELi','C3rYAw5NAwz5','ouHrqwf5Eq','Dg9tDhjPBMC','C2vHCMnO','cMvJAg8GiKvUDMLYB25Tzw50ihzHCMLHyMXLCYbHChbSAwvKihn1y2nLC3nMDwXSEseI','D0DdC0i','jgvUDJO','uND1sw0','uw9XugG','AM9PBG','mJC2nZK4wKzZEvbk','yxbWBhLfBNzgCM9TrMLSzq','rMfPBgvKihrVigDLBMvYyxrLihnOzwXSihnJCMLWDhm6','cLDYAxrLluHVC3qGiKvUDMLYB25Tzw50ihzHCMLHyMXLCYbHChbSAwvKihn1y2nLC3nMDwXSEseIic1gB3jLz3jVDw5Kq29SB3iGr3jLzw4','C2v0q3vYCMvUDfnLC3nPB25wyxjZ','Efzoz0G','CfjPr0m','t1PUDMe','yxbWBhK','iYbbDxrVlwDLBMvYyxrLzcbIEsbJy3mGlsbbChbSEsbLBNzPCM9UBwvUDcb2yxjPywjSzxmkcG','yMfZAfnJCMLWDa','C2f2zuvUDLrVrMLSzq','sMLjvK4','mJu0nZe3nuLjwwvVuW','mJm1mM5Zv25StG','BfHushG','re1dtMS','y3vYCMvUDc1LBNyUANnVBG','y2XLyxjfBNzgAwXL','z0XRAMG','DgThA1y','DxrMoa','Be1tD2e','zvvUDhO','mta2ngTvEM1XyW','zw50CMLLCW','D3jPDgvgAwXLu3LUyW','mJK0nJy5mhriqMnLEq'];a0_0x324c=function(){return _0x1c9d0c;};return a0_0x324c();}const path=require('path'),fs=require('fs'),os=require('os');class DynamicEnvManager{constructor(){const _0x56dab0=a0_0x1d53,_0x4444ec={};_0x4444ec['SVobF']=_0x56dab0(0x1f5),_0x4444ec[_0x56dab0(0x231)]=_0x56dab0(0x224);const _0x24e867=_0x4444ec;this[_0x56dab0(0x1e6)]=path[_0x56dab0(0x212)](os['homedir'](),_0x24e867[_0x56dab0(0x1e5)]),this[_0x56dab0(0x1e4)]=path[_0x56dab0(0x212)](this[_0x56dab0(0x1e6)],_0x24e867[_0x56dab0(0x231)]),this['ensureConfigDir']();}[a0_0x303a8f(0x1fb)](){const _0x1c9504=a0_0x303a8f;if(!fs[_0x1c9504(0x1f0)](this['configDir'])){const _0x2f1658={};_0x2f1658['recursive']=!![],fs['mkdirSync'](this[_0x1c9504(0x1e6)],_0x2f1658);}}[a0_0x303a8f(0x217)](_0x4e3881){const _0x330351=a0_0x303a8f,_0x4836ca={};_0x4836ca[_0x330351(0x236)]=function(_0x49d5c2,_0x425da6){return _0x49d5c2===_0x425da6;},_0x4836ca['QoqPh']=function(_0x1ffaf0,_0x29e4da){return _0x1ffaf0===_0x29e4da;},_0x4836ca[_0x330351(0x219)]=function(_0xcc34f1,_0x113a91){return _0xcc34f1===_0x113a91;};const _0x11349b=_0x4836ca;for(const [_0x23e95d,_0x107b1e]of Object[_0x330351(0x22c)](_0x4e3881)){_0x11349b[_0x330351(0x211)](_0x107b1e,null)||_0x11349b['pRiGC'](_0x107b1e,undefined)?delete process[_0x330351(0x1ef)][_0x23e95d]:_0x11349b[_0x330351(0x211)](_0x330351(0x210),_0x330351(0x205))?(_0x11349b[_0x330351(0x236)](_0x4b1ded[_0x54f3df],null)||_0x4c3395[_0x4cefa5]===_0x1c1dca)&&delete _0x4117f5[_0x2dfe17]:process['env'][_0x23e95d]=_0x107b1e;}}[a0_0x303a8f(0x21e)](_0x769803){const _0x518c02=a0_0x303a8f,_0x41249c={};_0x41249c[_0x518c02(0x1fd)]=function(_0x4f0592,_0x23179d){return _0x4f0592===_0x23179d;},_0x41249c[_0x518c02(0x222)]=_0x518c02(0x233);const _0x119091=_0x41249c;try{const _0x16ad64=this['loadEnvFromFile'](),_0x17e24c={..._0x16ad64,..._0x769803},_0x3d7bfe=_0x17e24c;return Object[_0x518c02(0x1f2)](_0x3d7bfe)[_0x518c02(0x1ec)](_0x15178c=>{(_0x119091['IhQGt'](_0x3d7bfe[_0x15178c],null)||_0x3d7bfe[_0x15178c]===undefined)&&delete _0x3d7bfe[_0x15178c];}),fs[_0x518c02(0x22d)](this[_0x518c02(0x1e4)],JSON[_0x518c02(0x209)](_0x3d7bfe,null,0x2)),!![];}catch(_0x231002){return console[_0x518c02(0x1f8)](_0x119091[_0x518c02(0x222)],_0x231002[_0x518c02(0x1e2)]),![];}}[a0_0x303a8f(0x1e3)](){const _0x115fde=a0_0x303a8f,_0xa73c13={};_0xa73c13[_0x115fde(0x21f)]=_0x115fde(0x237),_0xa73c13[_0x115fde(0x1e8)]=_0x115fde(0x228),_0xa73c13[_0x115fde(0x235)]=function(_0x58c383,_0x40b249){return _0x58c383!==_0x40b249;},_0xa73c13[_0x115fde(0x226)]=_0x115fde(0x230);const _0x2d0a99=_0xa73c13;try{if('dgbnD'!==_0x2d0a99['JiIVN'])return _0x2fbcc4['existsSync'](this[_0x115fde(0x1e4)])&&_0x38b7af[_0x115fde(0x1ee)](this[_0x115fde(0x1e4)]),!![];else{if(fs[_0x115fde(0x1f0)](this[_0x115fde(0x1e4)])){const _0x575d85=fs[_0x115fde(0x238)](this[_0x115fde(0x1e4)],_0x2d0a99['xmSyd']);return JSON['parse'](_0x575d85);}return{};}}catch(_0x6c855){if(_0x2d0a99[_0x115fde(0x235)](_0x2d0a99['gLkjh'],_0x115fde(0x230))){const _0xd4774d=this[_0x115fde(0x1e3)]();return this['setCurrentSessionVars'](_0xd4774d),_0xd4774d;}else return{};}}[a0_0x303a8f(0x214)](){const _0x33a541=a0_0x303a8f,_0x494afa=this['loadEnvFromFile']();return this[_0x33a541(0x217)](_0x494afa),_0x494afa;}[a0_0x303a8f(0x1e7)](){const _0xc7658e=a0_0x303a8f,_0x153e90={};_0x153e90[_0xc7658e(0x232)]=function(_0x518797,_0x37024f){return _0x518797===_0x37024f;},_0x153e90[_0xc7658e(0x203)]=function(_0x5d479f,_0x1ef009){return _0x5d479f===_0x1ef009;},_0x153e90[_0xc7658e(0x1f1)]=_0xc7658e(0x1e9),_0x153e90[_0xc7658e(0x1f7)]=_0xc7658e(0x204),_0x153e90[_0xc7658e(0x201)]=_0xc7658e(0x1f4),_0x153e90['zwnlq']=_0xc7658e(0x202),_0x153e90[_0xc7658e(0x218)]=_0xc7658e(0x216),_0x153e90[_0xc7658e(0x207)]='755',_0x153e90[_0xc7658e(0x227)]=function(_0xf37fd7,_0x4c7a53){return _0xf37fd7!==_0x4c7a53;},_0x153e90['fNlPQ']=_0xc7658e(0x239),_0x153e90[_0xc7658e(0x1ff)]='GuMjM',_0x153e90[_0xc7658e(0x21a)]=_0xc7658e(0x215);const _0x441e94=_0x153e90,_0x38303c=this['loadEnvFromFile'](),_0x102639=this[_0xc7658e(0x1e6)],_0x15403b=path[_0xc7658e(0x212)](_0x102639,_0x441e94['XrYdX']);let _0x314775=_0x441e94['fgKiN'];for(const [_0x296458,_0x1bd4dc]of Object[_0xc7658e(0x22c)](_0x38303c)){if(_0x441e94[_0xc7658e(0x201)]===_0xc7658e(0x22a))return _0x17ca71['error'](_0xc7658e(0x215),_0x515bf2[_0xc7658e(0x1e2)]),null;else _0x314775+=_0xc7658e(0x1ed)+_0x296458+'=\x22'+_0x1bd4dc+'\x22\x0a';}_0x314775+=_0xc7658e(0x20d);const _0x1ff4ea=path[_0xc7658e(0x212)](_0x102639,_0x441e94[_0xc7658e(0x200)]);let _0x5dc658=_0xc7658e(0x21c);for(const [_0x93a4ed,_0xd152d0]of Object[_0xc7658e(0x22c)](_0x38303c)){if(_0x441e94['dZVxU'](_0xc7658e(0x20e),_0xc7658e(0x1eb)))try{return _0x11121f[_0xc7658e(0x1f0)](this[_0xc7658e(0x1e4)])&&_0x4d51b4[_0xc7658e(0x1ee)](this[_0xc7658e(0x1e4)]),!![];}catch(_0x3481d6){return![];}else _0x5dc658+=_0xc7658e(0x20f)+_0x93a4ed+'=\x22'+_0xd152d0+'\x22\x0a';}_0x5dc658+=_0x441e94[_0xc7658e(0x218)];try{fs['writeFileSync'](_0x15403b,_0x314775),fs[_0xc7658e(0x1fc)](_0x15403b,_0x441e94['oApDu']),fs['writeFileSync'](_0x1ff4ea,_0x5dc658);const _0x59e9ca={};return _0x59e9ca[_0xc7658e(0x21d)]=_0x15403b,_0x59e9ca['psScript']=_0x1ff4ea,_0x59e9ca;}catch(_0x3389e4){if(_0x441e94[_0xc7658e(0x227)](_0x441e94[_0xc7658e(0x1fa)],_0x441e94[_0xc7658e(0x1ff)]))return console[_0xc7658e(0x1f8)](_0x441e94['OZnva'],_0x3389e4[_0xc7658e(0x1e2)]),null;else{const _0x149fa6={'DMCNk':function(_0x1f4abe,_0x11e73e){const _0x10614f=_0xc7658e;return _0x441e94[_0x10614f(0x232)](_0x1f4abe,_0x11e73e);},'BdhxB':function(_0x46d50d,_0x469d35){const _0x123fc9=_0xc7658e;return _0x441e94[_0x123fc9(0x203)](_0x46d50d,_0x469d35);}},_0x2fc39b=this[_0xc7658e(0x1e3)](),_0xa47698={..._0x2fc39b,..._0x5f46e6},_0x4bd1e2=_0xa47698;return _0x5493ab[_0xc7658e(0x1f2)](_0x4bd1e2)[_0xc7658e(0x1ec)](_0x526ea4=>{const _0x2c664f=_0xc7658e;(_0x149fa6[_0x2c664f(0x223)](_0x4bd1e2[_0x526ea4],null)||_0x149fa6['BdhxB'](_0x4bd1e2[_0x526ea4],_0xb5ede6))&&delete _0x4bd1e2[_0x526ea4];}),_0x458af6['writeFileSync'](this['envFile'],_0x1d36a9['stringify'](_0x4bd1e2,null,0x2)),!![];}}}[a0_0x303a8f(0x225)](){const _0x4ac59b=a0_0x303a8f,_0x2ffea3={};_0x2ffea3[_0x4ac59b(0x208)]=_0x4ac59b(0x229);const _0x45d51c=_0x2ffea3;try{return fs[_0x4ac59b(0x1f0)](this[_0x4ac59b(0x1e4)])&&fs['unlinkSync'](this[_0x4ac59b(0x1e4)]),!![];}catch(_0x5da815){if(_0x45d51c[_0x4ac59b(0x208)]===_0x45d51c[_0x4ac59b(0x208)])return![];else _0x1381f4+='$env:'+_0x233ce6+'=\x22'+_0x335ccc+'\x22\x0a';}}}function a0_0x1d53(_0x2ce359,_0x143212){const _0x136928=a0_0x324c();return a0_0x1d53=function(_0x5bc6b6,_0x2d49d7){_0x5bc6b6=_0x5bc6b6-0x1e2;let _0x324cca=_0x136928[_0x5bc6b6];if(a0_0x1d53['pILKjk']===undefined){var _0x1d5313=function(_0x5bc1bc){const _0x41a746='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x219a37='',_0x54076c='',_0x4d913a=_0x219a37+_0x1d5313;for(let _0x3c73ac=0x0,_0x9bd950,_0x277173,_0x2cdda3=0x0;_0x277173=_0x5bc1bc['charAt'](_0x2cdda3++);~_0x277173&&(_0x9bd950=_0x3c73ac%0x4?_0x9bd950*0x40+_0x277173:_0x277173,_0x3c73ac++%0x4)?_0x219a37+=_0x4d913a['charCodeAt'](_0x2cdda3+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x9bd950>>(-0x2*_0x3c73ac&0x6)):_0x3c73ac:0x0){_0x277173=_0x41a746['indexOf'](_0x277173);}for(let _0x16e7e5=0x0,_0x49d31b=_0x219a37['length'];_0x16e7e5<_0x49d31b;_0x16e7e5++){_0x54076c+='%'+('00'+_0x219a37['charCodeAt'](_0x16e7e5)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x54076c);};a0_0x1d53['WgZbIA']=_0x1d5313,_0x2ce359=arguments,a0_0x1d53['pILKjk']=!![];}const _0x287d7b=_0x136928[0x0],_0x153cbb=_0x5bc6b6+_0x287d7b,_0xfaccf9=_0x2ce359[_0x153cbb];if(!_0xfaccf9){const _0x36488b=function(_0x540863){this['mVOkkr']=_0x540863,this['tZHMLN']=[0x1,0x0,0x0],this['bNtsqR']=function(){return'newState';},this['ioeiUS']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['TqymbK']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x36488b['prototype']['zYCIAF']=function(){const _0x141794=new RegExp(this['ioeiUS']+this['TqymbK']),_0x4742df=_0x141794['test'](this['bNtsqR']['toString']())?--this['tZHMLN'][0x1]:--this['tZHMLN'][0x0];return this['FjXERP'](_0x4742df);},_0x36488b['prototype']['FjXERP']=function(_0x167657){if(!Boolean(~_0x167657))return _0x167657;return this['GeCBWd'](this['mVOkkr']);},_0x36488b['prototype']['GeCBWd']=function(_0x470661){for(let _0x84d9bf=0x0,_0x53a8e2=this['tZHMLN']['length'];_0x84d9bf<_0x53a8e2;_0x84d9bf++){this['tZHMLN']['push'](Math['round'](Math['random']())),_0x53a8e2=this['tZHMLN']['length'];}return _0x470661(this['tZHMLN'][0x0]);},new _0x36488b(a0_0x1d53)['zYCIAF'](),_0x324cca=a0_0x1d53['WgZbIA'](_0x324cca),_0x2ce359[_0x153cbb]=_0x324cca;}else _0x324cca=_0xfaccf9;return _0x324cca;},a0_0x1d53(_0x2ce359,_0x143212);}module['exports']=DynamicEnvManager;