codex-1up 0.1.2 → 0.1.4
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 +1 -0
- package/dist/main.js +39 -23
- package/package.json +1 -1
- package/scripts/release.ts +73 -8
- package/templates/agent-templates/AGENTS-default.md +4 -1
- package/templates/codex-config.toml +4 -0
package/README.md
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
- ✅ Unified **Codex config** with multiple profiles: `balanced` / `safe` / `minimal` / `yolo`
|
|
12
12
|
- ✅ 🔊 **Notification sounds** with customizable audio alerts for Codex events
|
|
13
13
|
|
|
14
|
+
![Screenshot of Codex 1UP terminal interface] (https://raw.githubusercontent.com/regenrek/codex-1up/main/public/example.png)
|
|
14
15
|
|
|
15
16
|
## Quick start
|
|
16
17
|
|
package/dist/main.js
CHANGED
|
@@ -1,31 +1,47 @@
|
|
|
1
|
-
import{runMain as
|
|
2
|
-
`:`${
|
|
3
|
-
`;process.stdout.write(r),t&&t.write(r)};return{log:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
`),
|
|
1
|
+
import{runMain as Ht}from"citty";import{defineCommand as Bt}from"citty";import{defineCommand as dt}from"citty";import{fileURLToPath as ut}from"url";import{dirname as gt,resolve as D}from"path";import{promises as Z}from"fs";import*as V from"os";import{accessSync as mt}from"fs";import*as Oe from"toml";import*as p from"@clack/prompts";import{which as O,$ as z}from"zx";import ct from"fs-extra";import*as pe from"path";import*as xe from"os";import{createWriteStream as Ye}from"fs";function me(e){let t=null;try{t=Ye(e,{flags:"a"})}catch{}let o=(i,n)=>{let r=i?`${i} ${n}
|
|
2
|
+
`:`${n}
|
|
3
|
+
`;process.stdout.write(r),t&&t.write(r)};return{log:i=>o("",i),info:i=>o("",i),ok:i=>o("\u2714",i),warn:i=>o("\u26A0",i),err:i=>o("\u2716",i)}}import{$ as _}from"zx";import{which as Qe}from"zx";import{spawn as Ze}from"child_process";async function d(e){try{return await Qe(e),!0}catch{return!1}}async function he(){return await d("brew")?"brew":await d("apt-get")?"apt":await d("dnf")?"dnf":await d("pacman")?"pacman":await d("zypper")?"zypper":"none"}async function w(e,t,o={dryRun:!1}){if(o.dryRun){let n=[e,...t].map(r=>r.includes(" ")?`"${r}"`:r).join(" ");o.logger?.log(`[dry-run] ${n}`);return}let i=Ze(e,t,{stdio:"inherit",cwd:o.cwd||process.cwd(),shell:!1});await new Promise((n,r)=>{i.on("error",r),i.on("exit",s=>{if(s===0)return n();r(new Error(`Command failed (${s}): ${e} ${t.join(" ")}`))})})}function T(e){let t=new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5);return`${e}.backup.${t}`}import we from"fs-extra";import*as G from"path";import*as U from"os";async function ye(e){let t=await d("node"),o=await d("npm");if(t&&o){let n=(await _`node -v`).stdout.trim();e.logger.ok(`Node.js present (${n})`);return}switch(e.options.installNode){case"nvm":await et(e);break;case"brew":await tt(e);break;case"skip":e.logger.warn("Skipping Node installation; please install Node 18+ manually");return}if(await d("node")){let n=(await _`node -v`).stdout.trim();e.logger.ok(`Node.js installed (${n})`)}else throw e.logger.err("Node installation failed"),new Error("Node.js installation failed")}async function et(e){if(e.logger.info("Installing Node.js via nvm"),e.options.dryRun){e.logger.log("[dry-run] install nvm + Node LTS");return}let t=G.join(e.homeDir,".nvm"),o=G.join(t,"nvm.sh");await we.pathExists(t)||(e.logger.info("Installing nvm..."),await _`bash -c "curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash"`);let i=`export NVM_DIR="${t}" && [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && nvm install --lts`;await _`bash -c ${i}`}async function tt(e){if(e.logger.info("Installing Node.js via Homebrew"),!await d("brew"))if(U.platform()==="darwin"){if(e.logger.info("Homebrew not found; installing Homebrew"),e.options.dryRun){e.logger.log("[dry-run] install Homebrew");return}await _`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`;let t=U.platform()==="darwin"&&U.arch()==="arm64"?"/opt/homebrew/bin/brew":"/usr/local/bin/brew";if(await we.pathExists(t)){let o=G.dirname(t);process.env.PATH=`${o}:${process.env.PATH||""}`;try{let n=(await _`${t} shellenv`).stdout.trim().match(/export PATH="([^"]+)"/);n&&(process.env.PATH=`${n[1]}:${process.env.PATH||""}`)}catch{}}}else throw new Error("Homebrew is only available on macOS");await w("brew",["install","node"],{dryRun:e.options.dryRun,logger:e.logger})}import{$ as re}from"zx";var ot=["@openai/codex","@ast-grep/cli"];async function be(e){e.logger.info("Checking global npm packages (@openai/codex, @ast-grep/cli)");let t=[];for(let o of ot)try{let n=(await re`npm view ${o} version`.quiet()).stdout.trim();if(!n){e.logger.warn(`Could not fetch latest version for ${o}; skipping upgrade check`);continue}let r=await re`npm ls -g ${o} --depth=0 --json`.quiet().nothrow(),s="";try{s=JSON.parse(r.stdout||"{}").dependencies?.[o]?.version||""}catch{s=""}s?s!==n?(e.logger.info(`${o} ${s} -> ${n}`),t.push(`${o}@${n}`)):e.logger.ok(`${o} up-to-date (${s})`):(e.logger.info(`${o} not installed; will install @${n}`),t.push(`${o}@${n}`))}catch(i){e.logger.warn(`Error checking ${o}: ${i}`);let n=await re`npm ls -g ${o} --depth=0 --json`.quiet().nothrow(),r="";try{r=JSON.parse(n.stdout||"{}").dependencies?.[o]?.version||""}catch{r=""}r||t.push(o)}t.length>0?(e.logger.info("Installing/updating global npm packages"),await w("npm",["install","-g",...t],{dryRun:e.options.dryRun,logger:e.logger})):e.logger.ok("Global npm packages are up-to-date"),await d("codex")?e.logger.ok("Codex CLI installed"):e.logger.err("Codex CLI not found after install"),await d("ast-grep")?e.logger.ok("ast-grep installed"):e.logger.warn("ast-grep not found; check npm global path")}import{$ as nt}from"zx";import*as ae from"path";import se from"fs-extra";var it={brew:["fd","ripgrep","fzf","jq","yq","difftastic"],apt:["ripgrep","fzf","jq","yq","git-delta"],dnf:["ripgrep","fd-find","fzf","jq","yq","git-delta"],pacman:["ripgrep","fd","fzf","jq","yq","git-delta"],zypper:["ripgrep","fd","fzf","jq","yq","git-delta"],none:[]};async function $e(e){let t=await he();if(e.logger.info(`Detected package manager: ${t}`),t==="none"){e.logger.warn("Could not detect a supported package manager; please install tools manually");return}let o=it[t]||[];if(o.length>0)switch(t){case"brew":await w("brew",["update"],{dryRun:e.options.dryRun,logger:e.logger}),await w("brew",["install",...o],{dryRun:e.options.dryRun,logger:e.logger});break;case"apt":await w("sudo",["apt-get","update","-y"],{dryRun:e.options.dryRun,logger:e.logger}),await w("sudo",["apt-get","install","-y",...o],{dryRun:e.options.dryRun,logger:e.logger}).catch(()=>{}),await d("fd")||await w("sudo",["apt-get","install","-y","fd-find"],{dryRun:e.options.dryRun,logger:e.logger}).catch(()=>{});break;case"dnf":await w("sudo",["dnf","install","-y",...o],{dryRun:e.options.dryRun,logger:e.logger}).catch(()=>{});break;case"pacman":await w("sudo",["pacman","-Sy","--noconfirm",...o],{dryRun:e.options.dryRun,logger:e.logger}).catch(()=>{});break;case"zypper":await w("sudo",["zypper","refresh"],{dryRun:e.options.dryRun,logger:e.logger}),await w("sudo",["zypper","install","-y",...o],{dryRun:e.options.dryRun,logger:e.logger}).catch(()=>{});break}if(!await d("difft")&&!await d("difftastic")&&(await d("cargo")?(e.logger.info("Installing difftastic via cargo"),await w("cargo",["install","difftastic"],{dryRun:e.options.dryRun,logger:e.logger})):e.logger.warn("difftastic not found and Rust/cargo missing; falling back to git-delta")),await d("fdfind")&&!await d("fd")){let n=ae.join(e.homeDir,".local","bin");await se.ensureDir(n);let r=(await nt`command -v fdfind`).stdout.trim(),s=ae.join(n,"fd");await se.pathExists(s)||(e.options.dryRun?e.logger.log(`[dry-run] ln -s ${r} ${s}`):await se.symlink(r,s),e.logger.ok("fd alias created at ~/.local/bin/fd"))}let i=["fd","fdfind","rg","fzf","jq","yq","difft","difftastic","delta","ast-grep"];for(let n of i)await d(n)&&e.logger.ok(`${n} \u2713`)}import W from"fs-extra";import*as Y from"path";var ke={balanced:{root:[["approval_policy",'"on-request"'],["sandbox_mode",'"workspace-write"']],features:[["web_search_request","true"]]},safe:{root:[["approval_policy",'"on-failure"'],["sandbox_mode",'"workspace-write"']],features:[["web_search_request","false"]]},minimal:{root:[["model_reasoning_effort",'"minimal"']],features:[["web_search_request","false"]]},yolo:{root:[["approval_policy",'"never"'],["sandbox_mode",'"danger-full-access"']],features:[["web_search_request","true"]]}},rt=`# ~/.codex/config.toml \u2014 managed by codex-1up (patch mode)
|
|
4
|
+
`;async function Se(e){let t=Y.join(e.homeDir,".codex","config.toml");await W.ensureDir(Y.dirname(t));let o=await W.pathExists(t),i=o?await W.readFile(t,"utf8"):rt,n=new le(i),r=!1;if(r=st(n,e.options.profilesAction)||r,r=at(n,e.options.reasoning)||r,r=lt(n,e.options.notificationSound)||r,!r){e.logger.info("Config already up to date; no changes needed.");return}let s=n.content();if(e.options.dryRun){e.logger.log(`[dry-run] write ${t}`),e.logger.log(s);return}if(o){let a=T(t);await W.copy(t,a),e.logger.info(`Backed up current config to ${a}`)}await W.writeFile(t,s,"utf8"),e.logger.ok("Updated ~/.codex/config.toml with requested settings.")}function st(e,t){if(t==="skip")return!1;let o=!1;for(let i of Object.keys(ke)){let n=ke[i];if(t==="overwrite")o=e.replaceTable(`profiles.${i}`,n.root)||o,o=e.replaceTable(`profiles.${i}.features`,n.features)||o;else{e.ensureTable(`profiles.${i}`);for(let[r,s]of n.root)o=e.setKey(`profiles.${i}`,r,s,{mode:"if-missing"})||o;e.ensureTable(`profiles.${i}.features`);for(let[r,s]of n.features)o=e.setKey(`profiles.${i}.features`,r,s,{mode:"if-missing"})||o}}return o}function at(e,t){if(t==="off")return!1;e.ensureTable("tui");let o=e.setKey("tui","show_raw_agent_reasoning","true",{mode:"force"}),i=e.setKey("tui","hide_agent_reasoning","false",{mode:"force"});return o||i}function lt(e,t){if(!t||t==="none")return!1;e.ensureTable("tui");let o=e.getValue("tui","notifications");if(o){let i=o.trim().toLowerCase();if(i.startsWith("true")||i.startsWith("["))return!1}return e.setKey("tui","notifications","true",{mode:"force"})}var le=class{text;constructor(t){this.text=t||""}content(){return pt(this.text)}ensureTable(t){if(this.hasTable(t))return!1;let o=this.text.length===0?"":Ce(this.text);return this.text=o+`[${t}]
|
|
5
|
+
`,!0}setKey(t,o,i,n){let r=X(this.text,t);if(!r)return this.ensureTable(t),this.setKey(t,o,i,n);let s=this.text.slice(r.start,r.end),c=new RegExp(`^\\s*${ve(o)}\\s*=.*$`,"m").exec(s);if(c){if(n.mode==="if-missing")return!1;let I=this.text,P=r.start+c.index,J=P+c[0].length;return this.text=I.slice(0,P)+`${o} = ${i}`+I.slice(J),this.text!==I}let $=this.text,h=r.end,y=$.slice(0,h),v=$.slice(h),l=y.length>0&&!y.endsWith(`
|
|
6
|
+
`),f=v.length>0&&!v.startsWith(`
|
|
7
|
+
`),u=`${l?`
|
|
8
|
+
`:""}${o} = ${i}
|
|
9
|
+
${f?`
|
|
10
|
+
`:""}`;return this.text=y+u+v,this.text!==$}getValue(t,o){let i=X(this.text,t);if(!i)return;let n=this.text.slice(i.start,i.end),s=new RegExp(`^\\s*${ve(o)}\\s*=\\s*(.+)$`,"m").exec(n);return s?s[1]:void 0}replaceTable(t,o){let i=o.map(([a,c])=>`${a} = ${c}`).join(`
|
|
11
|
+
`),n=`[${t}]
|
|
12
|
+
${i}
|
|
13
|
+
|
|
14
|
+
`,r=this.text,s=X(this.text,t);if(!s){let a=r.length===0?"":Ce(r);return this.text=a+n,this.text!==r}return this.text=r.slice(0,s.start)+n+r.slice(s.end),this.text!==r}hasTable(t){return X(this.text,t)!==null}};function X(e,t){let o=/^\s*\[([^\]]+)\]\s*$/gm,i=[],n;for(;n=o.exec(e);)i.push({name:n[1].trim(),index:n.index});for(let r=0;r<i.length;r++)if(i[r].name===t){let s=i[r].index,a=i[r+1]?.index??e.length;return{start:s,end:a}}return null}function ve(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function pt(e){return e.endsWith(`
|
|
15
|
+
`)?e:e+`
|
|
16
|
+
`}function Ce(e){let t=e;return t.endsWith(`
|
|
17
|
+
`)||(t+=`
|
|
18
|
+
`),t.endsWith(`
|
|
19
|
+
|
|
20
|
+
`)||(t+=`
|
|
21
|
+
`),t}import R from"fs-extra";import*as j from"path";async function Ee(e){let t=j.join(e.homeDir,".codex","notify.sh"),o=j.join(e.rootDir,"templates","notification.sh");await R.ensureDir(j.dirname(t));let i=e.options.notify;if(i==="no"){e.logger.info("Skipping notify hook installation");return}if(!await R.pathExists(o)){e.logger.warn(`Notification template missing at ${o}; skipping notify hook install`);return}if(await R.pathExists(t))if(i==="yes"){let r=T(t);e.options.dryRun?e.logger.log(`[dry-run] cp ${t} ${r}`):await R.copy(t,r),e.options.dryRun?e.logger.log(`[dry-run] cp ${o} ${t}`):(await R.copy(o,t),await R.chmod(t,493)),e.logger.ok("Updated notify hook (backup created)")}else!e.options.assumeYes&&!e.options.skipConfirmation&&e.logger.info("Keeping existing notify hook");else e.options.dryRun?e.logger.log(`[dry-run] cp ${o} ${t}`):(await R.copy(o,t),await R.chmod(t,493)),e.logger.ok("Installed notify hook to ~/.codex/notify.sh");let n=j.join(e.homeDir,".codex","config.toml");await R.pathExists(n)?await ft(n,t,e):e.logger.warn(`Config not found at ${n}; run again after config is created`)}async function ft(e,t,o){if(o.options.dryRun){o.logger.log("[dry-run] update config notify and tui.notifications");return}let n=(await R.readFile(e,"utf8")).split(/\r?\n/),r="",s=null,a=null,c=!1,$=!1;for(let l=0;l<n.length;l++){let f=n[l],u=f.match(/^\s*\[([^\]]+)\]\s*$/);if(u){r=u[1],r==="tui"&&(a=l);continue}let I=/^\s*notify\s*=\s*\[/.test(f),P=/^\s*tui\.notifications\s*=/.test(f),J=/^\s*notifications\s*=/.test(f);I&&(r===""?s===null&&(s=l):/^profiles\.[^.]+\.features$/.test(r)&&(n.splice(l,1),l--,c=!0)),P&&/^profiles\.[^.]+\.features$/.test(r)&&(n.splice(l,1),l--,$=!0),J&&r===""&&(n.splice(l,1),l--,$=!0)}function h(l){let f=0;for(;f<n.length&&/^\s*(#.*)?$/.test(n[f]);)f++;n.splice(f,0,l)}if(s!==null){let l=n[s].match(/^(\s*notify\s*=\s*\[)([^\]]*)\]/);if(l){let f=l[2].trim();if(!f.includes(JSON.stringify(t))){let I=f&&!f.endsWith(",")?", ":"";n[s]=`${l[1]}${f}${I}${JSON.stringify(t)}]`,o.logger.ok("Added notify hook to config")}}}else h(`notify = [${JSON.stringify(t)}]`),o.logger.ok("Enabled notify hook in config");let y=!1;if(a!==null){let l=a+1,f=!1;for(;l<n.length;l++){let u=n[l];if(/^\s*\[/.test(u))break;if(/^\s*notifications\s*=/.test(u)){n[l]="notifications = true",f=!0,y=!0;break}}f||(n.splice(a+1,0,"notifications = true"),y=!0)}y||h(`[tui]
|
|
22
|
+
notifications = true`);let v=[];r="";for(let l=0;l<n.length;l++){let f=n[l],u=f.match(/^\s*\[([^\]]+)\]\s*$/);if(u){r=u[1],v.push(f);continue}/^\s*tui\.notifications\s*=/.test(f)||/^\s*notifications\s*=/.test(f)&&r!=="tui"||v.push(f)}await R.writeFile(e,v.join(`
|
|
23
|
+
`),"utf8")}import C from"fs-extra";import*as m from"path";async function Te(e){let t=m.join(e.rootDir,"sounds"),o=m.join(e.homeDir,".codex","sounds");await C.ensureDir(o);let i=e.options.notificationSound;if(i==="none"){let y=await Re(e);e.options.dryRun?e.logger.log(`[dry-run] update ${y}`):await Ne(y,`# Notification sound (disabled)
|
|
8
24
|
export CODEX_DISABLE_SOUND=1
|
|
9
25
|
export CODEX_CUSTOM_SOUND=""
|
|
10
|
-
`,e);let l=
|
|
26
|
+
`,e);let l=m.join(e.homeDir,".codex","notify.sh");if(await C.pathExists(l)){let f=await C.readFile(l,"utf8"),u=f.replace(/^DEFAULT_CODEX_SOUND=.*$/m,'DEFAULT_CODEX_SOUND=""');e.options.dryRun?e.logger.log(`[dry-run] patch ${l} DEFAULT_CODEX_SOUND -> empty`):u!==f&&await C.writeFile(l,u,"utf8")}e.logger.ok("Notification sound disabled");return}let n;if(i&&!m.isAbsolute(i)?n=m.join(t,i):i?n=i:e.options.mode==="recommended"&&(n=m.join(t,"noti_1.wav")),!n||!await C.pathExists(n)){e.logger.warn("No notification sound selected or file missing; skipping sound setup");return}let r=m.isAbsolute(n),s=n.startsWith(m.join(e.rootDir,"sounds")),a=!r||s?m.join(o,m.basename(n)):n;(!r||s)&&(e.options.dryRun?e.logger.log(`[dry-run] cp ${n} ${a}`):await C.copy(n,a));let c=await Re(e),$=`# Notification sound
|
|
11
27
|
export CODEX_DISABLE_SOUND=0
|
|
12
28
|
export CODEX_CUSTOM_SOUND="${a}"
|
|
13
|
-
`;e.options.dryRun?e.logger.log(`[dry-run] update ${c}`):await
|
|
14
|
-
${t}<<< ${
|
|
15
|
-
`;await
|
|
29
|
+
`;e.options.dryRun?e.logger.log(`[dry-run] update ${c}`):await Ne(c,$,e),e.logger.ok("Notification sound configured. Open a new shell or source your rc to apply.");let h=m.join(e.homeDir,".codex","notify.sh");if(await C.pathExists(h)){let y=await C.readFile(h,"utf8"),v=`DEFAULT_CODEX_SOUND="${a}"`,l=y.replace(/^DEFAULT_CODEX_SOUND=.*$/m,v);l!==y&&(e.options.dryRun?e.logger.log(`[dry-run] patch ${h} DEFAULT_CODEX_SOUND -> ${a}`):await C.writeFile(h,l,"utf8"))}}async function Re(e){let t=e.options.shell||process.env.SHELL||"",o="auto";switch(o==="auto"&&(t.includes("zsh")?o="zsh":t.includes("fish")?o="fish":o="bash"),o){case"zsh":return m.join(e.homeDir,".zshrc");case"fish":return m.join(e.homeDir,".config","fish","config.fish");default:return m.join(e.homeDir,".bashrc")}}async function Ne(e,t,o){let i="codex-1up";await C.ensureDir(m.dirname(e));let n="";if(await C.pathExists(e)){n=await C.readFile(e,"utf8");let s=`>>> ${i} >>>`,a=`<<< ${i} <<<`,c=new RegExp(`${s}[\\s\\S]*?${a}\\n?`,"g");n=n.replace(c,"")}let r=`>>> ${i} >>>
|
|
30
|
+
${t}<<< ${i} <<<
|
|
31
|
+
`;await C.writeFile(e,n+r,"utf8")}import S from"fs-extra";import*as A from"path";async function De(e){let t=A.join(e.homeDir,".codex","AGENTS.md"),o=e.options.globalAgents;if(o==="skip"){e.logger.info("Skipping global AGENTS.md creation");return}let i=A.join(e.rootDir,"templates","agent-templates","AGENTS-default.md");if(!await S.pathExists(i)){e.logger.warn(`Template not found at ${i}`);return}switch(o){case"create-default":if(await S.pathExists(t)){e.logger.info("Global AGENTS.md already exists; leaving unchanged");return}await S.ensureDir(A.dirname(t)),e.options.dryRun?e.logger.log(`[dry-run] cp ${i} ${t}`):await S.copy(i,t),e.logger.ok(`Wrote ${t}`);break;case"overwrite-default":if(await S.ensureDir(A.dirname(t)),await S.pathExists(t)){let r=T(t);e.options.dryRun?e.logger.log(`[dry-run] cp ${t} ${r}`):await S.copy(t,r),e.logger.info(`Backed up existing AGENTS.md to: ${r}`)}e.options.dryRun?e.logger.log(`[dry-run] cp ${i} ${t}`):await S.copy(i,t),e.logger.ok(`Wrote ${t}`);break;case"append-default":if(await S.ensureDir(A.dirname(t)),await S.pathExists(t)){let r=T(t);e.options.dryRun?e.logger.log(`[dry-run] cp ${t} ${r}`):await S.copy(t,r),e.logger.info(`Backed up existing AGENTS.md to: ${r}`)}let n=await S.readFile(i,"utf8");e.options.dryRun?e.logger.log(`[dry-run] append template to ${t}`):await S.appendFile(t,`
|
|
16
32
|
---
|
|
17
33
|
|
|
18
|
-
${
|
|
19
|
-
`);return n===-1?o+`
|
|
20
|
-
`+e:e.slice(0,n+1)+o+`
|
|
21
|
-
`+e.slice(n+1)}var je=K({meta:{name:"config",description:"Manage Codex config profiles"},subCommands:{init:K({meta:{name:"init",description:"Install unified config with multiple profiles"},args:{force:{type:"boolean",description:"Backup and overwrite if exists"}},async run({args:e}){let t=_(at,"templates/codex-config.toml"),o=await le(t),{CFG:n}=se(),i=await H.access(n).then(()=>!0).catch(()=>!1);if(i&&!e.force){process.stdout.write(`${n} exists. Use --force to overwrite.
|
|
22
|
-
`);return}if(i){let r=`${n}.backup.${Date.now()}`;await H.copyFile(n,r),process.stdout.write(`Backed up to ${r}
|
|
23
|
-
`)}await Pe(n,o),process.stdout.write(`Wrote ${n}
|
|
24
|
-
`)}}),profiles:K({meta:{name:"profiles",description:"List profiles in the current config"},async run(){let{CFG:e}=se(),t=await le(e),o=Te(t);process.stdout.write(o.length?o.join(`
|
|
34
|
+
${n}`,"utf8"),e.logger.ok(`Appended template to ${t}`);break;default:e.options.skipConfirmation&&e.logger.info("Skipping global AGENTS.md creation (non-interactive mode)");break}}async function Ie(e){if(e.options.noVscode)return;let t=e.options.vscodeId;if(!t){e.logger.info("VS Code extension id not provided. Use: --vscode <publisher.extension>");return}if(!await d("code")){e.logger.warn("'code' (VS Code) not in PATH; skipping extension install");return}if(e.options.dryRun){e.logger.log(`[dry-run] code --install-extension ${t}`);return}e.logger.info(`Installing VS Code extension: ${t}`),await w("code",["--install-extension",t,"--force"],{dryRun:!1,logger:e.logger}),e.logger.ok(`VS Code extension '${t}' installed (or already present)`)}import q from"fs-extra";import*as M from"path";async function Pe(e){let t=e.options.agentsMd;if(!t)return;let o=t;(await q.stat(o).catch(()=>null))?.isDirectory()&&(o=M.join(o,"AGENTS.md"));let i=M.join(e.rootDir,"templates","agent-templates","AGENTS-default.md");if(await q.pathExists(o)){e.logger.warn(`${o} already exists`);let n=T(o);e.options.dryRun?e.logger.log(`[dry-run] cp ${o} ${n}`):await q.copy(o,n),e.logger.info(`Backed up existing AGENTS.md to: ${n}`)}e.logger.info(`Writing starter AGENTS.md to: ${o}`),e.options.dryRun?e.logger.log(`[dry-run] write AGENTS.md to ${o}`):(await q.ensureDir(M.dirname(o)),await q.copy(i,o),e.logger.ok("Wrote AGENTS.md"))}var Ae="codex-1up";async function fe(e,t){let o=xe.homedir(),i=pe.join(o,`.${Ae}`);await ct.ensureDir(i);let n=new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5),r=pe.join(i,`install-${n}.log`),s=me(r);s.info(`==> ${Ae} installer`),s.info(`Log: ${r}`);let a={cwd:process.cwd(),homeDir:o,rootDir:t,logDir:i,logFile:r,options:e,logger:s};try{await ye(a),await be(a),await $e(a),await Se(a),await Ee(a),await Te(a),await De(a),await Ie(a),await Pe(a),s.ok("All done. Open a new shell or 'source' your rc file to load aliases."),s.info("Next steps:"),s.info(" 1) codex # sign in; then ask it to plan a refactor"),s.info(" 2) ./bin/codex-1up agents --path $PWD # write a starter AGENTS.md to your repo"),s.info(" 3) Review ~/.codex/config.toml (see: https://github.com/openai/codex/blob/main/docs/config.md)")}catch(c){throw s.err(`Installation failed: ${c}`),c}}var _e=gt(ut(import.meta.url));function ht(){let e=_e;for(let t=0;t<6;t++){try{return mt(D(e,"templates","codex-config.toml")),e}catch{}e=D(e,"..")}return D(_e,"..")}var Q=ht(),Le=dt({meta:{name:"install",description:"Run the codex-1up installer with validated flags"},args:{yes:{type:"boolean",description:"Non-interactive; accept safe defaults"},"dry-run":{type:"boolean",description:"Print actions without making changes"},"skip-confirmation":{type:"boolean",description:"Skip prompts"},shell:{type:"string",description:"auto|zsh|bash|fish"},vscode:{type:"string",description:"Install VS Code extension id"},"no-vscode":{type:"boolean",description:"Skip VS Code extension checks"},"git-external-diff":{type:"boolean",description:"Set difftastic as git external diff"},"install-node":{type:"string",description:"nvm|brew|skip"},profiles:{type:"string",description:"add|overwrite|skip (installer config profiles)"},reasoning:{type:"string",description:"on|off for reasoning steps visibility"},sound:{type:"string",description:'Sound file, "none", or "skip" to leave unchanged'},"agents-md":{type:"string",description:"Write starter AGENTS.md to PATH (default PWD/AGENTS.md)",required:!1}},async run({args:e}){let t=D(V.homedir(),".codex","config.toml"),o=await ce(t),i=D(V.homedir(),".codex","notify.sh"),n=await ce(i),r=D(V.homedir(),".codex","AGENTS.md"),s=await ce(r),a=process.stdout.isTTY&&!e["dry-run"]&&!e["skip-confirmation"]&&!e.yes,c=yt(e.profiles),$=bt(e.reasoning),h=typeof e.sound>"u"?void 0:String(e.sound).trim();if(h==="")throw new Error('Invalid --sound value (expected path, "none", or "skip")');let y=c||"add",v=$||"on",l,f,u;if(h&&(g=>{let N=g.trim().toLowerCase();if(N==="skip"){l="no",u=void 0;return}l="yes",u=N==="none"?"none":g})(h),a){if(p.intro("codex-1up \xB7 Install"),!c){let g=await p.select({message:"Install codex profiles (balanced, safe, minimal, yolo)?",options:[{label:"Add / merge (recommended)",value:"add"},{label:"Overwrite codex profiles",value:"overwrite"},{label:"Skip profiles",value:"skip"}],initialValue:"add"});if(p.isCancel(g))return p.cancel("Install aborted");y=g}if(!$){let g=await p.confirm({message:"Enable reasoning steps (show raw agent reasoning)?",initialValue:!0});if(p.isCancel(g))return p.cancel("Install aborted");v=g?"on":"off"}if(!h){let ne=function(E){return[{label:"Skip (leave current setup)",value:"skip"},{label:"None (disable sounds)",value:"none"},...N.map(b=>({label:b,value:b})),{label:"Custom path\u2026",value:"custom"}]};var J=ne;let g=D(Q,"sounds"),N=[];try{N=(await Z.readdir(g)).filter(E=>/\.(wav|mp3|ogg)$/i.test(E)).sort()}catch{}l="yes";let k=N.includes("noti_1.wav")?"noti_1.wav":N[0]||"none";async function ie(E){let b=await p.text({message:"Enter absolute path to a .wav file",placeholder:E||"/absolute/path/to/sound.wav",validate(x){if(!x)return"Path required";if(!x.startsWith("/"))return"Use an absolute path";if(!/(\.wav|\.mp3|\.ogg)$/i.test(x))return"Supported: .wav, .mp3, .ogg"}});if(p.isCancel(b))return null;try{await Z.access(String(b))}catch{return p.log.warn("File not found. Try again."),await ie(String(b))}return String(b)}let F=await p.select({message:"Notification sound",options:ne(k),initialValue:k});if(p.isCancel(F))return p.cancel("Install aborted");if(F==="skip")l="no",u=void 0;else if(F==="custom"){let E=await ie();if(E===null)return p.cancel("Install aborted");k=E}else k=F;if(F!=="skip"){for(;;){let E=await p.select({message:`Selected: ${k}. What next?`,options:[{label:"Preview \u25B6 (press p then Enter)",value:"preview"},{label:"Use this",value:"use"},{label:"Choose another\u2026",value:"change"}],initialValue:"use"});if(p.isCancel(E))return p.cancel("Install aborted");if(E==="use")break;if(E==="change"){let b=await p.select({message:"Notification sound",options:ne(k),initialValue:k});if(p.isCancel(b))return p.cancel("Install aborted");if(b==="custom"){let x=await ie();if(x===null)return p.cancel("Install aborted");k=x}else if(b==="skip"){l="no",u=void 0;break}else k=b;continue}try{let b=k==="none"?"none":k.startsWith("/")?k:D(Q,"sounds",k);await wt(b)}catch(b){p.log.warn(String(b))}}u===void 0&&(u=k)}}if(s){let g=await p.select({message:"Global ~/.codex/AGENTS.md",options:[{label:"Add to your existing AGENTS.md (Backup will be created)",value:"append-default"},{label:"Overwrite existing (Backup will be created)",value:"overwrite-default"},{label:"Skip \u2014 leave as-is",value:"skip"}],initialValue:"append-default"});if(p.isCancel(g))return p.cancel("Install aborted");f=g}else f="skip"}a||(typeof l>"u"&&(l=n?"no":"yes"),typeof f>"u"&&(f="skip"));let P={profilesAction:y,reasoning:v,notify:l??(n?"no":"yes"),globalAgents:f??"skip",notificationSound:u,mode:"manual",installNode:e["install-node"]||"nvm",shell:String(e.shell||"auto"),vscodeId:e.vscode?String(e.vscode):void 0,noVscode:e["no-vscode"]||!1,agentsMd:typeof e["agents-md"]<"u"?String(e["agents-md"]||process.cwd()):void 0,dryRun:e["dry-run"]||!1,assumeYes:e.yes||!1,skipConfirmation:e["skip-confirmation"]||!1};if(a){let g=p.spinner();g.start("Installing prerequisites and writing config");try{await fe(P,Q),g.stop("Base install complete"),p.outro("Install finished")}catch(N){throw g.stop("Installation failed"),p.cancel(`Installation failed: ${N}`),N}await je();return}try{await fe(P,Q),await je()}catch(g){throw p.cancel(`Installation failed: ${g}`),g}}});async function je(){let e=V.homedir(),t=D(e,".codex","config.toml"),o,i=[];try{let c=await Z.readFile(t,"utf8"),$=Oe.parse(c);o=$.profile;let h=$.profiles||{};i=Object.keys(h)}catch{}let n=["codex","ast-grep","fd","rg","fzf","jq","yq","difft","difftastic"],s=(await Promise.all(n.map(async c=>{try{return await O(c),[c,!0]}catch{return[c,!1]}}))).filter(([,c])=>c).map(([c])=>c),a=[];a.push(""),a.push("codex-1up: Installation summary"),a.push("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),a.push(`Config: ${t}${o?` (active profile: ${o})`:""}`),i.length&&a.push(`Profiles: ${i.join(", ")}`),a.push(`Tools detected: ${s.join(", ")||"none"}`),a.push(""),a.push("Usage:"),a.push(" - Switch profile for a session: codex --profile <name>"),a.push(" - List available profiles: codex-1up config profiles"),a.push(" - Persist active profile: codex-1up config set-profile <name>"),a.push(" - Write AGENTS.md to a repo: codex-1up agents --path . --template default"),a.push(""),process.stdout.write(a.join(`
|
|
25
35
|
`)+`
|
|
26
|
-
|
|
27
|
-
`)}}),"
|
|
28
|
-
`)
|
|
36
|
+
`)}async function wt(e){if(e.endsWith("/none")||e==="none")return;let t=[async o=>{await O("afplay"),await z`afplay ${o}`},async o=>{await O("paplay"),await z`paplay ${o}`},async o=>{await O("aplay"),await z`aplay ${o}`},async o=>{await O("mpg123"),await z`mpg123 -q ${o}`},async o=>{await O("ffplay"),await z`ffplay -nodisp -autoexit -loglevel quiet ${o}`}];for(let o of t)try{await o(e);return}catch{}throw new Error("No audio player found (afplay/paplay/aplay/mpg123/ffplay)")}async function ce(e){try{return await Z.access(e),!0}catch{return!1}}function yt(e){if(e==null)return;let t=String(e).toLowerCase();if(t==="add"||t==="overwrite"||t==="skip")return t;if(t==="no")return"skip";throw new Error("Invalid --profiles value (use add|overwrite|skip|no).")}function bt(e){if(e==null)return;let t=String(e).toLowerCase();if(["on","true","yes"].includes(t))return"on";if(["off","false","no"].includes(t))return"off";throw new Error("Invalid --reasoning value (use on|off).")}import{defineCommand as $t}from"citty";import{promises as B}from"fs";import{accessSync as kt}from"fs";import{resolve as H,dirname as Ge}from"path";import{fileURLToPath as vt}from"url";var Fe=Ge(vt(import.meta.url));function Ct(){let e=Fe;for(let t=0;t<6;t++){try{return kt(H(e,"templates","codex-config.toml")),e}catch{}e=H(e,"..")}return H(Fe,"..")}var St=Ct();async function de(e){try{return await B.access(e),!0}catch{return!1}}async function Et(e,t){if(await de(t)){let i=`${t}.backup.${new Date().toISOString().replace(/[:.]/g,"").replace("T","_").slice(0,15)}`;await B.copyFile(t,i)}await B.mkdir(Ge(t),{recursive:!0}),await B.copyFile(e,t)}var Ue=$t({meta:{name:"agents",description:"Write an AGENTS.md template"},args:{path:{type:"string",required:!0,description:"Target repo path or file"}},async run({args:e}){let t=String(e.path),o=H(St,"templates/agent-templates","AGENTS-default.md"),n=await de(t).then(async r=>r&&(await B.stat(t)).isDirectory()).catch(()=>!1)?H(t,"AGENTS.md"):t;if(!await de(o))throw new Error(`Template not found: ${o}`);await Et(o,n),process.stdout.write(`Wrote ${n}
|
|
37
|
+
`)}});import{defineCommand as Rt}from"citty";import{$ as Nt}from"zx";import{fileURLToPath as Tt}from"url";import{accessSync as Dt}from"fs";import{dirname as It,resolve as ee}from"path";var We=It(Tt(import.meta.url));function Pt(){let e=We;for(let t=0;t<6;t++){try{return Dt(ee(e,"templates","codex-config.toml")),e}catch{}e=ee(e,"..")}return ee(We,"..")}var At=Pt(),qe=Rt({meta:{name:"doctor",description:"Run environment checks"},async run(){await Nt`bash ${ee(At,"scripts/doctor.sh")}`}});import{defineCommand as xt}from"citty";import{$ as _t}from"zx";import{fileURLToPath as jt}from"url";import{accessSync as Ot}from"fs";import{dirname as Lt,resolve as te}from"path";var Me=Lt(jt(import.meta.url));function Ft(){let e=Me;for(let t=0;t<6;t++){try{return Ot(te(e,"templates","codex-config.toml")),e}catch{}e=te(e,"..")}return te(Me,"..")}var Gt=Ft(),ze=xt({meta:{name:"uninstall",description:"Clean up aliases and config created by this tool"},async run(){await _t`bash ${te(Gt,"scripts/uninstall.sh")}`}});import{defineCommand as oe}from"citty";import{promises as K}from"fs";import{resolve as L,dirname as Ke}from"path";import{fileURLToPath as Ut}from"url";import{accessSync as Wt}from"fs";import qt from"os";var Ve=Ke(Ut(import.meta.url));function Mt(){let e=Ve;for(let t=0;t<6;t++){try{return Wt(L(e,"templates","codex-config.toml")),e}catch{}e=L(e,"..")}return L(Ve,"..")}var zt=Mt();function ue(){let e=L(qt.homedir(),".codex"),t=L(e,"config.toml");return{CODEX_HOME:e,CFG:t}}async function ge(e){return K.readFile(e,"utf8")}async function Be(e,t){await K.mkdir(Ke(e),{recursive:!0}),await K.writeFile(e,t,"utf8")}function He(e){let t=/^\[profiles\.(.+?)\]/gm,o=[],i;for(;i=t.exec(e);)o.push(i[1]);return o}function Vt(e,t){let o=`profile = "${t}"`;if(/^profile\s*=\s*".*"/m.test(e))return e.replace(/^profile\s*=\s*".*"/m,o);let i=e.indexOf(`
|
|
38
|
+
`);return i===-1?o+`
|
|
39
|
+
`+e:e.slice(0,i+1)+o+`
|
|
40
|
+
`+e.slice(i+1)}var Je=oe({meta:{name:"config",description:"Manage Codex config profiles"},subCommands:{init:oe({meta:{name:"init",description:"Install unified config with multiple profiles"},args:{force:{type:"boolean",description:"Backup and overwrite if exists"}},async run({args:e}){let t=L(zt,"templates/codex-config.toml"),o=await ge(t),{CFG:i}=ue(),n=await K.access(i).then(()=>!0).catch(()=>!1);if(n&&!e.force){process.stdout.write(`${i} exists. Use --force to overwrite.
|
|
41
|
+
`);return}if(n){let r=`${i}.backup.${Date.now()}`;await K.copyFile(i,r),process.stdout.write(`Backed up to ${r}
|
|
42
|
+
`)}await Be(i,o),process.stdout.write(`Wrote ${i}
|
|
43
|
+
`)}}),profiles:oe({meta:{name:"profiles",description:"List profiles in the current config"},async run(){let{CFG:e}=ue(),t=await ge(e),o=He(t);process.stdout.write(o.length?o.join(`
|
|
29
44
|
`)+`
|
|
30
|
-
|
|
31
|
-
`)}})
|
|
45
|
+
`:`No profiles found
|
|
46
|
+
`)}}),"set-profile":oe({meta:{name:"set-profile",description:"Set the active profile in config.toml"},args:{name:{type:"positional",required:!0,description:"Profile name"}},async run({args:e}){let{CFG:t}=ue(),o=await ge(t),i=He(o),n=String(e.name);if(!i.includes(n))throw new Error(`Unknown profile: ${n}`);let r=Vt(o,n);await Be(t,r),process.stdout.write(`profile set to ${n}
|
|
47
|
+
`)}})}});var Xe=Bt({meta:{name:"codex-1up",version:"0.1.0",description:"Power up Codex CLI with clean profiles config and helpers"},subCommands:{install:Le,agents:Ue,doctor:qe,uninstall:ze,config:Je}});Ht(Xe);
|
package/package.json
CHANGED
package/scripts/release.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { execSync } from "node:child_process";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
|
+
import os from "node:os";
|
|
4
5
|
|
|
5
6
|
interface PackageTarget {
|
|
6
7
|
name: string;
|
|
@@ -122,6 +123,8 @@ async function publishPackages(
|
|
|
122
123
|
|
|
123
124
|
const newVersion = bumpAllVersions(versionBump);
|
|
124
125
|
|
|
126
|
+
let repoSlug = "";
|
|
127
|
+
|
|
125
128
|
for (const target of packageTargets.filter((pkg) => pkg.publish)) {
|
|
126
129
|
const pkgPath = path.resolve(target.dir);
|
|
127
130
|
const manifestPath = path.join(pkgPath, "package.json");
|
|
@@ -130,6 +133,13 @@ async function publishPackages(
|
|
|
130
133
|
continue;
|
|
131
134
|
}
|
|
132
135
|
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
|
136
|
+
try {
|
|
137
|
+
const repoUrl: string | undefined = manifest?.repository?.url;
|
|
138
|
+
if (repoUrl) {
|
|
139
|
+
const m = repoUrl.match(/github\.com\/(.+?)\.git$/);
|
|
140
|
+
if (m) repoSlug = m[1];
|
|
141
|
+
}
|
|
142
|
+
} catch {}
|
|
133
143
|
if (manifest.private) {
|
|
134
144
|
console.warn(
|
|
135
145
|
`Skipping publish for ${target.name}; package.json is marked private`,
|
|
@@ -150,14 +160,6 @@ async function publishPackages(
|
|
|
150
160
|
let readme = fs.readFileSync(rootReadme, "utf8");
|
|
151
161
|
// If README uses local ./public images, rewrite to absolute GitHub raw URLs
|
|
152
162
|
// Derive repo slug from package.json repository.url when possible
|
|
153
|
-
let repoSlug = "";
|
|
154
|
-
try {
|
|
155
|
-
const repoUrl: string | undefined = manifest?.repository?.url;
|
|
156
|
-
if (repoUrl) {
|
|
157
|
-
const m = repoUrl.match(/github\.com\/(.+?)\.git$/);
|
|
158
|
-
if (m) repoSlug = m[1];
|
|
159
|
-
}
|
|
160
|
-
} catch {}
|
|
161
163
|
if (repoSlug) {
|
|
162
164
|
readme = readme.replace(
|
|
163
165
|
/\]\(\.\/public\//g,
|
|
@@ -191,6 +193,13 @@ async function publishPackages(
|
|
|
191
193
|
}
|
|
192
194
|
|
|
193
195
|
createGitCommitAndTag(newVersion);
|
|
196
|
+
|
|
197
|
+
// After tagging, create or update a GitHub Release with notes from CHANGELOG
|
|
198
|
+
try {
|
|
199
|
+
createGithubRelease(newVersion, repoSlug);
|
|
200
|
+
} catch (e) {
|
|
201
|
+
console.warn("Skipping GitHub Release creation:", e);
|
|
202
|
+
}
|
|
194
203
|
}
|
|
195
204
|
|
|
196
205
|
// Get version bump type from command line arguments
|
|
@@ -198,3 +207,59 @@ const args = process.argv.slice(2);
|
|
|
198
207
|
const versionBumpArg = args[0] || "patch"; // Default to patch
|
|
199
208
|
|
|
200
209
|
publishPackages(versionBumpArg).catch(console.error);
|
|
210
|
+
|
|
211
|
+
// -------------- helpers: GitHub Release --------------
|
|
212
|
+
|
|
213
|
+
function hasGhCLI(): boolean {
|
|
214
|
+
try {
|
|
215
|
+
execSync("gh --version", { stdio: "ignore" });
|
|
216
|
+
return true;
|
|
217
|
+
} catch {
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function changelogSection(versionLike: string): string | null {
|
|
223
|
+
const file = path.resolve("CHANGELOG.md");
|
|
224
|
+
if (!fs.existsSync(file)) return null;
|
|
225
|
+
const text = fs.readFileSync(file, "utf8");
|
|
226
|
+
const re = new RegExp(
|
|
227
|
+
`^## \\\\[${versionLike.replace(/[.*+?^${}()|[\\]\\\\]/g, "\\$&")}\\\\]` + "[\\s\\S]*?(?=^## \\\\[(?:.|\\n)*?\\\\]|\n\n?$)",
|
|
228
|
+
"m",
|
|
229
|
+
);
|
|
230
|
+
const m = text.match(re);
|
|
231
|
+
return m ? m[0].trim() + "\n" : null;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function ghReleaseExists(tag: string): boolean {
|
|
235
|
+
try {
|
|
236
|
+
execSync(`gh release view ${tag}`, { stdio: "ignore" });
|
|
237
|
+
return true;
|
|
238
|
+
} catch {
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function createGithubRelease(version: string, repoSlug: string) {
|
|
244
|
+
if (!hasGhCLI()) return;
|
|
245
|
+
const tag = `v${version}`;
|
|
246
|
+
const title = `codex-1up ${tag}`;
|
|
247
|
+
let notes = changelogSection(version);
|
|
248
|
+
|
|
249
|
+
// fallback: if no section for this semver (e.g., 0.1.1), try mapping to 0.4 if present
|
|
250
|
+
if (!notes) {
|
|
251
|
+
const alt = process.env.GH_NOTES_REF || "0.4";
|
|
252
|
+
notes = changelogSection(alt) || undefined;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
const tmp = path.join(os.tmpdir(), `release-notes-${version}.md`);
|
|
256
|
+
if (notes) fs.writeFileSync(tmp, notes);
|
|
257
|
+
|
|
258
|
+
const exists = ghReleaseExists(tag);
|
|
259
|
+
const cmd = exists
|
|
260
|
+
? `gh release edit ${tag} --title "${title}" ${notes ? `--notes-file ${tmp}` : "--generate-notes"}`
|
|
261
|
+
: `gh release create ${tag} --title "${title}" ${notes ? `--notes-file ${tmp}` : "--generate-notes"}`;
|
|
262
|
+
|
|
263
|
+
console.log(`${exists ? "Updating" : "Creating"} GitHub Release ${tag}...`);
|
|
264
|
+
execSync(cmd, { stdio: "inherit" });
|
|
265
|
+
}
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
When you need to call tools from the shell, use this rubric:
|
|
4
4
|
|
|
5
5
|
## File Operations
|
|
6
|
-
-
|
|
6
|
+
- Find files by file name: `fd`
|
|
7
|
+
- Find files with path name: `fd -p <file-path>`
|
|
8
|
+
- List files in a directory: `fd . <directory>`
|
|
9
|
+
- Find files with extension and pattern: `fd -e <extension> <pattern>`
|
|
7
10
|
|
|
8
11
|
## Structured Code Search
|
|
9
12
|
- Find code structure: `ast-grep --lang <language> -p '<pattern>'`
|
|
@@ -18,6 +18,10 @@ network_access = true
|
|
|
18
18
|
# Desktop notifications from the TUI: boolean or filtered list. Default: false
|
|
19
19
|
# Examples: true | ["agent-turn-complete", "approval-requested"]
|
|
20
20
|
notifications = false
|
|
21
|
+
# Show raw reasoning content when available (default: false)
|
|
22
|
+
show_raw_agent_reasoning = true
|
|
23
|
+
# Ensure we do not hide internal reasoning (default: false)
|
|
24
|
+
hide_agent_reasoning = false
|
|
21
25
|
|
|
22
26
|
# Centralized feature flags — booleans only
|
|
23
27
|
[features]
|