just-bash 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/AGENTS.md +131 -3
- package/dist/bin/chunks/{alias-ZAQAKC5X.js → alias-PCMLRCRW.js} +1 -1
- package/dist/bin/chunks/{awk2-A73ZNFXJ.js → awk2-D2US2LMM.js} +1 -1
- package/dist/bin/{shell/chunks/base64-JPITV4MD.js → chunks/base64-RJX7MYGG.js} +1 -1
- package/dist/bin/{shell/chunks/basename-IYEP3AMY.js → chunks/basename-SO5MVUEX.js} +1 -1
- package/dist/bin/chunks/{bash-WZYHIZP6.js → bash-UT3MT5UU.js} +1 -1
- package/dist/bin/{shell/chunks/cat-XILYL7NW.js → chunks/cat-7TVSOZLU.js} +1 -1
- package/dist/bin/{shell/chunks/chmod-EXWX4N7Y.js → chunks/chmod-3DIKREF7.js} +1 -1
- package/dist/bin/chunks/chunk-ACRTDIBO.js +6 -0
- package/dist/bin/chunks/chunk-KGOUQS5A.js +2 -0
- package/dist/bin/chunks/chunk-OQRRF62X.js +10 -0
- package/dist/bin/chunks/chunk-QSDVMMYI.js +21 -0
- package/dist/bin/chunks/{clear-2APRIRCF.js → clear-CI7A5IXQ.js} +1 -1
- package/dist/bin/chunks/column-TSFEMTG6.js +8 -0
- package/dist/bin/chunks/{comm-KY3COLF5.js → comm-CPIFQTKY.js} +1 -1
- package/dist/bin/{shell/chunks/cp-HES4UN7K.js → chunks/cp-XXWRVG2D.js} +1 -1
- package/dist/bin/chunks/{curl-BN5M3BUX.js → curl-LCMREE7R.js} +1 -1
- package/dist/bin/chunks/{cut-JSIPAKOX.js → cut-VCKWLT2T.js} +1 -1
- package/dist/bin/chunks/{date-CU4J7GHI.js → date-IQLPMFYI.js} +1 -1
- package/dist/bin/{shell/chunks/diff-W4JRNHXW.js → chunks/diff-GI3QVUGD.js} +1 -1
- package/dist/bin/chunks/{dirname-UTCUUILN.js → dirname-EES7TR26.js} +1 -1
- package/dist/bin/chunks/{du-2JU3PUTM.js → du-ZONJJZUK.js} +1 -1
- package/dist/bin/{shell/chunks/echo-HKLPYMNC.js → chunks/echo-WSKTON6U.js} +1 -1
- package/dist/bin/chunks/{env-2SBJNP7X.js → env-YLLSNZZN.js} +1 -1
- package/dist/bin/chunks/expand-77K5HH2M.js +11 -0
- package/dist/bin/chunks/{expr-M74QZQ6C.js → expr-RMGXYNQJ.js} +1 -1
- package/dist/bin/chunks/{file-QPD3U2H7.js → file-XMPFXMUJ.js} +1 -1
- package/dist/bin/{shell/chunks/find-TRBVCSI6.js → chunks/find-P6UQXFKX.js} +1 -1
- package/dist/bin/chunks/fold-452R4I2C.js +12 -0
- package/dist/bin/{shell/chunks/grep-BEZRXAWL.js → chunks/grep-L5HBHEEQ.js} +1 -1
- package/dist/bin/chunks/{gzip-VLTXZB2V.js → gzip-MNCJB6OR.js} +1 -1
- package/dist/bin/chunks/{head-YGMY3DHE.js → head-DYK37Z24.js} +1 -1
- package/dist/bin/chunks/{help-UEF7LW7F.js → help-7C5JICNL.js} +1 -1
- package/dist/bin/{shell/chunks/history-OGBCIAR5.js → chunks/history-G5C2J2OY.js} +1 -1
- package/dist/bin/chunks/{hostname-CV7CGKRN.js → hostname-WXDKRL2Z.js} +1 -1
- package/dist/bin/chunks/{html-to-markdown-HTGML4TH.js → html-to-markdown-EPEXKI4B.js} +1 -1
- package/dist/bin/chunks/join-3IXMEGNA.js +14 -0
- package/dist/bin/chunks/jq-MTQKMJJI.js +16 -0
- package/dist/bin/chunks/{ln-RUR4ALOJ.js → ln-EFFNQ3RY.js} +1 -1
- package/dist/bin/chunks/{ls-GU5227KE.js → ls-FSSC77F4.js} +1 -1
- package/dist/bin/chunks/{md5sum-C7WDEYN5.js → md5sum-VGXAOUBA.js} +1 -1
- package/dist/bin/chunks/{mkdir-4OYU22AA.js → mkdir-XJABRAUN.js} +1 -1
- package/dist/bin/chunks/{mv-H3S4FEWR.js → mv-3ATZ2ABL.js} +1 -1
- package/dist/bin/chunks/nl-DSM3NUGM.js +17 -0
- package/dist/bin/{shell/chunks/od-TXTSFFJY.js → chunks/od-SLM7SRWU.js} +1 -1
- package/dist/bin/chunks/{paste-HHCFASL4.js → paste-FT6WBQZG.js} +1 -1
- package/dist/bin/chunks/{printf-2JFCUFOA.js → printf-HWUQKYUM.js} +1 -1
- package/dist/bin/{shell/chunks/pwd-T5Q3JEBO.js → chunks/pwd-53KG2MCJ.js} +1 -1
- package/dist/bin/chunks/{readlink-M44TLMFS.js → readlink-VL3R4LAM.js} +1 -1
- package/dist/bin/chunks/rev-VP42N2JN.js +7 -0
- package/dist/bin/chunks/{rm-R4M647EC.js → rm-2PKAWTSQ.js} +1 -1
- package/dist/bin/chunks/{sed-QLLAZYHH.js → sed-5LQMJYRJ.js} +1 -1
- package/dist/bin/chunks/{seq-GJMQM7SP.js → seq-AVK43XM2.js} +1 -1
- package/dist/bin/chunks/{sha1sum-WKCGV66X.js → sha1sum-BIUH233Z.js} +1 -1
- package/dist/bin/{shell/chunks/sha256sum-3ZDGP5WC.js → chunks/sha256sum-SUIK2MT2.js} +1 -1
- package/dist/bin/chunks/{sleep-OJPODQGM.js → sleep-O5BOTJGJ.js} +1 -1
- package/dist/bin/chunks/{sort-JL33INQB.js → sort-J5ARYV56.js} +1 -1
- package/dist/bin/chunks/split-JJFZRWRC.js +16 -0
- package/dist/bin/{shell/chunks/stat-CR2INBC2.js → chunks/stat-UEQ7KMY5.js} +1 -1
- package/dist/bin/chunks/strings-ZEKN6D4Q.js +14 -0
- package/dist/bin/chunks/{tac-F4GC3MAI.js → tac-KNRFDAY7.js} +1 -1
- package/dist/bin/chunks/{tail-BYPLMYMZ.js → tail-BES27CZT.js} +1 -1
- package/dist/bin/chunks/{tee-HOMRRC3X.js → tee-ZFIT2GTM.js} +1 -1
- package/dist/bin/{shell/chunks/timeout-MYKG34DQ.js → chunks/timeout-JED4EKFH.js} +1 -1
- package/dist/bin/{shell/chunks/touch-3ZANYAXI.js → chunks/touch-TSNAXMZ2.js} +1 -1
- package/dist/bin/{shell/chunks/tr-E66N7IS2.js → chunks/tr-MBLEXZBI.js} +1 -1
- package/dist/bin/chunks/{tree-EE2PYIMV.js → tree-ESVATRDW.js} +1 -1
- package/dist/bin/chunks/{true-OWPVS7U4.js → true-OVATH2SQ.js} +1 -1
- package/dist/bin/chunks/unexpand-BFVYAPOU.js +11 -0
- package/dist/bin/chunks/{uniq-F5NP3LLU.js → uniq-7JNZWE5D.js} +1 -1
- package/dist/bin/chunks/{wc-NBMNJDZL.js → wc-OFU3HUEZ.js} +1 -1
- package/dist/bin/chunks/{which-6MRG2UCF.js → which-73KOOLC6.js} +1 -1
- package/dist/bin/chunks/xan-ASGSTJP4.js +140 -0
- package/dist/bin/chunks/xan-view-YGORUYA2.js +2 -0
- package/dist/bin/chunks/{xargs-EMY5BOJ2.js → xargs-WIJC4RTG.js} +1 -1
- package/dist/bin/chunks/yq-MF2SNFGL.js +287 -0
- package/dist/bin/just-bash.js +47 -47
- package/dist/bin/shell/chunks/{alias-ZAQAKC5X.js → alias-PCMLRCRW.js} +1 -1
- package/dist/bin/shell/chunks/{awk2-A73ZNFXJ.js → awk2-D2US2LMM.js} +1 -1
- package/dist/bin/{chunks/base64-JPITV4MD.js → shell/chunks/base64-RJX7MYGG.js} +1 -1
- package/dist/bin/{chunks/basename-IYEP3AMY.js → shell/chunks/basename-SO5MVUEX.js} +1 -1
- package/dist/bin/shell/chunks/{bash-WZYHIZP6.js → bash-UT3MT5UU.js} +1 -1
- package/dist/bin/{chunks/cat-XILYL7NW.js → shell/chunks/cat-7TVSOZLU.js} +1 -1
- package/dist/bin/{chunks/chmod-EXWX4N7Y.js → shell/chunks/chmod-3DIKREF7.js} +1 -1
- package/dist/bin/shell/chunks/chunk-ACRTDIBO.js +6 -0
- package/dist/bin/shell/chunks/chunk-KGOUQS5A.js +2 -0
- package/dist/bin/shell/chunks/chunk-OQRRF62X.js +10 -0
- package/dist/bin/shell/chunks/chunk-QSDVMMYI.js +21 -0
- package/dist/bin/shell/chunks/{clear-2APRIRCF.js → clear-CI7A5IXQ.js} +1 -1
- package/dist/bin/shell/chunks/column-TSFEMTG6.js +8 -0
- package/dist/bin/shell/chunks/{comm-KY3COLF5.js → comm-CPIFQTKY.js} +1 -1
- package/dist/bin/{chunks/cp-HES4UN7K.js → shell/chunks/cp-XXWRVG2D.js} +1 -1
- package/dist/bin/shell/chunks/{curl-BN5M3BUX.js → curl-LCMREE7R.js} +1 -1
- package/dist/bin/shell/chunks/{cut-JSIPAKOX.js → cut-VCKWLT2T.js} +1 -1
- package/dist/bin/shell/chunks/{date-CU4J7GHI.js → date-IQLPMFYI.js} +1 -1
- package/dist/bin/{chunks/diff-W4JRNHXW.js → shell/chunks/diff-GI3QVUGD.js} +1 -1
- package/dist/bin/shell/chunks/{dirname-UTCUUILN.js → dirname-EES7TR26.js} +1 -1
- package/dist/bin/shell/chunks/{du-2JU3PUTM.js → du-ZONJJZUK.js} +1 -1
- package/dist/bin/{chunks/echo-HKLPYMNC.js → shell/chunks/echo-WSKTON6U.js} +1 -1
- package/dist/bin/shell/chunks/{env-2SBJNP7X.js → env-YLLSNZZN.js} +1 -1
- package/dist/bin/shell/chunks/expand-77K5HH2M.js +11 -0
- package/dist/bin/shell/chunks/{expr-M74QZQ6C.js → expr-RMGXYNQJ.js} +1 -1
- package/dist/bin/shell/chunks/{file-QPD3U2H7.js → file-XMPFXMUJ.js} +1 -1
- package/dist/bin/{chunks/find-TRBVCSI6.js → shell/chunks/find-P6UQXFKX.js} +1 -1
- package/dist/bin/shell/chunks/fold-452R4I2C.js +12 -0
- package/dist/bin/{chunks/grep-BEZRXAWL.js → shell/chunks/grep-L5HBHEEQ.js} +1 -1
- package/dist/bin/shell/chunks/{gzip-VLTXZB2V.js → gzip-MNCJB6OR.js} +1 -1
- package/dist/bin/shell/chunks/{head-YGMY3DHE.js → head-DYK37Z24.js} +1 -1
- package/dist/bin/shell/chunks/{help-UEF7LW7F.js → help-7C5JICNL.js} +1 -1
- package/dist/bin/{chunks/history-OGBCIAR5.js → shell/chunks/history-G5C2J2OY.js} +1 -1
- package/dist/bin/shell/chunks/{hostname-CV7CGKRN.js → hostname-WXDKRL2Z.js} +1 -1
- package/dist/bin/shell/chunks/{html-to-markdown-HTGML4TH.js → html-to-markdown-EPEXKI4B.js} +1 -1
- package/dist/bin/shell/chunks/join-3IXMEGNA.js +14 -0
- package/dist/bin/shell/chunks/jq-MTQKMJJI.js +16 -0
- package/dist/bin/shell/chunks/{ln-RUR4ALOJ.js → ln-EFFNQ3RY.js} +1 -1
- package/dist/bin/shell/chunks/{ls-GU5227KE.js → ls-FSSC77F4.js} +1 -1
- package/dist/bin/shell/chunks/{md5sum-C7WDEYN5.js → md5sum-VGXAOUBA.js} +1 -1
- package/dist/bin/shell/chunks/{mkdir-4OYU22AA.js → mkdir-XJABRAUN.js} +1 -1
- package/dist/bin/shell/chunks/{mv-H3S4FEWR.js → mv-3ATZ2ABL.js} +1 -1
- package/dist/bin/shell/chunks/nl-DSM3NUGM.js +17 -0
- package/dist/bin/{chunks/od-TXTSFFJY.js → shell/chunks/od-SLM7SRWU.js} +1 -1
- package/dist/bin/shell/chunks/{paste-HHCFASL4.js → paste-FT6WBQZG.js} +1 -1
- package/dist/bin/shell/chunks/{printf-2JFCUFOA.js → printf-HWUQKYUM.js} +1 -1
- package/dist/bin/{chunks/pwd-T5Q3JEBO.js → shell/chunks/pwd-53KG2MCJ.js} +1 -1
- package/dist/bin/shell/chunks/{readlink-M44TLMFS.js → readlink-VL3R4LAM.js} +1 -1
- package/dist/bin/shell/chunks/rev-VP42N2JN.js +7 -0
- package/dist/bin/shell/chunks/{rm-R4M647EC.js → rm-2PKAWTSQ.js} +1 -1
- package/dist/bin/shell/chunks/{sed-QLLAZYHH.js → sed-5LQMJYRJ.js} +1 -1
- package/dist/bin/shell/chunks/{seq-GJMQM7SP.js → seq-AVK43XM2.js} +1 -1
- package/dist/bin/shell/chunks/{sha1sum-WKCGV66X.js → sha1sum-BIUH233Z.js} +1 -1
- package/dist/bin/{chunks/sha256sum-3ZDGP5WC.js → shell/chunks/sha256sum-SUIK2MT2.js} +1 -1
- package/dist/bin/shell/chunks/{sleep-OJPODQGM.js → sleep-O5BOTJGJ.js} +1 -1
- package/dist/bin/shell/chunks/{sort-JL33INQB.js → sort-J5ARYV56.js} +1 -1
- package/dist/bin/shell/chunks/split-JJFZRWRC.js +16 -0
- package/dist/bin/{chunks/stat-CR2INBC2.js → shell/chunks/stat-UEQ7KMY5.js} +1 -1
- package/dist/bin/shell/chunks/strings-ZEKN6D4Q.js +14 -0
- package/dist/bin/shell/chunks/{tac-F4GC3MAI.js → tac-KNRFDAY7.js} +1 -1
- package/dist/bin/shell/chunks/{tail-BYPLMYMZ.js → tail-BES27CZT.js} +1 -1
- package/dist/bin/shell/chunks/{tee-HOMRRC3X.js → tee-ZFIT2GTM.js} +1 -1
- package/dist/bin/{chunks/timeout-MYKG34DQ.js → shell/chunks/timeout-JED4EKFH.js} +1 -1
- package/dist/bin/{chunks/touch-3ZANYAXI.js → shell/chunks/touch-TSNAXMZ2.js} +1 -1
- package/dist/bin/{chunks/tr-E66N7IS2.js → shell/chunks/tr-MBLEXZBI.js} +1 -1
- package/dist/bin/shell/chunks/{tree-EE2PYIMV.js → tree-ESVATRDW.js} +1 -1
- package/dist/bin/shell/chunks/{true-OWPVS7U4.js → true-OVATH2SQ.js} +1 -1
- package/dist/bin/shell/chunks/unexpand-BFVYAPOU.js +11 -0
- package/dist/bin/shell/chunks/{uniq-F5NP3LLU.js → uniq-7JNZWE5D.js} +1 -1
- package/dist/bin/shell/chunks/{wc-NBMNJDZL.js → wc-OFU3HUEZ.js} +1 -1
- package/dist/bin/shell/chunks/{which-6MRG2UCF.js → which-73KOOLC6.js} +1 -1
- package/dist/bin/shell/chunks/xan-ASGSTJP4.js +140 -0
- package/dist/bin/shell/chunks/xan-view-YGORUYA2.js +2 -0
- package/dist/bin/shell/chunks/{xargs-EMY5BOJ2.js → xargs-WIJC4RTG.js} +1 -1
- package/dist/bin/shell/chunks/yq-MF2SNFGL.js +287 -0
- package/dist/bin/shell/shell.js +78 -78
- package/dist/bundle/browser.js +486 -393
- package/dist/bundle/chunks/{alias-JFIUWFGE.js → alias-4UGRF4DM.js} +1 -1
- package/dist/bundle/chunks/{awk2-QWBT4IFJ.js → awk2-46RTIZKB.js} +1 -1
- package/dist/bundle/chunks/{base64-TUA2XORD.js → base64-F5R4G5EG.js} +1 -1
- package/dist/bundle/chunks/{basename-5UVU5RXR.js → basename-CFA5ZIGT.js} +1 -1
- package/dist/bundle/chunks/{bash-BASUPKHJ.js → bash-ZILV3VHA.js} +1 -1
- package/dist/bundle/chunks/{cat-47EP4IAV.js → cat-CE7XIAD2.js} +1 -1
- package/dist/bundle/chunks/{chmod-XJXFAD4M.js → chmod-FBHLEIY6.js} +1 -1
- package/dist/bundle/chunks/chunk-4JO5BKO4.js +5 -0
- package/dist/bundle/chunks/chunk-DXB73IDG.js +1 -0
- package/dist/bundle/chunks/chunk-SYMJJMQ4.js +20 -0
- package/dist/bundle/chunks/chunk-U4UYWYTO.js +9 -0
- package/dist/bundle/chunks/{clear-XD3TJRVQ.js → clear-VT2LJIDX.js} +1 -1
- package/dist/bundle/chunks/column-XPDNNO5Y.js +7 -0
- package/dist/bundle/chunks/{comm-KSJ4BBRQ.js → comm-AXQM7FFF.js} +1 -1
- package/dist/bundle/chunks/{cp-37OVLNLD.js → cp-PBJT3GBF.js} +1 -1
- package/dist/bundle/chunks/{curl-C43O5WQS.js → curl-TVZH24MD.js} +1 -1
- package/dist/bundle/chunks/{cut-FIZRELKC.js → cut-MCCSW2TZ.js} +1 -1
- package/dist/bundle/chunks/{date-NN5C354M.js → date-PN3CMG7K.js} +1 -1
- package/dist/bundle/chunks/{diff-GLRVCAKJ.js → diff-ZLJYSBRK.js} +1 -1
- package/dist/bundle/chunks/{dirname-U2KVUSQY.js → dirname-YPJLCQYA.js} +1 -1
- package/dist/bundle/chunks/{du-KRAFOIQK.js → du-3NURMGXT.js} +1 -1
- package/dist/bundle/chunks/{echo-WUKBESC7.js → echo-VUHWYV6L.js} +1 -1
- package/dist/bundle/chunks/{env-MSPSPGCD.js → env-EG5SQSAQ.js} +1 -1
- package/dist/bundle/chunks/expand-VSTNOVF5.js +10 -0
- package/dist/bundle/chunks/{expr-HYOCSWK6.js → expr-DG4E7SIS.js} +1 -1
- package/dist/bundle/chunks/{file-LQXX6P4Y.js → file-AWZ3TUFP.js} +1 -1
- package/dist/bundle/chunks/{find-GM7FJ4D3.js → find-QJDJJ5KW.js} +1 -1
- package/dist/bundle/chunks/fold-6CFXIPYZ.js +11 -0
- package/dist/bundle/chunks/{grep-ZJVDG3FA.js → grep-4K5T3MYL.js} +1 -1
- package/dist/bundle/chunks/{gzip-UQS7KRTV.js → gzip-7QAS5P2Y.js} +1 -1
- package/dist/bundle/chunks/{head-6PAUYCDP.js → head-FZ6IQHYW.js} +1 -1
- package/dist/bundle/chunks/{help-5E6PYJWQ.js → help-75YOGKM4.js} +1 -1
- package/dist/bundle/chunks/{history-SG6VRATI.js → history-MQDK2OPD.js} +1 -1
- package/dist/bundle/chunks/{hostname-K4BA3P6X.js → hostname-NWR32CGF.js} +1 -1
- package/dist/bundle/chunks/{html-to-markdown-ZSZ34PAN.js → html-to-markdown-ZK6GQVSL.js} +1 -1
- package/dist/bundle/chunks/join-X3QYPZUA.js +13 -0
- package/dist/bundle/chunks/jq-QAA4WF2O.js +15 -0
- package/dist/bundle/chunks/{ln-XFYHBIFL.js → ln-Y7YB677N.js} +1 -1
- package/dist/bundle/chunks/{ls-JGYJQA2Y.js → ls-CS3TIKWR.js} +1 -1
- package/dist/bundle/chunks/{md5sum-PIH6F3O3.js → md5sum-LJHKXLVT.js} +1 -1
- package/dist/bundle/chunks/{mkdir-HA2FJX4O.js → mkdir-7UKY4B3B.js} +1 -1
- package/dist/bundle/chunks/{mv-7I62SB3I.js → mv-FXHEKRTB.js} +1 -1
- package/dist/bundle/chunks/nl-KWQGFZH5.js +16 -0
- package/dist/bundle/chunks/{od-SOCTFI2F.js → od-ECWXNUB4.js} +1 -1
- package/dist/bundle/chunks/{paste-QBGVCQFT.js → paste-QTGVEPH5.js} +1 -1
- package/dist/bundle/chunks/{printf-HBP44PXI.js → printf-VG2POOXB.js} +1 -1
- package/dist/bundle/chunks/{pwd-CEF235GL.js → pwd-AC4P3JKI.js} +1 -1
- package/dist/bundle/chunks/{readlink-MQIMKDSA.js → readlink-EM4O3U4P.js} +1 -1
- package/dist/bundle/chunks/rev-FKUV5GH5.js +6 -0
- package/dist/bundle/chunks/{rm-NF3FNLAY.js → rm-I2SRVF7H.js} +1 -1
- package/dist/bundle/chunks/{sed-H2RWPMTM.js → sed-ZKODWZ6F.js} +1 -1
- package/dist/bundle/chunks/{seq-VKYIUOPJ.js → seq-5VRIVQYP.js} +1 -1
- package/dist/bundle/chunks/{sha1sum-HVHNZSEC.js → sha1sum-NRUZZ4Q6.js} +1 -1
- package/dist/bundle/chunks/{sha256sum-REOOJORK.js → sha256sum-5ZGJ4NJL.js} +1 -1
- package/dist/bundle/chunks/{sleep-AFN3PHJW.js → sleep-AK4QE4WR.js} +1 -1
- package/dist/bundle/chunks/{sort-XODGFZC4.js → sort-PMLMEZ4E.js} +1 -1
- package/dist/bundle/chunks/split-YBTFW7MT.js +15 -0
- package/dist/bundle/chunks/{stat-FVFLDQGP.js → stat-IVQBBOKN.js} +1 -1
- package/dist/bundle/chunks/strings-LRU5XCFP.js +13 -0
- package/dist/bundle/chunks/{tac-VIFKNLII.js → tac-2X4JLF4W.js} +1 -1
- package/dist/bundle/chunks/{tail-QXKYHAML.js → tail-PD4RZR6J.js} +1 -1
- package/dist/bundle/chunks/{tee-W5HCCBPO.js → tee-2QU4NRSJ.js} +1 -1
- package/dist/bundle/chunks/{timeout-XAA3N7CF.js → timeout-X3X3N6IE.js} +1 -1
- package/dist/bundle/chunks/{touch-FOE745V2.js → touch-MVQSKQKT.js} +1 -1
- package/dist/bundle/chunks/{tr-LMLGE4IE.js → tr-EDGW5FG6.js} +1 -1
- package/dist/bundle/chunks/{tree-WBUGLVP5.js → tree-5TYW7S7K.js} +1 -1
- package/dist/bundle/chunks/{true-6LGCG4EY.js → true-CNJ54NE6.js} +1 -1
- package/dist/bundle/chunks/unexpand-I7A2VXFD.js +10 -0
- package/dist/bundle/chunks/{uniq-7PFWPNWK.js → uniq-ONGDGSEB.js} +1 -1
- package/dist/bundle/chunks/{wc-GV5WUREX.js → wc-Y5MNUNQQ.js} +1 -1
- package/dist/bundle/chunks/{which-KHFYPBWW.js → which-M5MQ6QXQ.js} +1 -1
- package/dist/bundle/chunks/xan-B3RI2BDO.js +139 -0
- package/dist/bundle/chunks/xan-view-33AU6NPN.js +1 -0
- package/dist/bundle/chunks/{xargs-NQBNFMCT.js → xargs-2IMBHM4N.js} +1 -1
- package/dist/bundle/chunks/yq-KANM4MD2.js +286 -0
- package/dist/bundle/index.js +41 -41
- package/dist/commands/column/column.d.ts +9 -0
- package/dist/commands/expand/expand.d.ts +10 -0
- package/dist/commands/expand/unexpand.d.ts +10 -0
- package/dist/commands/fold/fold.d.ts +10 -0
- package/dist/commands/join/join.d.ts +10 -0
- package/dist/commands/nl/nl.d.ts +10 -0
- package/dist/commands/query-engine/evaluator.d.ts +25 -0
- package/dist/commands/query-engine/index.d.ts +8 -0
- package/dist/commands/{jq → query-engine}/parser.d.ts +3 -2
- package/dist/commands/registry.d.ts +1 -1
- package/dist/commands/rev/rev.d.ts +11 -0
- package/dist/commands/split/split.d.ts +10 -0
- package/dist/commands/strings/strings.d.ts +10 -0
- package/dist/commands/xan/aggregation.d.ts +20 -0
- package/dist/commands/xan/csv.d.ts +16 -0
- package/dist/commands/xan/moonblade-parser.d.ts +80 -0
- package/dist/commands/xan/moonblade-to-jq.d.ts +12 -0
- package/dist/commands/xan/subcommands.d.ts +15 -0
- package/dist/commands/xan/xan-agg.d.ts +8 -0
- package/dist/commands/xan/xan-columns.d.ts +8 -0
- package/dist/commands/xan/xan-core.d.ts +10 -0
- package/dist/commands/xan/xan-data.d.ts +52 -0
- package/dist/commands/xan/xan-filter.d.ts +8 -0
- package/dist/commands/xan/xan-map.d.ts +11 -0
- package/dist/commands/xan/xan-reshape.d.ts +40 -0
- package/dist/commands/xan/xan-simple.d.ts +40 -0
- package/dist/commands/xan/xan-utils.d.ts +19 -0
- package/dist/commands/xan/xan-view.d.ts +12 -0
- package/dist/commands/xan/xan.d.ts +8 -0
- package/dist/commands/yq/formats.d.ts +64 -0
- package/dist/commands/yq/yq.d.ts +11 -0
- package/package.json +10 -3
- package/dist/bin/chunks/chunk-SJXDWN5X.js +0 -2
- package/dist/bin/chunks/jq-TRAUXD47.js +0 -19
- package/dist/bin/shell/chunks/chunk-SJXDWN5X.js +0 -2
- package/dist/bin/shell/chunks/jq-TRAUXD47.js +0 -19
- package/dist/bundle/chunks/chunk-2RUN43TJ.js +0 -1
- package/dist/bundle/chunks/jq-PO3DWIV2.js +0 -18
- package/dist/commands/jq/evaluator.d.ts +0 -18
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* expand - convert tabs to spaces
|
|
3
|
+
*
|
|
4
|
+
* Usage: expand [OPTION]... [FILE]...
|
|
5
|
+
*
|
|
6
|
+
* Convert TABs in each FILE to spaces, writing to standard output.
|
|
7
|
+
* If no FILE is specified, standard input is read.
|
|
8
|
+
*/
|
|
9
|
+
import type { Command } from "../../types.js";
|
|
10
|
+
export declare const expand: Command;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* unexpand - convert spaces to tabs
|
|
3
|
+
*
|
|
4
|
+
* Usage: unexpand [OPTION]... [FILE]...
|
|
5
|
+
*
|
|
6
|
+
* Convert blanks in each FILE to TABs, writing to standard output.
|
|
7
|
+
* If no FILE is specified, standard input is read.
|
|
8
|
+
*/
|
|
9
|
+
import type { Command } from "../../types.js";
|
|
10
|
+
export declare const unexpand: Command;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* fold - wrap each input line to fit in specified width
|
|
3
|
+
*
|
|
4
|
+
* Usage: fold [OPTION]... [FILE]...
|
|
5
|
+
*
|
|
6
|
+
* Wrap input lines in each FILE, writing to standard output.
|
|
7
|
+
* If no FILE is specified, standard input is read.
|
|
8
|
+
*/
|
|
9
|
+
import type { Command } from "../../types.js";
|
|
10
|
+
export declare const fold: Command;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* join - join lines of two files on a common field
|
|
3
|
+
*
|
|
4
|
+
* Usage: join [OPTION]... FILE1 FILE2
|
|
5
|
+
*
|
|
6
|
+
* For each pair of input lines with identical join fields, write a line to
|
|
7
|
+
* standard output. The default join field is the first, delimited by blanks.
|
|
8
|
+
*/
|
|
9
|
+
import type { Command } from "../../types.js";
|
|
10
|
+
export declare const join: Command;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* nl - number lines of files
|
|
3
|
+
*
|
|
4
|
+
* Usage: nl [OPTION]... [FILE]...
|
|
5
|
+
*
|
|
6
|
+
* Write each FILE to standard output, with line numbers added.
|
|
7
|
+
* If no FILE is specified, standard input is read.
|
|
8
|
+
*/
|
|
9
|
+
import type { Command } from "../../types.js";
|
|
10
|
+
export declare const nl: Command;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query expression evaluator
|
|
3
|
+
*
|
|
4
|
+
* Evaluates a parsed query AST against any value.
|
|
5
|
+
* Used by jq, yq, and other query-based commands.
|
|
6
|
+
*/
|
|
7
|
+
import type { AstNode } from "./parser.js";
|
|
8
|
+
export type QueryValue = unknown;
|
|
9
|
+
export interface QueryExecutionLimits {
|
|
10
|
+
maxIterations?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface EvalContext {
|
|
13
|
+
vars: Map<string, QueryValue>;
|
|
14
|
+
limits: Required<QueryExecutionLimits>;
|
|
15
|
+
env?: Record<string, string | undefined>;
|
|
16
|
+
/** Original document root for parent/root navigation */
|
|
17
|
+
root?: QueryValue;
|
|
18
|
+
/** Current path from root for parent navigation */
|
|
19
|
+
currentPath?: (string | number)[];
|
|
20
|
+
}
|
|
21
|
+
export interface EvaluateOptions {
|
|
22
|
+
limits?: QueryExecutionLimits;
|
|
23
|
+
env?: Record<string, string | undefined>;
|
|
24
|
+
}
|
|
25
|
+
export declare function evaluate(value: QueryValue, ast: AstNode, ctxOrOptions?: EvalContext | EvaluateOptions): QueryValue[];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Query expression parser
|
|
3
3
|
*
|
|
4
|
-
* Tokenizes and parses jq filter expressions into an AST.
|
|
4
|
+
* Tokenizes and parses jq-style filter expressions into an AST.
|
|
5
|
+
* Used by jq, yq, and other query-based commands.
|
|
5
6
|
*/
|
|
6
7
|
export type TokenType = "DOT" | "PIPE" | "COMMA" | "COLON" | "SEMICOLON" | "LPAREN" | "RPAREN" | "LBRACKET" | "RBRACKET" | "LBRACE" | "RBRACE" | "QUESTION" | "PLUS" | "MINUS" | "STAR" | "SLASH" | "PERCENT" | "EQ" | "NE" | "LT" | "LE" | "GT" | "GE" | "AND" | "OR" | "NOT" | "ALT" | "ASSIGN" | "UPDATE_ADD" | "UPDATE_SUB" | "UPDATE_MUL" | "UPDATE_DIV" | "UPDATE_MOD" | "UPDATE_ALT" | "UPDATE_PIPE" | "IDENT" | "NUMBER" | "STRING" | "IF" | "THEN" | "ELIF" | "ELSE" | "END" | "AS" | "TRY" | "CATCH" | "TRUE" | "FALSE" | "NULL" | "REDUCE" | "FOREACH" | "DOTDOT" | "EOF";
|
|
7
8
|
export interface Token {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Command } from "../types.js";
|
|
2
2
|
/** All available built-in command names (excludes network commands like curl) */
|
|
3
|
-
export type CommandName = "echo" | "cat" | "printf" | "ls" | "mkdir" | "touch" | "rm" | "cp" | "mv" | "ln" | "chmod" | "pwd" | "readlink" | "head" | "tail" | "wc" | "stat" | "grep" | "fgrep" | "egrep" | "sed" | "awk" | "sort" | "uniq" | "comm" | "cut" | "paste" | "tr" | "tee" | "find" | "basename" | "dirname" | "tree" | "du" | "env" | "printenv" | "alias" | "unalias" | "history" | "xargs" | "true" | "false" | "clear" | "bash" | "sh" | "jq" | "base64" | "diff" | "date" | "sleep" | "timeout" | "seq" | "expr" | "md5sum" | "sha1sum" | "sha256sum" | "file" | "html-to-markdown" | "help" | "which" | "tac" | "hostname" | "od" | "gzip" | "gunzip" | "zcat";
|
|
3
|
+
export type CommandName = "echo" | "cat" | "printf" | "ls" | "mkdir" | "touch" | "rm" | "cp" | "mv" | "ln" | "chmod" | "pwd" | "readlink" | "head" | "tail" | "wc" | "stat" | "grep" | "fgrep" | "egrep" | "sed" | "awk" | "sort" | "uniq" | "comm" | "cut" | "paste" | "tr" | "rev" | "nl" | "fold" | "expand" | "unexpand" | "strings" | "split" | "column" | "join" | "tee" | "find" | "basename" | "dirname" | "tree" | "du" | "env" | "printenv" | "alias" | "unalias" | "history" | "xargs" | "true" | "false" | "clear" | "bash" | "sh" | "jq" | "base64" | "diff" | "date" | "sleep" | "timeout" | "seq" | "expr" | "md5sum" | "sha1sum" | "sha256sum" | "file" | "html-to-markdown" | "help" | "which" | "tac" | "hostname" | "od" | "gzip" | "gunzip" | "zcat" | "yq" | "xan";
|
|
4
4
|
/** Network command names (only available when network is configured) */
|
|
5
5
|
export type NetworkCommandName = "curl";
|
|
6
6
|
/** All command names including network commands */
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* rev - reverse lines characterwise
|
|
3
|
+
*
|
|
4
|
+
* Usage: rev [file ...]
|
|
5
|
+
*
|
|
6
|
+
* Copies the specified files to standard output, reversing the order
|
|
7
|
+
* of characters in every line. If no files are specified, standard
|
|
8
|
+
* input is read.
|
|
9
|
+
*/
|
|
10
|
+
import type { Command } from "../../types.js";
|
|
11
|
+
export declare const rev: Command;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* split - split a file into pieces
|
|
3
|
+
*
|
|
4
|
+
* Usage: split [OPTION]... [FILE [PREFIX]]
|
|
5
|
+
*
|
|
6
|
+
* Output pieces of FILE to PREFIXaa, PREFIXab, ...;
|
|
7
|
+
* default size is 1000 lines, and default PREFIX is 'x'.
|
|
8
|
+
*/
|
|
9
|
+
import type { Command } from "../../types.js";
|
|
10
|
+
export declare const split: Command;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* strings - print the sequences of printable characters in files
|
|
3
|
+
*
|
|
4
|
+
* Usage: strings [OPTION]... [FILE]...
|
|
5
|
+
*
|
|
6
|
+
* For each FILE, print the printable character sequences that are at least
|
|
7
|
+
* MIN characters long. If no FILE is specified, standard input is read.
|
|
8
|
+
*/
|
|
9
|
+
import type { Command } from "../../types.js";
|
|
10
|
+
export declare const strings: Command;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aggregation functions for xan command
|
|
3
|
+
*/
|
|
4
|
+
import { type EvaluateOptions } from "../query-engine/index.js";
|
|
5
|
+
import type { CsvData, CsvRow } from "./csv.js";
|
|
6
|
+
/** Aggregation specification from parsed expression */
|
|
7
|
+
export interface AggSpec {
|
|
8
|
+
func: string;
|
|
9
|
+
expr: string;
|
|
10
|
+
alias: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Parse aggregation expression: "func(expr) as alias" or "func(expr)"
|
|
14
|
+
* Handles nested parentheses in expressions like sum(add(a, b))
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseAggExpr(expr: string): AggSpec[];
|
|
17
|
+
/** Compute aggregation on data */
|
|
18
|
+
export declare function computeAgg(data: CsvData, spec: AggSpec, evalOptions?: EvaluateOptions): number | string | boolean | null;
|
|
19
|
+
/** Build aggregation result row */
|
|
20
|
+
export declare function buildAggRow(data: CsvData, specs: AggSpec[], evalOptions?: EvaluateOptions): CsvRow;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSV parsing and formatting utilities for xan command
|
|
3
|
+
*/
|
|
4
|
+
import type { CommandContext, ExecResult } from "../../types.js";
|
|
5
|
+
export interface CsvRow {
|
|
6
|
+
[key: string]: string | number | boolean | null;
|
|
7
|
+
}
|
|
8
|
+
export type CsvData = CsvRow[];
|
|
9
|
+
/** Format array of row objects back to CSV string */
|
|
10
|
+
export declare function formatCsv(headers: string[], data: CsvData): string;
|
|
11
|
+
/** Read CSV input from file or stdin */
|
|
12
|
+
export declare function readCsvInput(args: string[], ctx: CommandContext): Promise<{
|
|
13
|
+
headers: string[];
|
|
14
|
+
data: CsvData;
|
|
15
|
+
error?: ExecResult;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Moonblade expression parser for xan
|
|
3
|
+
*
|
|
4
|
+
* Parses moonblade expressions (xan's expression language) and transforms
|
|
5
|
+
* them to jq AST for evaluation by the shared query engine.
|
|
6
|
+
*
|
|
7
|
+
* Grammar based on xan's grammar.pest
|
|
8
|
+
*/
|
|
9
|
+
export type MoonbladeExpr = {
|
|
10
|
+
type: "int";
|
|
11
|
+
value: number;
|
|
12
|
+
} | {
|
|
13
|
+
type: "float";
|
|
14
|
+
value: number;
|
|
15
|
+
} | {
|
|
16
|
+
type: "string";
|
|
17
|
+
value: string;
|
|
18
|
+
} | {
|
|
19
|
+
type: "bool";
|
|
20
|
+
value: boolean;
|
|
21
|
+
} | {
|
|
22
|
+
type: "null";
|
|
23
|
+
} | {
|
|
24
|
+
type: "identifier";
|
|
25
|
+
name: string;
|
|
26
|
+
unsure: boolean;
|
|
27
|
+
} | {
|
|
28
|
+
type: "underscore";
|
|
29
|
+
} | {
|
|
30
|
+
type: "func";
|
|
31
|
+
name: string;
|
|
32
|
+
args: Array<{
|
|
33
|
+
name?: string;
|
|
34
|
+
expr: MoonbladeExpr;
|
|
35
|
+
}>;
|
|
36
|
+
} | {
|
|
37
|
+
type: "list";
|
|
38
|
+
elements: MoonbladeExpr[];
|
|
39
|
+
} | {
|
|
40
|
+
type: "map";
|
|
41
|
+
entries: Array<{
|
|
42
|
+
key: string;
|
|
43
|
+
value: MoonbladeExpr;
|
|
44
|
+
}>;
|
|
45
|
+
} | {
|
|
46
|
+
type: "regex";
|
|
47
|
+
pattern: string;
|
|
48
|
+
caseInsensitive: boolean;
|
|
49
|
+
} | {
|
|
50
|
+
type: "slice";
|
|
51
|
+
start?: MoonbladeExpr;
|
|
52
|
+
end?: MoonbladeExpr;
|
|
53
|
+
} | {
|
|
54
|
+
type: "lambda";
|
|
55
|
+
params: string[];
|
|
56
|
+
body: MoonbladeExpr;
|
|
57
|
+
} | {
|
|
58
|
+
type: "lambdaBinding";
|
|
59
|
+
name: string;
|
|
60
|
+
} | {
|
|
61
|
+
type: "pipeline";
|
|
62
|
+
exprs: MoonbladeExpr[];
|
|
63
|
+
};
|
|
64
|
+
export interface NamedExpr {
|
|
65
|
+
expr: MoonbladeExpr;
|
|
66
|
+
name: string | string[];
|
|
67
|
+
}
|
|
68
|
+
export interface Aggregation {
|
|
69
|
+
aggName: string;
|
|
70
|
+
funcName: string;
|
|
71
|
+
args: MoonbladeExpr[];
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Parse named expressions like: "expr1, expr2 as name, expr3 as (a, b)"
|
|
75
|
+
*/
|
|
76
|
+
export declare function parseNamedExpressions(input: string): NamedExpr[];
|
|
77
|
+
/**
|
|
78
|
+
* Parse a moonblade expression string into AST
|
|
79
|
+
*/
|
|
80
|
+
export declare function parseMoonblade(input: string): MoonbladeExpr;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transform moonblade AST to jq AST
|
|
3
|
+
*
|
|
4
|
+
* This module converts moonblade expressions (xan's expression language)
|
|
5
|
+
* to jq AST for evaluation by the shared query engine.
|
|
6
|
+
*/
|
|
7
|
+
import type { AstNode } from "../query-engine/parser.js";
|
|
8
|
+
import type { MoonbladeExpr } from "./moonblade-parser.js";
|
|
9
|
+
/**
|
|
10
|
+
* Transform moonblade AST to jq AST
|
|
11
|
+
*/
|
|
12
|
+
export declare function moonbladeToJq(expr: MoonbladeExpr, rowContext?: boolean): AstNode;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Barrel file for xan subcommand handlers
|
|
3
|
+
*
|
|
4
|
+
* This file re-exports all subcommands from their individual modules
|
|
5
|
+
* for cleaner organization and easier maintenance.
|
|
6
|
+
*/
|
|
7
|
+
export { cmdAgg, cmdFrequency, cmdGroupby, cmdStats } from "./xan-agg.js";
|
|
8
|
+
export { cmdDrop, cmdEnum, cmdRename, cmdSelect } from "./xan-columns.js";
|
|
9
|
+
export { cmdCount, cmdHead, cmdHeaders, cmdReverse, cmdSlice, cmdTail, } from "./xan-core.js";
|
|
10
|
+
export { cmdFixlengths, cmdFrom, cmdPartition, cmdShuffle, cmdSplit, cmdTo, cmdTranspose, } from "./xan-data.js";
|
|
11
|
+
export { cmdDedup, cmdFilter, cmdSort, cmdTop } from "./xan-filter.js";
|
|
12
|
+
export { cmdMap, cmdTransform } from "./xan-map.js";
|
|
13
|
+
export { cmdExplode, cmdImplode, cmdJoin, cmdMerge, cmdPivot, } from "./xan-reshape.js";
|
|
14
|
+
export { cmdBehead, cmdCat, cmdFlatmap, cmdFmt, cmdSample, cmdSearch, } from "./xan-simple.js";
|
|
15
|
+
export { cmdFlatten, cmdView } from "./xan-view.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aggregation commands: agg, groupby, frequency, stats
|
|
3
|
+
*/
|
|
4
|
+
import type { CommandContext, ExecResult } from "../../types.js";
|
|
5
|
+
export declare function cmdAgg(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
6
|
+
export declare function cmdGroupby(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
7
|
+
export declare function cmdFrequency(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
8
|
+
export declare function cmdStats(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column operation commands: select, drop, rename, enum
|
|
3
|
+
*/
|
|
4
|
+
import type { CommandContext, ExecResult } from "../../types.js";
|
|
5
|
+
export declare function cmdSelect(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
6
|
+
export declare function cmdDrop(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
7
|
+
export declare function cmdRename(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
8
|
+
export declare function cmdEnum(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core xan commands: headers, count, head, tail, slice, reverse
|
|
3
|
+
*/
|
|
4
|
+
import type { CommandContext, ExecResult } from "../../types.js";
|
|
5
|
+
export declare function cmdHeaders(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
6
|
+
export declare function cmdCount(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
7
|
+
export declare function cmdHead(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
8
|
+
export declare function cmdTail(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
9
|
+
export declare function cmdSlice(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
10
|
+
export declare function cmdReverse(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data utility commands: transpose, shuffle, fixlengths, split, partition
|
|
3
|
+
* Commands that exist in real xan
|
|
4
|
+
*/
|
|
5
|
+
import type { CommandContext, ExecResult } from "../../types.js";
|
|
6
|
+
/**
|
|
7
|
+
* Transpose: swap rows and columns
|
|
8
|
+
* Usage: xan transpose [FILE]
|
|
9
|
+
* First column becomes header row, first row becomes header column
|
|
10
|
+
*/
|
|
11
|
+
export declare function cmdTranspose(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
12
|
+
/**
|
|
13
|
+
* Shuffle: randomly reorder rows
|
|
14
|
+
* Usage: xan shuffle [OPTIONS] [FILE]
|
|
15
|
+
* --seed N Random seed for reproducibility
|
|
16
|
+
*/
|
|
17
|
+
export declare function cmdShuffle(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
18
|
+
/**
|
|
19
|
+
* Fixlengths: fix ragged CSV by padding/truncating rows
|
|
20
|
+
* Usage: xan fixlengths [OPTIONS] [FILE]
|
|
21
|
+
* -l, --length N Target number of columns (default: max row length)
|
|
22
|
+
* -d, --default V Default value for missing fields (default: empty)
|
|
23
|
+
*/
|
|
24
|
+
export declare function cmdFixlengths(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
25
|
+
/**
|
|
26
|
+
* Split: split CSV into multiple files by row count
|
|
27
|
+
* Usage: xan split [OPTIONS] FILE
|
|
28
|
+
* -c, --chunks N Split into N equal chunks
|
|
29
|
+
* -S, --size N Split into chunks of N rows each
|
|
30
|
+
* -o, --output DIR Output directory (default: current)
|
|
31
|
+
*
|
|
32
|
+
* In sandbox mode, outputs as JSON with parts as array
|
|
33
|
+
*/
|
|
34
|
+
export declare function cmdSplit(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
35
|
+
/**
|
|
36
|
+
* Partition: split CSV by column value into separate outputs
|
|
37
|
+
* Usage: xan partition COLUMN [OPTIONS] [FILE]
|
|
38
|
+
* -o, --output DIR Output directory (default: current)
|
|
39
|
+
*/
|
|
40
|
+
export declare function cmdPartition(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
41
|
+
/**
|
|
42
|
+
* To: convert CSV to other formats
|
|
43
|
+
* Usage: xan to FORMAT [OPTIONS] [FILE]
|
|
44
|
+
* FORMAT: json
|
|
45
|
+
*/
|
|
46
|
+
export declare function cmdTo(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
47
|
+
/**
|
|
48
|
+
* From: convert other formats to CSV
|
|
49
|
+
* Usage: xan from [OPTIONS] [FILE]
|
|
50
|
+
* -f, --format FORMAT Input format (json)
|
|
51
|
+
*/
|
|
52
|
+
export declare function cmdFrom(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filter and sort commands: filter, sort, dedup, top
|
|
3
|
+
*/
|
|
4
|
+
import type { CommandContext, ExecResult } from "../../types.js";
|
|
5
|
+
export declare function cmdFilter(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
6
|
+
export declare function cmdSort(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
7
|
+
export declare function cmdDedup(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
8
|
+
export declare function cmdTop(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map command: add computed columns
|
|
3
|
+
*/
|
|
4
|
+
import type { CommandContext, ExecResult } from "../../types.js";
|
|
5
|
+
export declare function cmdMap(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
6
|
+
/**
|
|
7
|
+
* Transform command: modify existing columns in-place
|
|
8
|
+
* Usage: xan transform COLUMN EXPR [FILE]
|
|
9
|
+
* -r, --rename NAME Rename the column after transformation
|
|
10
|
+
*/
|
|
11
|
+
export declare function cmdTransform(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reshape commands: explode, implode, flatmap, pivot, join, merge
|
|
3
|
+
*/
|
|
4
|
+
import type { CommandContext, ExecResult } from "../../types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Explode: split delimited column values into multiple rows
|
|
7
|
+
* Usage: xan explode COLUMN [OPTIONS] [FILE]
|
|
8
|
+
* -s, --separator SEP Value separator (default: |)
|
|
9
|
+
* --drop-empty Drop rows where column is empty
|
|
10
|
+
* -r, --rename NAME Rename the column
|
|
11
|
+
*/
|
|
12
|
+
export declare function cmdExplode(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
13
|
+
/**
|
|
14
|
+
* Implode: combine consecutive rows with same key, joining column values
|
|
15
|
+
* Usage: xan implode COLUMN [OPTIONS] [FILE]
|
|
16
|
+
* -s, --separator SEP Value separator (default: |)
|
|
17
|
+
* -r, --rename NAME Rename the column
|
|
18
|
+
*/
|
|
19
|
+
export declare function cmdImplode(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
20
|
+
/**
|
|
21
|
+
* Join: join two CSV files on key columns
|
|
22
|
+
* Usage: xan join KEY1 FILE1 KEY2 FILE2 [OPTIONS]
|
|
23
|
+
* --left Left outer join (keep all rows from first file)
|
|
24
|
+
* --right Right outer join (keep all rows from second file)
|
|
25
|
+
* --full Full outer join (keep all rows from both files)
|
|
26
|
+
* -D, --default VALUE Default value for missing fields
|
|
27
|
+
*/
|
|
28
|
+
export declare function cmdJoin(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
29
|
+
/**
|
|
30
|
+
* Pivot: reshape data by turning row values into columns
|
|
31
|
+
* Usage: xan pivot COLUMN AGG_EXPR [OPTIONS] [FILE]
|
|
32
|
+
* -g, --groupby COLS Group by these columns (default: all other columns)
|
|
33
|
+
*/
|
|
34
|
+
export declare function cmdPivot(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
35
|
+
/**
|
|
36
|
+
* Merge: merge multiple sorted CSV files
|
|
37
|
+
* Usage: xan merge [OPTIONS] FILE1 FILE2 ...
|
|
38
|
+
* -s, --sort COLUMN Sort column (files must be pre-sorted by this)
|
|
39
|
+
*/
|
|
40
|
+
export declare function cmdMerge(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple commands: behead, sample, cat, search, flatmap, fmt
|
|
3
|
+
*/
|
|
4
|
+
import type { CommandContext, ExecResult } from "../../types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Behead: remove header row from CSV (output data rows only)
|
|
7
|
+
* Usage: xan behead [FILE]
|
|
8
|
+
*/
|
|
9
|
+
export declare function cmdBehead(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
10
|
+
/**
|
|
11
|
+
* Sample: randomly sample N rows from CSV
|
|
12
|
+
* Usage: xan sample [OPTIONS] <sample-size> [FILE]
|
|
13
|
+
* --seed SEED Random seed for reproducibility
|
|
14
|
+
*/
|
|
15
|
+
export declare function cmdSample(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
16
|
+
/**
|
|
17
|
+
* Cat: concatenate CSV files
|
|
18
|
+
* Usage: xan cat [OPTIONS] FILE1 FILE2 ...
|
|
19
|
+
* -p, --pad Pad missing columns with empty values
|
|
20
|
+
*/
|
|
21
|
+
export declare function cmdCat(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
22
|
+
/**
|
|
23
|
+
* Search: filter rows by regex match on any/specific columns
|
|
24
|
+
* Usage: xan search [OPTIONS] PATTERN [FILE]
|
|
25
|
+
* -s, --select COLS Only search in these columns
|
|
26
|
+
* -v, --invert Invert match (exclude matching rows)
|
|
27
|
+
* -i, --ignore-case Case insensitive match
|
|
28
|
+
*/
|
|
29
|
+
export declare function cmdSearch(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
30
|
+
/**
|
|
31
|
+
* Flatmap: like map but expression can return multiple rows
|
|
32
|
+
* Usage: xan flatmap EXPR [FILE]
|
|
33
|
+
* The expression should return an array; each element becomes a row
|
|
34
|
+
*/
|
|
35
|
+
export declare function cmdFlatmap(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
36
|
+
/**
|
|
37
|
+
* Fmt: format CSV as a table (alias for view with options)
|
|
38
|
+
* Usage: xan fmt [OPTIONS] [FILE]
|
|
39
|
+
*/
|
|
40
|
+
export declare function cmdFmt(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utilities for xan subcommands
|
|
3
|
+
*/
|
|
4
|
+
import type { AstNode } from "../query-engine/parser.js";
|
|
5
|
+
/**
|
|
6
|
+
* Parse a moonblade expression and transform to jq AST
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseMoonbladeExpr(expr: string): AstNode;
|
|
9
|
+
/**
|
|
10
|
+
* Parse column specification which can include:
|
|
11
|
+
* - Column names (e.g., "name,email")
|
|
12
|
+
* - Column indices (e.g., "0,2")
|
|
13
|
+
* - Numeric ranges (e.g., "0-2" means columns 0, 1, 2)
|
|
14
|
+
* - Column name ranges (e.g., "name:email" means columns from name to email)
|
|
15
|
+
* - Glob patterns (e.g., "vec_*", "*_count")
|
|
16
|
+
* - Negation (e.g., "!name" excludes column)
|
|
17
|
+
* Returns an array of column names
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseColumnSpec(spec: string, headers: string[]): string[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* View commands: pretty print CSV as table or flattened records
|
|
3
|
+
*/
|
|
4
|
+
import type { CommandContext, ExecResult } from "../../types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Flatten: display records vertically, one field per line
|
|
7
|
+
* Usage: xan flatten [OPTIONS] [FILE]
|
|
8
|
+
* -l, --limit N Maximum number of rows to display
|
|
9
|
+
* -s, --select COLS Select columns to display
|
|
10
|
+
*/
|
|
11
|
+
export declare function cmdFlatten(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
12
|
+
export declare function cmdView(args: string[], ctx: CommandContext): Promise<ExecResult>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* xan - CSV toolkit command
|
|
3
|
+
*
|
|
4
|
+
* Provides ergonomic CLI for CSV operations, translating commands to jq expressions
|
|
5
|
+
* and using the shared query engine. Inspired by xsv and xan tools.
|
|
6
|
+
*/
|
|
7
|
+
import type { Command } from "../../types.js";
|
|
8
|
+
export declare const xanCommand: Command;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format parsing and output for yq command
|
|
3
|
+
*
|
|
4
|
+
* Supports YAML, JSON, XML, INI, CSV, and TOML formats with conversion between them.
|
|
5
|
+
*/
|
|
6
|
+
import type { QueryValue } from "../query-engine/index.js";
|
|
7
|
+
export type InputFormat = "yaml" | "xml" | "json" | "ini" | "csv" | "toml";
|
|
8
|
+
export type OutputFormat = "yaml" | "json" | "xml" | "ini" | "csv" | "toml";
|
|
9
|
+
/**
|
|
10
|
+
* Type guard to validate input format strings at runtime
|
|
11
|
+
*/
|
|
12
|
+
export declare function isValidInputFormat(value: unknown): value is InputFormat;
|
|
13
|
+
/**
|
|
14
|
+
* Type guard to validate output format strings at runtime
|
|
15
|
+
*/
|
|
16
|
+
export declare function isValidOutputFormat(value: unknown): value is OutputFormat;
|
|
17
|
+
export interface FormatOptions {
|
|
18
|
+
/** Input format (default: yaml) */
|
|
19
|
+
inputFormat: InputFormat;
|
|
20
|
+
/** Output format (default: yaml) */
|
|
21
|
+
outputFormat: OutputFormat;
|
|
22
|
+
/** Output raw strings without quotes (json only) */
|
|
23
|
+
raw: boolean;
|
|
24
|
+
/** Compact output (json only) */
|
|
25
|
+
compact: boolean;
|
|
26
|
+
/** Pretty print output */
|
|
27
|
+
prettyPrint: boolean;
|
|
28
|
+
/** Indentation level */
|
|
29
|
+
indent: number;
|
|
30
|
+
/** XML attribute prefix (default: +@) */
|
|
31
|
+
xmlAttributePrefix: string;
|
|
32
|
+
/** XML text content name (default: +content) */
|
|
33
|
+
xmlContentName: string;
|
|
34
|
+
/** CSV delimiter (empty = auto-detect) */
|
|
35
|
+
csvDelimiter: string;
|
|
36
|
+
/** CSV has header row */
|
|
37
|
+
csvHeader: boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare const defaultFormatOptions: FormatOptions;
|
|
40
|
+
/**
|
|
41
|
+
* Detect input format from file extension
|
|
42
|
+
*/
|
|
43
|
+
export declare function detectFormatFromExtension(filename: string): InputFormat | null;
|
|
44
|
+
/**
|
|
45
|
+
* Parse input data from the given format into a QueryValue
|
|
46
|
+
*/
|
|
47
|
+
export declare function parseInput(input: string, options: FormatOptions): QueryValue;
|
|
48
|
+
/**
|
|
49
|
+
* Parse all YAML documents from input (for slurp mode)
|
|
50
|
+
*/
|
|
51
|
+
export declare function parseAllYamlDocuments(input: string): QueryValue[];
|
|
52
|
+
/**
|
|
53
|
+
* Extract front-matter from content
|
|
54
|
+
* Front-matter is YAML/TOML/JSON at the start of a file between --- or +++ delimiters
|
|
55
|
+
* Returns { frontMatter: parsed data, content: remaining content } or null if no front-matter
|
|
56
|
+
*/
|
|
57
|
+
export declare function extractFrontMatter(input: string): {
|
|
58
|
+
frontMatter: QueryValue;
|
|
59
|
+
content: string;
|
|
60
|
+
} | null;
|
|
61
|
+
/**
|
|
62
|
+
* Format a QueryValue for output in the given format
|
|
63
|
+
*/
|
|
64
|
+
export declare function formatOutput(value: QueryValue, options: FormatOptions): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* yq - Command-line YAML/XML/INI/CSV/TOML processor
|
|
3
|
+
*
|
|
4
|
+
* Uses jq-style query expressions to process YAML, XML, INI, CSV, and TOML files.
|
|
5
|
+
* Shares the query engine with jq for consistent filtering behavior.
|
|
6
|
+
*
|
|
7
|
+
* Inspired by mikefarah/yq (https://github.com/mikefarah/yq)
|
|
8
|
+
* This is a reimplementation for the just-bash sandboxed environment.
|
|
9
|
+
*/
|
|
10
|
+
import type { Command } from "../../types.js";
|
|
11
|
+
export declare const yqCommand: Command;
|