@autonomos/cli 0.0.3 → 0.1.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/dist/index.mjs CHANGED
@@ -1,12 +1,13 @@
1
1
  #!/usr/bin/env node
2
- import{Command as e}from"commander";import t from"picocolors";import{AGENT_FILE as n,AUTONOMOS_DIR as r,MANIFEST_FILE as i,PROTOCOL_FILE as a,PROTOCOL_TEMPLATE as o,PROTOCOL_VERSION as s,TASKS_FILE as c,TASKS_TEMPLATE as l,TaskParser as u,WORKLOGS_DIR as d,createManifest as f,generateAgentTemplate as p,generateManifestContent as m,parseManifest as h}from"@autonomos/core";import{existsSync as g,mkdirSync as _,readFileSync as v,readdirSync as y,statSync as b,writeFileSync as x}from"node:fs";import{basename as S,join as C,relative as w}from"node:path";function T(e){let t=e;for(;t!==`/`;){if(g(C(t,r))||g(C(t,`.git`)))return t;t=C(t,`..`)}return null}function E(e,t,r=0){let i=[],a=C(e,n);g(a)&&i.push({path:a,relativePath:w(t,a)||n,depth:r});try{let n=y(e);for(let a of n){if(a.startsWith(`.`)||a===`node_modules`||a===`dist`||a===`build`)continue;let n=C(e,a);try{b(n).isDirectory()&&i.push(...E(n,t,r+1))}catch{}}}catch{}return i}function D(e,t){if(e.length===0)return` (no AGENT.md files found)`;let r=S(t),i={name:r,isAgent:!1,children:{}};for(let t of e){let e=t.relativePath.split(`/`),r=i;for(let t=0;t<e.length;t++){let i=e[t],a=i===n;r.children[i]||(r.children[i]={name:i,isAgent:a,children:{}}),r=r.children[i]}}let a=[];a.push(`šŸ“ ${r}/`);function o(e,t=``,n=!0){let r=Object.values(e.children);r.sort((e,t)=>!e.isAgent&&t.isAgent?-1:e.isAgent&&!t.isAgent?1:e.name.localeCompare(t.name)),r.forEach((e,n)=>{let i=n===r.length-1,s=i?`└── `:`ā”œā”€ā”€ `,c=e.isAgent?`šŸ“„`:`šŸ“`,l=e.isAgent?e.name:`${e.name}/`;a.push(`${t}${s}${c} ${l}`),e.isAgent||o(e,t+(i?` `:`│ `),i)})}return o(i),a.join(`
3
- `)}function O(e={}){let t=e.cwd??process.cwd(),n;if(e.all){let e=T(t);if(!e)return{success:!1,message:`Could not find project root (.autonomos or .git directory).`};n=e}else n=t;let r=E(n,n);if(r.length===0)return{success:!0,message:`No AGENT.md files found.`,count:0};let i=D(r,n);return{success:!0,message:`Found ${r.length} AGENT.md file(s)`,tree:i,count:r.length}}function k(e={}){let t=e.cwd??process.cwd(),u=e.dryRun??!1,h=[],v=[];g(C(t,`.git`))||v.push("No Git repository detected. Consider running `git init` first.");let y=C(t,r);if(g(y))return{success:!1,message:`Project already initialized with Protocol v${s}. Use \`autonomos update\` to update.`,created:[],warnings:[],dryRun:u};if(u)return h.push(r),h.push(`${r}/${d}`),h.push(`${r}/${i}`),h.push(`${r}/${a}`),h.push(`${r}/${c}`),g(C(t,n))?v.push(`${n} already exists, would skip.`):h.push(n),{success:!0,message:`Would initialize project with Agent Protocol v${s}`,created:h,warnings:v,dryRun:!0};_(y,{recursive:!0}),h.push(r),_(C(y,d),{recursive:!0}),h.push(`${r}/${d}`);let b=f(`0.0.1`);x(C(y,i),m(b)),h.push(`${r}/${i}`),x(C(y,a),o),h.push(`${r}/${a}`),x(C(y,c),l),h.push(`${r}/${c}`);let S=C(t,n);return g(S)?v.push(`${n} already exists, skipping.`):(x(S,p(t.split(`/`).pop()??`Project`)),h.push(n)),{success:!0,message:`Project initialized with Agent Protocol v${s}`,created:h,warnings:v,dryRun:!1}}function A(e={}){let t=C(e.cwd??process.cwd(),r),n=C(t,i);if(!g(n))return{success:!1,message:"Project not initialized. Run `autonomos init` first.",initialized:!1};let a;try{a=h(v(n,`utf-8`))}catch{return{success:!1,message:`Could not read manifest.json`,initialized:!0}}let o,s=C(t,c);if(g(s))try{let e=v(s,`utf-8`),t=u.parse(e);o={total:t.length,todo:t.filter(e=>e.status===`TODO`).length,inProgress:t.filter(e=>e.status===`IN_PROGRESS`).length,done:t.filter(e=>e.status===`DONE`).length,blocked:t.filter(e=>e.status===`BLOCKED`).length}}catch{}return{success:!0,message:`Project status retrieved`,protocolVersion:a.protocolVersion,cliVersion:a.cliVersion,initialized:!0,taskSummary:o}}function j(e,t){let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++){let t=n[e]??0,i=r[e]??0;if(t<i)return-1;if(t>i)return 1}return 0}function M(e={}){let t=C(e.cwd??process.cwd(),r),n=C(t,i);if(!g(n))return{success:!1,message:"Project not initialized. Run `autonomos init` first."};let c=h(v(n,`utf-8`)),l=c.protocolVersion,u=j(l,s);return u===0?{success:!0,message:`Already up to date (Protocol v${s})`,previousVersion:l,newVersion:s}:u>0?{success:!1,message:`This project uses Protocol v${l}, but your CLI only knows v${s}. Update your CLI with \`npm i -g @autonomos/cli\`.`,previousVersion:l,newVersion:s,cliOutdated:!0}:(x(C(t,a),o),x(n,m({...c,protocolVersion:s,cliVersion:`0.0.1`,lastUpdated:new Date().toISOString()})),{success:!0,message:`Protocol updated: v${l} → v${s}`,previousVersion:l,newVersion:s})}const N=`0.0.1`,P=new e;P.name(`autonomos`).description(t.cyan(`CLI for the Autonomos Agent Protocol
2
+ import{Command as e}from"commander";import t from"picocolors";import{AGENT_FILE as n,AUTONOMOS_DIR as r,MANIFEST_FILE as i,PROTOCOL_FILE as a,PROTOCOL_TEMPLATE as o,PROTOCOL_VERSION as s,TASKS_FILE as c,TASKS_TEMPLATE as l,TaskParser as u,WORKLOGS_DIR as d,createManifest as f,findAncestorAgents as p,generateAgentTemplate as m,generateManifestContent as h,listHarnesses as g,parseManifest as _,resolveTargets as v}from"@autonomos/core";import{existsSync as y,mkdirSync as b,readFileSync as x,readdirSync as S,statSync as C,writeFileSync as w}from"node:fs";import{basename as T,join as E,relative as D,resolve as O}from"node:path";import{checkbox as k}from"@inquirer/prompts";import{fileURLToPath as A}from"node:url";function j(e){let t=e;for(;t!==`/`;){if(y(E(t,r))||y(E(t,`.git`)))return t;t=E(t,`..`)}return null}function M(e,t,r=0){let i=[],a=E(e,n);y(a)&&i.push({path:a,relativePath:D(t,a)||n,depth:r});try{let n=S(e);for(let a of n){if(a.startsWith(`.`)||a===`node_modules`||a===`dist`||a===`build`)continue;let n=E(e,a);try{C(n).isDirectory()&&i.push(...M(n,t,r+1))}catch{}}}catch{}return i}function N(e,t){if(e.length===0)return` (no AGENT.md files found)`;let r=T(t),i={name:r,isAgent:!1,children:{}};for(let t of e){let e=t.relativePath.split(`/`),r=i;for(let t of e){let e=t===n,i=r.children[t];i||(i={name:t,isAgent:e,children:{}},r.children[t]=i),r=i}}let a=[];a.push(`šŸ“ ${r}/`);function o(e,t=``,n=!0){let r=Object.values(e.children);r.sort((e,t)=>!e.isAgent&&t.isAgent?-1:e.isAgent&&!t.isAgent?1:e.name.localeCompare(t.name)),r.forEach((e,n)=>{let i=n===r.length-1,s=i?`└── `:`ā”œā”€ā”€ `,c=e.isAgent?`šŸ“„`:`šŸ“`,l=e.isAgent?e.name:`${e.name}/`;a.push(`${t}${s}${c} ${l}`),e.isAgent||o(e,t+(i?` `:`│ `),i)})}return o(i),a.join(`
3
+ `)}function P(e){return e.length===0?` (no AGENT.md files found in the ancestor chain)`:e.map((t,n)=>` ${(n+1).toString().padStart(e.length.toString().length,` `)}. ${t.relativeDir===`.`?`./AGENT.md`:`${t.relativeDir}/AGENT.md`}`).join(`
4
+ `)}function F(e={}){let t=e.cwd??process.cwd();if(e.target){let n=j(t)??t,r;try{r=p(O(t,e.target),n)}catch(e){return{success:!1,message:`Failed to look up ancestors: ${e instanceof Error?e.message:String(e)}`,mode:`ancestors`}}let i=P(r);return{success:!0,message:`Found ${r.length} ancestor AGENT.md file(s) for "${e.target}" (root → target):\n${i}`,count:r.length,ancestors:r,mode:`ancestors`}}let n;if(e.all){let e=j(t);if(!e)return{success:!1,message:`Could not find project root (.autonomos or .git directory).`,mode:`tree`};n=e}else n=t;let r=M(n,n);if(r.length===0)return{success:!0,message:`No AGENT.md files found.`,count:0,mode:`tree`};let i=N(r,n);return{success:!0,message:`Found ${r.length} AGENT.md file(s)`,tree:i,count:r.length,mode:`tree`}}var I=`0.1.0`;const L=I,R=[`protocol-session.md`,`protocol-task.md`,`protocol-crystallize.md`];function z(){let e=A(import.meta.url),t=[O(e,`..`,`..`,`..`,`..`,`core`,`src`,`workflows`),O(e,`..`,`..`,`..`,`core`,`dist`,`workflows`),O(e,`..`,`..`,`..`,`..`,`core`,`dist`,`workflows`)];for(let e of t)if(y(e))return e;throw Error(`Could not locate the workflows directory inside @autonomos/core`)}async function B(){return k({message:`Which AI harnesses do you want to install the protocol for? (space to toggle, enter to confirm)`,choices:g().map(({id:e,harness:t})=>({name:t.name,value:e,checked:t.preferred}))})}async function V(e={}){let t=e.cwd??process.cwd(),u=e.dryRun??!1,p=[],_=[],S=[];y(E(t,`.git`))||_.push("No Git repository detected. Consider running `git init` first.");let C=E(t,r);if(y(C))return{success:!1,message:`Project already initialized with Protocol v${s}. Use \`autonomos update\` to update.`,created:[],warnings:[],dryRun:u};let T;T=e.all?g().map(({id:e})=>e):e.harnesses&&e.harnesses.length>0?e.harnesses:e.noPrompt||e.dryRun?[]:await B();let D=v(T,t);if(u){p.push(r),p.push(`${r}/${d}`),p.push(`${r}/${i}`),p.push(`${r}/${a}`),p.push(`${r}/${c}`),y(E(t,n))?_.push(`${n} already exists, would skip.`):p.push(n);for(let e of D)for(let t of R){let n=H(t,e.fileExtension);S.push(`${e.path}/${n}`)}return{success:!0,message:`Would initialize project with Agent Protocol v${s}${T.length?` (harnesses: ${T.join(`, `)})`:``}`,created:p,warnings:_,dryRun:!0,harnessFiles:S}}b(C,{recursive:!0}),p.push(r),b(E(C,d),{recursive:!0}),p.push(`${r}/${d}`);let O=f(L);w(E(C,i),h(O)),p.push(`${r}/${i}`),w(E(C,a),o),p.push(`${r}/${a}`),w(E(C,c),l),p.push(`${r}/${c}`);let k=E(t,n);y(k)?_.push(`${n} already exists, skipping.`):(w(k,m(t.split(`/`).pop()??`Project`)),p.push(n));let A=z();for(let e of D){b(e.path,{recursive:!0});for(let t of R){let n=x(E(A,t),`utf-8`),r=H(t,e.fileExtension);w(E(e.path,r),n),S.push(`${e.path}/${r}`)}}return{success:!0,message:`Project initialized with Agent Protocol v${s}${T.length>0?` for harnesses: ${T.join(`, `)}`:` (no harness workflows installed)`}`,created:p,warnings:_,dryRun:!1,harnessFiles:S}}function H(e,t){return e.replace(/^protocol-/,``).replace(/\.[^.]+$/,``)+t}function U(e={}){let t=E(e.cwd??process.cwd(),r),n=E(t,i);if(!y(n))return{success:!1,message:"Project not initialized. Run `autonomos init` first.",initialized:!1};let a;try{a=_(x(n,`utf-8`))}catch{return{success:!1,message:`Could not read manifest.json`,initialized:!0}}let o,s=E(t,c);if(y(s))try{let e=x(s,`utf-8`),t=u.parse(e);o={total:t.length,todo:t.filter(e=>e.status===`TODO`).length,inProgress:t.filter(e=>e.status===`IN_PROGRESS`).length,done:t.filter(e=>e.status===`DONE`).length,blocked:t.filter(e=>e.status===`BLOCKED`).length}}catch{}return{success:!0,message:`Project status retrieved`,protocolVersion:a.protocolVersion,cliVersion:a.cliVersion,initialized:!0,taskSummary:o}}function W(e,t){let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++){let t=n[e]??0,i=r[e]??0;if(t<i)return-1;if(t>i)return 1}return 0}function G(e={}){let t=E(e.cwd??process.cwd(),r),n=E(t,i);if(!y(n))return{success:!1,message:"Project not initialized. Run `autonomos init` first."};let c=_(x(n,`utf-8`)),l=c.protocolVersion,u=W(l,s);return u===0?{success:!0,message:`Already up to date (Protocol v${s})`,previousVersion:l,newVersion:s}:u>0?{success:!1,message:`This project uses Protocol v${l}, but your CLI only knows v${s}. Update your CLI with \`npm i -g @autonomos/cli\`.`,previousVersion:l,newVersion:s,cliOutdated:!0}:(w(E(t,a),o),w(n,h({...c,protocolVersion:s,cliVersion:`0.0.1`,lastUpdated:new Date().toISOString()})),{success:!0,message:`Protocol updated: v${l} → v${s}`,previousVersion:l,newVersion:s})}const K=I,q=new e;q.name(`autonomos`).description(t.cyan(`CLI for the Autonomos Agent Protocol
4
5
 
5
6
  The Agent Protocol is a specification for AI agents to interact with codebases
6
7
  in a structured, consistent way. It defines how agents should read context,
7
8
  execute tasks, and persist knowledge.`)+`
8
9
 
9
- Documentation: ${t.underline(`https://github.com/saoudi-h/autonomos`)}`).version(`${t.bold(`CLI:`)} ${t.green(N)}\n${t.bold(`Protocol:`)} ${t.green(s)}`,`-v, --version`,`Show version information`).helpOption(`-h, --help`,`Show help information`).addHelpText(`after`,`
10
+ Documentation: ${t.underline(`https://github.com/saoudi-h/autonomos`)}`).version(`${t.bold(`CLI:`)} ${t.green(K)}\n${t.bold(`Protocol:`)} ${t.green(s)}`,`-v, --version`,`Show version information`).helpOption(`-h, --help`,`Show help information`).addHelpText(`after`,`
10
11
  ${t.bold(`Examples:`)}
11
12
  $ ${t.cyan(`autonomos init`)} Initialize the Agent Protocol in current directory
12
13
  $ ${t.cyan(`autonomos update`)} Update Protocol to the latest version
@@ -15,7 +16,7 @@ ${t.bold(`Examples:`)}
15
16
 
16
17
  ${t.bold(`More info:`)}
17
18
  Run '${t.cyan(`autonomos <command> --help`)}' for detailed information about a command.
18
- `),P.command(`init`).description(`Initialize the Agent Protocol in the current directory`).addHelpText(`after`,`
19
+ `),q.command(`init`).description(`Initialize the Agent Protocol in the current directory`).addHelpText(`after`,`
19
20
  This command creates the following structure:
20
21
  ${t.blue(`.autonomos/`)}
21
22
  ā”œā”€ā”€ ${t.white(`manifest.json`)} # Protocol metadata and version
@@ -24,11 +25,27 @@ This command creates the following structure:
24
25
  └── ${t.blue(`worklogs/`)} # Session logs directory
25
26
  ${t.white(`AGENT.md`)} # Project context file (at root)
26
27
 
28
+ Additionally, when one or more harnesses are selected, the protocol workflow
29
+ files (session / task / crystallize) are installed at the harness-specific
30
+ target directory, e.g. .clinerules/workflows/ for Cline, .claude/skills/ for
31
+ Claude Code, .agents/skills/ for the cross-tool standard (Cursor, Codex, etc.).
32
+
33
+ ${t.bold(`Harness selection:`)}
34
+ (default) Interactive multi-select prompt at the start of init.
35
+ --harness Skip the prompt and install only for the given harness id(s).
36
+ May be repeated, e.g. --harness cline --harness claude-code.
37
+ --all Skip the prompt and install for all known harnesses.
38
+ --no-prompt Same as not specifying a TTY; useful in CI/scripted contexts.
39
+
27
40
  ${t.bold(`Examples:`)}
28
41
  $ ${t.cyan(`autonomos init`)}
42
+ $ ${t.cyan(`autonomos init --harness cline`)}
43
+ $ ${t.cyan(`autonomos init --harness cline --harness claude-code`)}
44
+ $ ${t.cyan(`autonomos init --all`)}
45
+ $ ${t.cyan(`autonomos init --dry-run`)}
29
46
  $ ${t.cyan(`cd my-project && autonomos init`)}
30
- `).option(`-n, --dry-run`,`Preview what would be created without writing files`).action(e=>{let n=k({dryRun:e.dryRun});n.success||(console.error(t.red(`\nāŒ ${n.message}`)),process.exit(1)),n.dryRun?console.log(t.cyan(`\nšŸ” ${n.message} (dry-run)`)):console.log(t.green(`\nāœ… ${n.message}`)),n.created.length>0&&(console.log(`\n${t.bold(n.dryRun?`Would create:`:`Created:`)}`),n.created.forEach(e=>console.log(` ${t.blue(`šŸ“„`)} ${t.white(e)}`))),n.warnings.length>0&&(console.log(t.yellow(`
31
- Warnings:`)),n.warnings.forEach(e=>console.log(` ${t.yellow(`āš ļø`)} ${e}`)))}),P.command(`update`).description(`Update the Protocol to the latest version`).addHelpText(`after`,`
47
+ `).option(`-n, --dry-run`,`Preview what would be created without writing files`).option(`--harness <name...>`,`Install workflows for the specified harness id(s); skip the prompt`).option(`--all`,`Install workflows for all known harnesses; skip the prompt`).option(`--no-prompt`,`Skip the interactive harness prompt (use with --harness or --all)`).action(async e=>{try{let n=await V({dryRun:e.dryRun,harnesses:e.harness,all:e.all,noPrompt:e.prompt===!1});n.success||(console.error(t.red(`\nāŒ ${n.message}`)),process.exit(1)),n.dryRun?console.log(t.cyan(`\nšŸ” ${n.message} (dry-run)`)):console.log(t.green(`\nāœ… ${n.message}`)),n.created.length>0&&(console.log(`\n${t.bold(n.dryRun?`Would create:`:`Created:`)}`),n.created.forEach(e=>console.log(` ${t.blue(`šŸ“„`)} ${t.white(e)}`))),n.harnessFiles&&n.harnessFiles.length>0&&(console.log(`\n${t.bold(`Harness workflow files:`)}`),n.harnessFiles.forEach(e=>console.log(` ${t.cyan(`āš™ļø `)} ${t.white(e)}`))),n.warnings.length>0&&(console.log(t.yellow(`
48
+ Warnings:`)),n.warnings.forEach(e=>console.log(` ${t.yellow(`āš ļø`)} ${e}`)))}catch(e){let n=e instanceof Error?e.message:String(e);console.error(t.red(`\nāŒ ${n}`)),process.exit(1)}}),q.command(`update`).description(`Update the Protocol to the latest version`).addHelpText(`after`,`
32
49
  This command updates ${t.white(`PROTOCOL.md`)} to the latest version embedded in the CLI.
33
50
  Only ${t.white(`PROTOCOL.md`)} is modified; your ${t.white(`TASKS.md`)} and ${t.white(`AGENT.md`)} files are preserved.
34
51
 
@@ -39,7 +56,7 @@ ${t.bold(`Version comparison:`)}
39
56
 
40
57
  ${t.bold(`Examples:`)}
41
58
  $ ${t.cyan(`autonomos update`)}
42
- `).action(()=>{let e=M();e.success||(e.cliOutdated?console.error(t.yellow(`\nāš ļø ${e.message}`)):console.error(t.red(`\nāŒ ${e.message}`)),process.exit(1)),console.log(t.green(`\nāœ… ${e.message}`))}),P.command(`status`).description(`Show project status and task summary`).addHelpText(`after`,`
59
+ `).action(()=>{let e=G();e.success||(e.cliOutdated?console.error(t.yellow(`\nāš ļø ${e.message}`)):console.error(t.red(`\nāŒ ${e.message}`)),process.exit(1)),console.log(t.green(`\nāœ… ${e.message}`))}),q.command(`status`).description(`Show project status and task summary`).addHelpText(`after`,`
43
60
  Displays information about the current project:
44
61
  - Protocol version
45
62
  - CLI version used for initialization
@@ -47,17 +64,27 @@ Displays information about the current project:
47
64
 
48
65
  ${t.bold(`Examples:`)}
49
66
  $ ${t.cyan(`autonomos status`)}
50
- `).action(()=>{let e=A();if(e.success||(console.error(t.red(`\nāŒ ${e.message}`)),process.exit(1)),console.log(`\n${t.bold(`šŸ“¦ Protocol`)} ${t.green(`v${e.protocolVersion}`)} ${t.dim(`(CLI v${e.cliVersion})`)}`),e.taskSummary){let n=e.taskSummary;console.log(`\n${t.bold(`šŸ“‹ Tasks:`)} ${t.cyan(n.total)} total`),console.log(` ${t.white(`⬜ Todo:`)} ${t.white(n.todo)}`),console.log(` ${t.blue(`šŸ”„ In Progress:`)} ${t.blue(n.inProgress)}`),console.log(` ${t.green(`āœ… Done:`)} ${t.green(n.done)}`),n.blocked>0&&console.log(` ${t.red(`🚫 Blocked:`)} ${t.red(n.blocked)}`)}}),P.command(`agents`).description(`List all AGENT.md files in the project`).option(`-a, --all`,`Search from project root instead of current directory`).addHelpText(`after`,`
51
- This command discovers and displays all ${t.white(`AGENT.md`)} files in a tree structure.
52
- ${t.white(`AGENT.md`)} files provide context to AI agents about specific directories.
67
+ `).action(()=>{let e=U();if(e.success||(console.error(t.red(`\nāŒ ${e.message}`)),process.exit(1)),console.log(`\n${t.bold(`šŸ“¦ Protocol`)} ${t.green(`v${e.protocolVersion}`)} ${t.dim(`(CLI v${e.cliVersion})`)}`),e.taskSummary){let n=e.taskSummary;console.log(`\n${t.bold(`šŸ“‹ Tasks:`)} ${t.cyan(n.total)} total`),console.log(` ${t.white(`⬜ Todo:`)} ${t.white(n.todo)}`),console.log(` ${t.blue(`šŸ”„ In Progress:`)} ${t.blue(n.inProgress)}`),console.log(` ${t.green(`āœ… Done:`)} ${t.green(n.done)}`),n.blocked>0&&console.log(` ${t.red(`🚫 Blocked:`)} ${t.red(n.blocked)}`)}}),q.command(`agents`).description(`List all AGENT.md files in the project, or the ancestor chain for a path`).argument(`[path]`,`Optional file or folder. When provided, return the ordered list of ancestor AGENT.md files (root -> target) instead of the full tree.`).option(`-a, --all`,`In tree mode: search from project root instead of current directory`).addHelpText(`after`,`
68
+ This command has two modes:
69
+
70
+ ${t.bold(`Tree mode`)} (default, or with ${t.cyan(`--all`)}):
71
+ Discover and display all ${t.white(`AGENT.md`)} files in a tree structure.
72
+ Used at session start to get the broader fractal picture of the project.
53
73
 
54
- ${t.bold(`Modes:`)}
55
- (default) Search from current directory downwards
56
- --all Search from project root (finds .autonomos or .git)
74
+ ${t.bold(`Ancestors mode`)} (with a positional ${t.cyan(`<path>`)} argument):
75
+ Return the ordered list of ${t.white(`AGENT.md`)} files on the path from the
76
+ target up to the project root. Root-first; non-existent ancestors are
77
+ silently skipped. Used at task start to get the precise fractal context
78
+ for the file or folder being worked on.
57
79
 
58
80
  ${t.bold(`Examples:`)}
59
- $ ${t.cyan(`autonomos agents`)} # List from current directory
60
- $ ${t.cyan(`autonomos agents --all`)} # List from project root
61
- $ ${t.cyan(`cd packages/core && autonomos agents`)} # List only in packages/core
62
- `).action(e=>{let n=O({all:e.all});n.success||(console.error(t.red(`\nāŒ ${n.message}`)),process.exit(1)),console.log(`
63
- `+(n.tree??n.message)),console.log(t.dim(`\n${n.message}`))}),P.command(`version`).description(`Show the current Protocol version`).action(()=>{console.log(`${t.bold(`Agent Protocol`)} ${t.green(`v${s}`)} ${t.dim(`(CLI v${N})`)}`)}),P.parse();export{};
81
+ $ ${t.cyan(`autonomos agents`)} # Tree, from current dir
82
+ $ ${t.cyan(`autonomos agents --all`)} # Tree, from project root
83
+ $ ${t.cyan(`autonomos agents apps/web`)} # Ancestors for apps/web
84
+ $ ${t.cyan(`autonomos agents apps/web/components/ui/button.tsx`)} # Ancestors for a file
85
+ `).action((e,n)=>{let r=F({all:n.all,target:e});r.success||(console.error(t.red(`
86
+ āŒ ${r.message}`)),process.exit(1)),r.mode===`ancestors`?console.log(t.cyan(`
87
+ šŸ” ${r.message}`)):(console.log(`
88
+ `+(r.tree??r.message)),console.log(t.dim(`
89
+ ${r.message}`)))}),q.command(`version`).description(`Show the current Protocol version`).action(()=>{console.log(`${t.bold(`Agent Protocol`)} ${t.green(`v${s}`)} ${t.dim(`(CLI v${K})`)}`)}),q.parse();export{};
90
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["CLI_VERSION","packageJson.version","CLI_VERSION","packageJson.version"],"sources":["../src/commands/agents.ts","../package.json","../src/commands/init.ts","../src/commands/status.ts","../src/commands/update.ts","../src/index.ts"],"sourcesContent":["import { existsSync, readdirSync, statSync } from 'node:fs'\nimport { basename, join, relative, resolve } from 'node:path'\n\nimport { AGENT_FILE, AUTONOMOS_DIR, findAncestorAgents, type AncestorAgent } from '@autonomos/core'\n\ninterface AgentsOptions {\n cwd?: string\n /**\n * When true, search from the project root (discovered by walking up to\n * .autonomos or .git) instead of the current directory.\n */\n all?: boolean\n /**\n * Optional target path (file or directory). When provided, the command\n * switches to \"ancestor lookup\" mode and prints the ordered list of\n * AGENT.md files on the path from the target up to the project root.\n * Existing ancestors only; gaps are silently skipped.\n */\n target?: string\n}\n\ninterface AgentEntry {\n path: string\n relativePath: string\n depth: number\n}\n\n/**\n * Find the project root by looking for .autonomos or .git directory\n */\nfunction findProjectRoot(startDir: string): string | null {\n let currentDir = startDir\n\n while (currentDir !== '/') {\n if (existsSync(join(currentDir, AUTONOMOS_DIR)) || existsSync(join(currentDir, '.git'))) {\n return currentDir\n }\n currentDir = join(currentDir, '..')\n }\n\n return null\n}\n\n/**\n * Recursively find all AGENT.md files in a directory\n */\nfunction findAgentFiles(dir: string, baseDir: string, depth = 0): AgentEntry[] {\n const entries: AgentEntry[] = []\n\n // Check if AGENT.md exists in current directory\n const agentPath = join(dir, AGENT_FILE)\n if (existsSync(agentPath)) {\n entries.push({\n path: agentPath,\n relativePath: relative(baseDir, agentPath) || AGENT_FILE,\n depth,\n })\n }\n\n // Scan subdirectories\n try {\n const items = readdirSync(dir)\n for (const item of items) {\n // Skip hidden directories and node_modules\n if (\n item.startsWith('.') ||\n item === 'node_modules' ||\n item === 'dist' ||\n item === 'build'\n ) {\n continue\n }\n\n const itemPath = join(dir, item)\n try {\n if (statSync(itemPath).isDirectory()) {\n entries.push(...findAgentFiles(itemPath, baseDir, depth + 1))\n }\n } catch {\n // Skip inaccessible directories\n }\n }\n } catch {\n // Skip inaccessible directories\n }\n\n return entries\n}\n\ninterface TreeNode {\n name: string\n isAgent: boolean\n children: Record<string, TreeNode>\n}\n\n/**\n * Format agent entries as a true tree structure\n */\nfunction formatAsTree(entries: AgentEntry[], baseDir: string): string {\n if (entries.length === 0) {\n return ' (no AGENT.md files found)'\n }\n\n const rootName = basename(baseDir)\n const tree: TreeNode = { name: rootName, isAgent: false, children: {} }\n\n // Build the tree\n for (const entry of entries) {\n const parts = entry.relativePath.split('/')\n let current = tree\n\n for (const part of parts) {\n const isAgent = part === AGENT_FILE\n\n let child = current.children[part]\n if (!child) {\n child = {\n name: part,\n isAgent,\n children: {},\n }\n current.children[part] = child\n }\n current = child\n }\n }\n\n const lines: string[] = []\n lines.push(`šŸ“ ${rootName}/`)\n\n function render(node: TreeNode, prefix = '', _isLast = true): void {\n const children = Object.values(node.children)\n children.sort((a, b) => {\n // Folders first\n if (!a.isAgent && b.isAgent) return -1\n if (a.isAgent && !b.isAgent) return 1\n return a.name.localeCompare(b.name)\n })\n\n children.forEach((child, index) => {\n const childIsLast = index === children.length - 1\n const branch = childIsLast ? '└── ' : 'ā”œā”€ā”€ '\n const icon = child.isAgent ? 'šŸ“„' : 'šŸ“'\n const name = child.isAgent ? child.name : `${child.name}/`\n\n lines.push(`${prefix}${branch}${icon} ${name}`)\n\n if (!child.isAgent) {\n const nextPrefix = prefix + (childIsLast ? ' ' : '│ ')\n render(child, nextPrefix, childIsLast)\n }\n })\n }\n\n render(tree)\n return lines.join('\\n')\n}\n\n/**\n * Format the ancestor-lookup result as a numbered, root-first list.\n */\nfunction formatAncestors(ancestors: AncestorAgent[]): string {\n if (ancestors.length === 0) {\n return ' (no AGENT.md files found in the ancestor chain)'\n }\n const lines = ancestors.map((a, i) => {\n const idx = (i + 1).toString().padStart(ancestors.length.toString().length, ' ')\n return ` ${idx}. ${a.relativeDir === '.' ? './AGENT.md' : `${a.relativeDir}/AGENT.md`}`\n })\n return lines.join('\\n')\n}\n\ninterface AgentsResult {\n success: boolean\n message: string\n tree?: string\n count?: number\n /**\n * When in ancestor-lookup mode, the list of ancestor AGENT.md files\n * (root-first order). Each entry has `dir`, `path`, `relativeDir`.\n */\n ancestors?: AncestorAgent[]\n /** The mode that was used. Useful for the caller to format output. */\n mode: 'tree' | 'ancestors'\n}\n\n/**\n * List AGENT.md files in the project.\n *\n * Two modes:\n *\n * 1. **Tree mode** (default, or with `--all`): list all AGENT.md files\n * in a tree structure. Used at session start to get the full fractal\n * picture of the project.\n *\n * 2. **Ancestors mode** (with a positional `<path>` argument): return\n * the ordered list of AGENT.md files on the path from the target\n * up to the project root. Root-first, with non-existent ancestors\n * silently skipped. Used at task start to get the precise fractal\n * context for the file or folder being worked on.\n */\nexport function agents(options: AgentsOptions = {}): AgentsResult {\n const cwd = options.cwd ?? process.cwd()\n\n // --- Ancestors mode (positional <path> arg) ---\n if (options.target) {\n const projectRoot = findProjectRoot(cwd) ?? cwd\n let ancestors: AncestorAgent[]\n try {\n ancestors = findAncestorAgents(resolve(cwd, options.target), projectRoot)\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n return {\n success: false,\n message: `Failed to look up ancestors: ${message}`,\n mode: 'ancestors',\n }\n }\n const list = formatAncestors(ancestors)\n return {\n success: true,\n message: `Found ${ancestors.length} ancestor AGENT.md file(s) for \"${options.target}\" (root → target):\\n${list}`,\n count: ancestors.length,\n ancestors,\n mode: 'ancestors',\n }\n }\n\n // --- Tree mode (default) ---\n let searchBase: string\n if (options.all) {\n const projectRoot = findProjectRoot(cwd)\n if (!projectRoot) {\n return {\n success: false,\n message: 'Could not find project root (.autonomos or .git directory).',\n mode: 'tree',\n }\n }\n searchBase = projectRoot\n } else {\n searchBase = cwd\n }\n\n const entries = findAgentFiles(searchBase, searchBase)\n\n if (entries.length === 0) {\n return {\n success: true,\n message: 'No AGENT.md files found.',\n count: 0,\n mode: 'tree',\n }\n }\n\n const tree = formatAsTree(entries, searchBase)\n return {\n success: true,\n message: `Found ${entries.length} AGENT.md file(s)`,\n tree,\n count: entries.length,\n mode: 'tree',\n }\n}\n","","import { checkbox } from '@inquirer/prompts'\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'\nimport { join, resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nimport {\n AGENT_FILE,\n AUTONOMOS_DIR,\n createManifest,\n generateAgentTemplate,\n generateManifestContent,\n listHarnesses,\n MANIFEST_FILE,\n PROTOCOL_FILE,\n PROTOCOL_TEMPLATE,\n PROTOCOL_VERSION,\n resolveTargets,\n TASKS_FILE,\n TASKS_TEMPLATE,\n WORKLOGS_DIR,\n} from '@autonomos/core'\n\n// Synchronize with the package.json version at build time. The bundler\n// inlines this JSON, so the resolved value is always current.\n// (package.json import — inlined by the bundler)\nimport packageJson from '../../package.json' with { type: 'json' }\nconst CLI_VERSION: string = packageJson.version\n\ninterface InitOptions {\n cwd?: string\n dryRun?: boolean\n /** Specific harness ids to install for. */\n harnesses?: string[]\n /** Install for all known harnesses (overrides `harnesses`). */\n all?: boolean\n /** Skip the interactive prompt even when no harnesses are specified. */\n noPrompt?: boolean\n}\n\ninterface InitResult {\n success: boolean\n message: string\n created: string[]\n warnings: string[]\n dryRun?: boolean\n harnessFiles?: string[]\n}\n\nconst WORKFLOW_FILES = [\n 'protocol-session.md',\n 'protocol-task.md',\n 'protocol-crystallize.md',\n] as const\n\n/**\n * Resolve the workflows directory inside the @autonomos/core package.\n * In dev (tsdown not yet run), this points to src/workflows. In published\n * builds, it falls back to dist/workflows.\n */\nfunction getWorkflowsDir(): string {\n const here = fileURLToPath(import.meta.url)\n // here is .../packages/cli/dist/commands/init.mjs (or src/commands/init.ts in dev)\n // Walk up until we find @autonomos/core\n const candidates = [\n // Dev (running from src via tsdown --watch): packages/cli/src/commands/init.ts\n resolve(here, '..', '..', '..', '..', 'core', 'src', 'workflows'),\n // Built (single bundle at packages/cli/dist/index.mjs): packages/core/dist/workflows\n resolve(here, '..', '..', '..', 'core', 'dist', 'workflows'),\n // Built (per-entry at packages/cli/dist/commands/init.mjs): packages/core/dist/workflows\n resolve(here, '..', '..', '..', '..', 'core', 'dist', 'workflows'),\n ]\n for (const candidate of candidates) {\n if (existsSync(candidate)) return candidate\n }\n throw new Error('Could not locate the workflows directory inside @autonomos/core')\n}\n\n/**\n * Prompt the user interactively for which harnesses to install for.\n * Returns the selected harness ids. An empty array means the user chose\n * to skip harness installation entirely.\n */\nasync function promptForHarnesses(): Promise<string[]> {\n const harnesses = listHarnesses()\n return checkbox({\n message:\n 'Which AI harnesses do you want to install the protocol for? (space to toggle, enter to confirm)',\n choices: harnesses.map(({ id, harness }) => ({\n name: harness.name,\n value: id,\n checked: harness.preferred,\n })),\n })\n}\n\n/**\n * Initialize the Autonomos Agent Protocol in a directory.\n */\nexport async function init(options: InitOptions = {}): Promise<InitResult> {\n const cwd = options.cwd ?? process.cwd()\n const dryRun = options.dryRun ?? false\n const created: string[] = []\n const warnings: string[] = []\n const harnessFiles: string[] = []\n\n // Check for .git\n const gitDir = join(cwd, '.git')\n if (!existsSync(gitDir)) {\n warnings.push('No Git repository detected. Consider running `git init` first.')\n }\n\n // Check if already initialized\n const autonomosDir = join(cwd, AUTONOMOS_DIR)\n if (existsSync(autonomosDir)) {\n return {\n success: false,\n message: `Project already initialized with Protocol v${PROTOCOL_VERSION}. Use \\`autonomos update\\` to update.`,\n created: [],\n warnings: [],\n dryRun,\n }\n }\n\n // Resolve which harnesses to install for\n let selectedHarnesses: string[]\n if (options.all) {\n selectedHarnesses = listHarnesses().map(({ id }) => id)\n } else if (options.harnesses && options.harnesses.length > 0) {\n selectedHarnesses = options.harnesses\n } else if (options.noPrompt || options.dryRun) {\n selectedHarnesses = []\n } else {\n selectedHarnesses = await promptForHarnesses()\n }\n\n // Compute the unique target directories\n const targets = resolveTargets(selectedHarnesses, cwd)\n\n // In dry-run mode, just collect what would be created\n if (dryRun) {\n created.push(AUTONOMOS_DIR)\n created.push(`${AUTONOMOS_DIR}/${WORKLOGS_DIR}`)\n created.push(`${AUTONOMOS_DIR}/${MANIFEST_FILE}`)\n created.push(`${AUTONOMOS_DIR}/${PROTOCOL_FILE}`)\n created.push(`${AUTONOMOS_DIR}/${TASKS_FILE}`)\n\n const agentPath = join(cwd, AGENT_FILE)\n if (!existsSync(agentPath)) {\n created.push(AGENT_FILE)\n } else {\n warnings.push(`${AGENT_FILE} already exists, would skip.`)\n }\n\n for (const target of targets) {\n for (const workflowFile of WORKFLOW_FILES) {\n const filename = buildTargetFilename(workflowFile, target.fileExtension)\n harnessFiles.push(`${target.path}/${filename}`)\n }\n }\n\n return {\n success: true,\n message: `Would initialize project with Agent Protocol v${PROTOCOL_VERSION}${selectedHarnesses.length ? ` (harnesses: ${selectedHarnesses.join(', ')})` : ''}`,\n created,\n warnings,\n dryRun: true,\n harnessFiles,\n }\n }\n\n // Create .autonomos directory\n mkdirSync(autonomosDir, { recursive: true })\n created.push(AUTONOMOS_DIR)\n\n // Create worklogs directory\n const worklogsDir = join(autonomosDir, WORKLOGS_DIR)\n mkdirSync(worklogsDir, { recursive: true })\n created.push(`${AUTONOMOS_DIR}/${WORKLOGS_DIR}`)\n\n // Create manifest.json\n const manifest = createManifest(CLI_VERSION)\n const manifestPath = join(autonomosDir, MANIFEST_FILE)\n writeFileSync(manifestPath, generateManifestContent(manifest))\n created.push(`${AUTONOMOS_DIR}/${MANIFEST_FILE}`)\n\n // Create PROTOCOL.md\n const protocolPath = join(autonomosDir, PROTOCOL_FILE)\n writeFileSync(protocolPath, PROTOCOL_TEMPLATE)\n created.push(`${AUTONOMOS_DIR}/${PROTOCOL_FILE}`)\n\n // Create TASKS.md\n const tasksPath = join(autonomosDir, TASKS_FILE)\n writeFileSync(tasksPath, TASKS_TEMPLATE)\n created.push(`${AUTONOMOS_DIR}/${TASKS_FILE}`)\n\n // Create AGENT.md at root (only if it doesn't exist)\n const agentPath = join(cwd, AGENT_FILE)\n if (!existsSync(agentPath)) {\n const projectName = cwd.split('/').pop() ?? 'Project'\n writeFileSync(agentPath, generateAgentTemplate(projectName))\n created.push(AGENT_FILE)\n } else {\n warnings.push(`${AGENT_FILE} already exists, skipping.`)\n }\n\n // Install workflow files for each selected harness\n const workflowsDir = getWorkflowsDir()\n for (const target of targets) {\n mkdirSync(target.path, { recursive: true })\n for (const workflowFile of WORKFLOW_FILES) {\n const source = readFileSync(join(workflowsDir, workflowFile), 'utf-8')\n const filename = buildTargetFilename(workflowFile, target.fileExtension)\n const dest = join(target.path, filename)\n writeFileSync(dest, source)\n harnessFiles.push(`${target.path}/${filename}`)\n }\n }\n\n const harnessMsg =\n selectedHarnesses.length > 0\n ? ` for harnesses: ${selectedHarnesses.join(', ')}`\n : ' (no harness workflows installed)'\n\n return {\n success: true,\n message: `Project initialized with Agent Protocol v${PROTOCOL_VERSION}${harnessMsg}`,\n created,\n warnings,\n dryRun: false,\n harnessFiles,\n }\n}\n\n/**\n * Strip the leading `protocol-` prefix from a workflow filename so that\n * the installed file is just `session.md`, `task.md`, `crystallize.md`.\n * This gives shorter invocation names (`/session` instead of `/protocol-session`).\n */\nfunction buildTargetFilename(sourceFile: string, targetExtension: string): string {\n // sourceFile: \"protocol-session.md\" -> \"session.md\" (drop prefix, drop source ext, add target ext)\n const withoutPrefix = sourceFile.replace(/^protocol-/, '')\n const withoutExt = withoutPrefix.replace(/\\.[^.]+$/, '')\n return withoutExt + targetExtension\n}\n","import { existsSync, readFileSync } from 'node:fs'\nimport { join } from 'node:path'\n\nimport {\n AUTONOMOS_DIR,\n MANIFEST_FILE,\n parseManifest,\n TaskParser,\n TASKS_FILE,\n type Manifest,\n} from '@autonomos/core'\n\ninterface StatusOptions {\n cwd?: string\n}\n\ninterface TaskSummary {\n total: number\n todo: number\n inProgress: number\n done: number\n blocked: number\n}\n\ninterface StatusResult {\n success: boolean\n message: string\n protocolVersion?: string\n cliVersion?: string\n initialized: boolean\n taskSummary?: TaskSummary\n}\n\n/**\n * Get project status and task summary\n */\nexport function status(options: StatusOptions = {}): StatusResult {\n const cwd = options.cwd ?? process.cwd()\n\n // Check if initialized\n const autonomosDir = join(cwd, AUTONOMOS_DIR)\n const manifestPath = join(autonomosDir, MANIFEST_FILE)\n\n if (!existsSync(manifestPath)) {\n return {\n success: false,\n message: 'Project not initialized. Run `autonomos init` first.',\n initialized: false,\n }\n }\n\n // Read manifest\n let manifest: Manifest\n try {\n const manifestContent = readFileSync(manifestPath, 'utf-8')\n manifest = parseManifest(manifestContent)\n } catch {\n return {\n success: false,\n message: 'Could not read manifest.json',\n initialized: true,\n }\n }\n\n // Parse tasks\n let taskSummary: TaskSummary | undefined\n const tasksPath = join(autonomosDir, TASKS_FILE)\n\n if (existsSync(tasksPath)) {\n try {\n const tasksContent = readFileSync(tasksPath, 'utf-8')\n const tasks = TaskParser.parse(tasksContent)\n\n taskSummary = {\n total: tasks.length,\n todo: tasks.filter(t => t.status === 'TODO').length,\n inProgress: tasks.filter(t => t.status === 'IN_PROGRESS').length,\n done: tasks.filter(t => t.status === 'DONE').length,\n blocked: tasks.filter(t => t.status === 'BLOCKED').length,\n }\n } catch {\n // Tasks file exists but couldn't be parsed\n }\n }\n\n return {\n success: true,\n message: 'Project status retrieved',\n protocolVersion: manifest.protocolVersion,\n cliVersion: manifest.cliVersion,\n initialized: true,\n taskSummary,\n }\n}\n","import { existsSync, readFileSync, writeFileSync } from 'node:fs'\nimport { join } from 'node:path'\n\nimport {\n AUTONOMOS_DIR,\n generateManifestContent,\n MANIFEST_FILE,\n parseManifest,\n PROTOCOL_FILE,\n PROTOCOL_TEMPLATE,\n PROTOCOL_VERSION,\n type Manifest,\n} from '@autonomos/core'\n\n// Get CLI version from package.json\nconst CLI_VERSION = '0.0.1' // TODO: Import from package.json\n\ninterface UpdateOptions {\n cwd?: string\n}\n\ninterface UpdateResult {\n success: boolean\n message: string\n previousVersion?: string\n newVersion?: string\n cliOutdated?: boolean\n}\n\n/**\n * Compare two SemVer versions\n * Returns: -1 if a < b, 0 if a === b, 1 if a > b\n */\nfunction compareVersions(a: string, b: string): number {\n const aParts = a.split('.').map(Number)\n const bParts = b.split('.').map(Number)\n\n for (let i = 0; i < 3; i++) {\n const aNum = aParts[i] ?? 0\n const bNum = bParts[i] ?? 0\n if (aNum < bNum) return -1\n if (aNum > bNum) return 1\n }\n return 0\n}\n\n/**\n * Update the Protocol to the latest version\n */\nexport function update(options: UpdateOptions = {}): UpdateResult {\n const cwd = options.cwd ?? process.cwd()\n\n // Check if initialized\n const autonomosDir = join(cwd, AUTONOMOS_DIR)\n const manifestPath = join(autonomosDir, MANIFEST_FILE)\n\n if (!existsSync(manifestPath)) {\n return {\n success: false,\n message: 'Project not initialized. Run `autonomos init` first.',\n }\n }\n\n // Read current manifest\n const manifestContent = readFileSync(manifestPath, 'utf-8')\n const manifest: Manifest = parseManifest(manifestContent)\n const currentVersion = manifest.protocolVersion\n\n // Compare versions\n const comparison = compareVersions(currentVersion, PROTOCOL_VERSION)\n\n if (comparison === 0) {\n return {\n success: true,\n message: `Already up to date (Protocol v${PROTOCOL_VERSION})`,\n previousVersion: currentVersion,\n newVersion: PROTOCOL_VERSION,\n }\n }\n\n if (comparison > 0) {\n // Project uses a newer version than CLI knows\n return {\n success: false,\n message: `This project uses Protocol v${currentVersion}, but your CLI only knows v${PROTOCOL_VERSION}. Update your CLI with \\`npm i -g @autonomos/cli\\`.`,\n previousVersion: currentVersion,\n newVersion: PROTOCOL_VERSION,\n cliOutdated: true,\n }\n }\n\n // Update Protocol (comparison < 0)\n const protocolPath = join(autonomosDir, PROTOCOL_FILE)\n writeFileSync(protocolPath, PROTOCOL_TEMPLATE)\n\n // Update manifest\n const updatedManifest: Manifest = {\n ...manifest,\n protocolVersion: PROTOCOL_VERSION,\n cliVersion: CLI_VERSION,\n lastUpdated: new Date().toISOString(),\n }\n writeFileSync(manifestPath, generateManifestContent(updatedManifest))\n\n return {\n success: true,\n message: `Protocol updated: v${currentVersion} → v${PROTOCOL_VERSION}`,\n previousVersion: currentVersion,\n newVersion: PROTOCOL_VERSION,\n }\n}\n","#!/usr/bin/env node\nimport { Command } from 'commander'\nimport pc from 'picocolors'\n\nimport { PROTOCOL_VERSION } from '@autonomos/core'\nimport { agents } from './commands/agents'\nimport { init } from './commands/init'\nimport { status } from './commands/status'\nimport { update } from './commands/update'\n\n// Synchronize with the package.json version at build time. The bundler\n// inlines this JSON, so the resolved value is always current.\n// (package.json import — inlined by the bundler)\nimport packageJson from '../package.json' with { type: 'json' }\nconst CLI_VERSION: string = packageJson.version\n\nconst program = new Command()\n\nprogram\n .name('autonomos')\n .description(\n pc.cyan(`CLI for the Autonomos Agent Protocol\n\nThe Agent Protocol is a specification for AI agents to interact with codebases\nin a structured, consistent way. It defines how agents should read context,\nexecute tasks, and persist knowledge.`) +\n `\n\nDocumentation: ${pc.underline('https://github.com/saoudi-h/autonomos')}`\n )\n .version(\n `${pc.bold('CLI:')} ${pc.green(CLI_VERSION)}\\n${pc.bold('Protocol:')} ${pc.green(PROTOCOL_VERSION)}`,\n '-v, --version',\n 'Show version information'\n )\n .helpOption('-h, --help', 'Show help information')\n .addHelpText(\n 'after',\n `\n${pc.bold('Examples:')}\n $ ${pc.cyan('autonomos init')} Initialize the Agent Protocol in current directory\n $ ${pc.cyan('autonomos update')} Update Protocol to the latest version\n $ ${pc.cyan('autonomos status')} Show project status and task summary\n $ ${pc.cyan('autonomos agents')} List all AGENT.md files in the project\n\n${pc.bold('More info:')}\n Run '${pc.cyan('autonomos <command> --help')}' for detailed information about a command.\n`\n )\n\nprogram\n .command('init')\n .description('Initialize the Agent Protocol in the current directory')\n .addHelpText(\n 'after',\n `\nThis command creates the following structure:\n ${pc.blue('.autonomos/')}\n ā”œā”€ā”€ ${pc.white('manifest.json')} # Protocol metadata and version\n ā”œā”€ā”€ ${pc.white('PROTOCOL.md')} # Immutable protocol specification\n ā”œā”€ā”€ ${pc.white('TASKS.md')} # Task registry\n └── ${pc.blue('worklogs/')} # Session logs directory\n ${pc.white('AGENT.md')} # Project context file (at root)\n\nAdditionally, when one or more harnesses are selected, the protocol workflow\nfiles (session / task / crystallize) are installed at the harness-specific\ntarget directory, e.g. .clinerules/workflows/ for Cline, .claude/skills/ for\nClaude Code, .agents/skills/ for the cross-tool standard (Cursor, Codex, etc.).\n\n${pc.bold('Harness selection:')}\n (default) Interactive multi-select prompt at the start of init.\n --harness Skip the prompt and install only for the given harness id(s).\n May be repeated, e.g. --harness cline --harness claude-code.\n --all Skip the prompt and install for all known harnesses.\n --no-prompt Same as not specifying a TTY; useful in CI/scripted contexts.\n\n${pc.bold('Examples:')}\n $ ${pc.cyan('autonomos init')}\n $ ${pc.cyan('autonomos init --harness cline')}\n $ ${pc.cyan('autonomos init --harness cline --harness claude-code')}\n $ ${pc.cyan('autonomos init --all')}\n $ ${pc.cyan('autonomos init --dry-run')}\n $ ${pc.cyan('cd my-project && autonomos init')}\n`\n )\n .option('-n, --dry-run', 'Preview what would be created without writing files')\n .option(\n '--harness <name...>',\n 'Install workflows for the specified harness id(s); skip the prompt'\n )\n .option('--all', 'Install workflows for all known harnesses; skip the prompt')\n .option('--no-prompt', 'Skip the interactive harness prompt (use with --harness or --all)')\n .action(\n async (opts: { dryRun?: boolean; harness?: string[]; all?: boolean; prompt?: boolean }) => {\n try {\n const result = await init({\n dryRun: opts.dryRun,\n harnesses: opts.harness,\n all: opts.all,\n noPrompt: opts.prompt === false,\n })\n\n if (!result.success) {\n console.error(pc.red(`\\nāŒ ${result.message}`))\n process.exit(1)\n }\n\n if (result.dryRun) {\n console.log(pc.cyan(`\\nšŸ” ${result.message} (dry-run)`))\n } else {\n console.log(pc.green(`\\nāœ… ${result.message}`))\n }\n\n if (result.created.length > 0) {\n console.log(`\\n${pc.bold(result.dryRun ? 'Would create:' : 'Created:')}`)\n result.created.forEach(file =>\n console.log(` ${pc.blue('šŸ“„')} ${pc.white(file)}`)\n )\n }\n\n if (result.harnessFiles && result.harnessFiles.length > 0) {\n console.log(`\\n${pc.bold('Harness workflow files:')}`)\n result.harnessFiles.forEach(file =>\n console.log(` ${pc.cyan('āš™ļø ')} ${pc.white(file)}`)\n )\n }\n\n if (result.warnings.length > 0) {\n console.log(pc.yellow('\\nWarnings:'))\n result.warnings.forEach(warn => console.log(` ${pc.yellow('āš ļø')} ${warn}`))\n }\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n console.error(pc.red(`\\nāŒ ${message}`))\n process.exit(1)\n }\n }\n )\n\nprogram\n .command('update')\n .description('Update the Protocol to the latest version')\n .addHelpText(\n 'after',\n `\nThis command updates ${pc.white('PROTOCOL.md')} to the latest version embedded in the CLI.\nOnly ${pc.white('PROTOCOL.md')} is modified; your ${pc.white('TASKS.md')} and ${pc.white('AGENT.md')} files are preserved.\n\n${pc.bold('Version comparison:')}\n - If your project has an older version: Updates to the new version\n - If your project has a newer version: Warns you to update the CLI\n - If versions match: No action needed\n\n${pc.bold('Examples:')}\n $ ${pc.cyan('autonomos update')}\n`\n )\n .action(() => {\n const result = update()\n\n if (!result.success) {\n if (result.cliOutdated) {\n console.error(pc.yellow(`\\nāš ļø ${result.message}`))\n } else {\n console.error(pc.red(`\\nāŒ ${result.message}`))\n }\n process.exit(1)\n }\n\n console.log(pc.green(`\\nāœ… ${result.message}`))\n })\n\nprogram\n .command('status')\n .description('Show project status and task summary')\n .addHelpText(\n 'after',\n `\nDisplays information about the current project:\n - Protocol version\n - CLI version used for initialization\n - Task summary (todo, in-progress, done, blocked)\n\n${pc.bold('Examples:')}\n $ ${pc.cyan('autonomos status')}\n`\n )\n .action(() => {\n const result = status()\n\n if (!result.success) {\n console.error(pc.red(`\\nāŒ ${result.message}`))\n process.exit(1)\n }\n\n console.log(\n `\\n${pc.bold('šŸ“¦ Protocol')} ${pc.green(`v${result.protocolVersion}`)} ${pc.dim(`(CLI v${result.cliVersion})`)}`\n )\n\n if (result.taskSummary) {\n const s = result.taskSummary\n console.log(`\\n${pc.bold('šŸ“‹ Tasks:')} ${pc.cyan(s.total)} total`)\n console.log(` ${pc.white('⬜ Todo:')} ${pc.white(s.todo)}`)\n console.log(` ${pc.blue('šŸ”„ In Progress:')} ${pc.blue(s.inProgress)}`)\n console.log(` ${pc.green('āœ… Done:')} ${pc.green(s.done)}`)\n if (s.blocked > 0) {\n console.log(` ${pc.red('🚫 Blocked:')} ${pc.red(s.blocked)}`)\n }\n }\n })\n\nprogram\n .command('agents')\n .description('List all AGENT.md files in the project, or the ancestor chain for a path')\n .argument(\n '[path]',\n 'Optional file or folder. When provided, return the ordered list of ancestor AGENT.md files (root -> target) instead of the full tree.'\n )\n .option('-a, --all', 'In tree mode: search from project root instead of current directory')\n .addHelpText(\n 'after',\n `\nThis command has two modes:\n\n${pc.bold('Tree mode')} (default, or with ${pc.cyan('--all')}):\n Discover and display all ${pc.white('AGENT.md')} files in a tree structure.\n Used at session start to get the broader fractal picture of the project.\n\n${pc.bold('Ancestors mode')} (with a positional ${pc.cyan('<path>')} argument):\n Return the ordered list of ${pc.white('AGENT.md')} files on the path from the\n target up to the project root. Root-first; non-existent ancestors are\n silently skipped. Used at task start to get the precise fractal context\n for the file or folder being worked on.\n\n${pc.bold('Examples:')}\n $ ${pc.cyan('autonomos agents')} # Tree, from current dir\n $ ${pc.cyan('autonomos agents --all')} # Tree, from project root\n $ ${pc.cyan('autonomos agents apps/web')} # Ancestors for apps/web\n $ ${pc.cyan('autonomos agents apps/web/components/ui/button.tsx')} # Ancestors for a file\n`\n )\n .action((path: string | undefined, opts: { all?: boolean }) => {\n const result = agents({ all: opts.all, target: path })\n\n if (!result.success) {\n console.error(\n pc.red(`\nāŒ ${result.message}`)\n )\n process.exit(1)\n }\n\n if (result.mode === 'ancestors') {\n console.log(\n pc.cyan(`\nšŸ” ${result.message}`)\n )\n } else {\n console.log('\\n' + (result.tree ?? result.message))\n console.log(\n pc.dim(`\n${result.message}`)\n )\n }\n })\n\nprogram\n .command('version')\n .description('Show the current Protocol version')\n .action(() => {\n console.log(\n `${pc.bold('Agent Protocol')} ${p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,YAAa,qEAAqE,CAAC,CAC1F,YACG,QACA;;;EAGN,EAAG,KAAK,WAAW,EAAE,qBAAqB,EAAG,KAAK,OAAO,EAAE;6BAChC,EAAG,MAAM,UAAU,EAAE;;;EAGhD,EAAG,KAAK,gBAAgB,EAAE,sBAAsB,EAAG,KAAK,QAAQ,EAAE;+BACrC,EAAG,MAAM,UAAU,EAAE;;;;;EAKlD,EAAG,KAAK,WAAW,EAAE;MACjB,EAAG,KAAK,kBAAkB,EAAE;MAC5B,EAAG,KAAK,wBAAwB,EAAE;MAClC,EAAG,KAAK,2BAA2B,EAAE;MACrC,EAAG,KAAK,oDAAoD,EAAE;CAEhE,CAAC,CACA,QAAQ,EAA0B,IAA4B,CAC3D,IAAM,EAAS,EAAO,CAAE,IAAK,EAAK,IAAK,OAAQ,CAAK,CAAC,EAEhD,EAAO,UACR,QAAQ,MACJ,EAAG,IAAI;IACnB,EAAO,SAAS,CACR,EACA,QAAQ,KAAK,CAAC,GAGd,EAAO,OAAS,YAChB,QAAQ,IACJ,EAAG,KAAK;KACnB,EAAO,SAAS,CACT,GAEA,QAAQ,IAAI;GAAQ,EAAO,MAAQ,EAAO,QAAQ,EAClD,QAAQ,IACJ,EAAG,IAAI;EACrB,EAAO,SAAS,CACN,EAER,CAAC,EAEL,EACK,QAAQ,SAAS,CAAC,CAClB,YAAY,mCAAmC,CAAC,CAChD,WAAa,CACV,QAAQ,IACJ,GAAG,EAAG,KAAK,gBAAgB,EAAE,GAAG,EAAG,MAAM,IAAI,GAAkB,EAAE,GAAG,EAAG,IAAI,SAAS,EAAY,EAAE,GACtG,CACJ,CAAC,EAEL,EAAQ,MAAM"}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@autonomos/cli",
3
- "version": "0.0.3",
3
+ "version": "0.1.0",
4
4
  "description": "CLI tool for the Autonomos Agent Protocol",
5
5
  "type": "module",
6
6
  "bin": {
7
- "autonomos": "./dist/index.mjs"
7
+ "cli": "./dist/index.mjs"
8
8
  },
9
9
  "keywords": [
10
10
  "cli",
@@ -37,17 +37,17 @@
37
37
  "dependencies": {
38
38
  "commander": "^14.0.2",
39
39
  "picocolors": "1.1.1",
40
- "@autonomos/core": "0.0.2"
40
+ "@inquirer/prompts": "^7.0.0",
41
+ "@autonomos/core": "0.1.0"
41
42
  },
42
43
  "devDependencies": {
44
+ "@tala-tools/eslint": "0.1.3",
45
+ "@tala-tools/prettier": "0.0.3",
46
+ "@tala-tools/tsconfig": "0.0.1",
47
+ "@tala-tools/tsdown": "0.1.3",
43
48
  "@types/node": "^25.0.3",
44
- "typescript": "^5.0.0",
45
- "@repo/eslint": "1.0.0",
46
- "@repo/prettier": "1.0.0",
47
- "@repo/tsdown": "1.0.0"
49
+ "typescript": "^5.0.0"
48
50
  },
49
- "main": "./dist/index.mjs",
50
- "module": "./dist/index.mjs",
51
51
  "types": "./dist/index.d.mts",
52
52
  "exports": {
53
53
  ".": "./dist/index.mjs",
@@ -61,7 +61,7 @@
61
61
  "format:check": "prettier \"**/*\" --ignore-unknown --list-different",
62
62
  "format:fix": "prettier \"**/*\" --ignore-unknown --write",
63
63
  "clean": "rimraf node_modules dist LICENSE",
64
- "typecheck": "tsc -p tsconfig.json --noEmit",
64
+ "typecheck": "tsgo --noEmit",
65
65
  "test": "vitest",
66
66
  "test:ui": "vitest --ui",
67
67
  "test:run": "vitest run",