aidescribe 0.0.2 → 0.0.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 +68 -7
- package/dist/cli.mjs +11 -11
- package/package.json +15 -11
package/README.md
CHANGED
|
@@ -1,25 +1,86 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
1
3
|
# aidescribe
|
|
2
4
|
|
|
3
|
-
CLI that generates [Jujutsu](https://jj-vcs.github.io/jj/) change descriptions with AI
|
|
5
|
+
**CLI that generates [Jujutsu](https://jj-vcs.github.io/jj/) change descriptions with AI.**
|
|
6
|
+
|
|
7
|
+
<img src=".github/image.png" alt="aidescribe demo" width="700" />
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
6
12
|
|
|
7
13
|
```bash
|
|
14
|
+
# run without installing
|
|
15
|
+
npx aidescribe
|
|
16
|
+
|
|
17
|
+
# or install globally
|
|
8
18
|
pnpm add -g aidescribe
|
|
9
19
|
```
|
|
10
20
|
|
|
21
|
+
Generate a description:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# supported `jj` target arguments
|
|
25
|
+
aidescribe
|
|
26
|
+
aidescribe <REVSETS>
|
|
27
|
+
aidescribe -r @-
|
|
28
|
+
aidescribe -r abc123
|
|
29
|
+
aidescribe -rabc123
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Only inlined `<REVSETS>` and `-r` are forwarded to `jj`.
|
|
33
|
+
|
|
34
|
+
## Requirements
|
|
35
|
+
|
|
36
|
+
- Node.js `>=22`
|
|
37
|
+
- `jj` installed
|
|
38
|
+
- Run inside a Jujutsu repository
|
|
39
|
+
|
|
40
|
+
## Setup
|
|
41
|
+
|
|
42
|
+
Run the interactive setup once to connect your AI provider and save config:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
aidescribe connect
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
This saves config to `~/.aidescribe.json`. Currently OpenAI, Anthropic, and Mistral providers are supported.
|
|
49
|
+
|
|
11
50
|
## Config
|
|
12
51
|
|
|
52
|
+
View config:
|
|
53
|
+
|
|
13
54
|
```bash
|
|
14
|
-
aidescribe config
|
|
55
|
+
aidescribe config
|
|
56
|
+
aidescribe config get provider
|
|
57
|
+
aidescribe config set variantCount=3
|
|
15
58
|
```
|
|
16
59
|
|
|
17
60
|
## Usage
|
|
18
61
|
|
|
19
62
|
```bash
|
|
20
|
-
|
|
21
|
-
aidescribe
|
|
63
|
+
aidescribe v0.0.4
|
|
22
64
|
|
|
23
|
-
|
|
24
|
-
|
|
65
|
+
Generate jj change descriptions with AI
|
|
66
|
+
|
|
67
|
+
Usage:
|
|
68
|
+
aidescribe [flags...]
|
|
69
|
+
aidescribe <command>
|
|
70
|
+
|
|
71
|
+
Commands:
|
|
72
|
+
config View or modify configuration settings
|
|
73
|
+
connect Interactive provider setup wizard
|
|
74
|
+
|
|
75
|
+
Flags:
|
|
76
|
+
--count <number> Generate multiple description variants for this run (default: 1)
|
|
77
|
+
-h, --help Show help
|
|
78
|
+
--locale <string> Override locale for this run (default: en)
|
|
79
|
+
--max-diff-chars <number> Max diff chars sent to AI for this run (default: 40000)
|
|
80
|
+
--max-length <number> Max generated title length for this run (default: 72, its a soft guidance for the
|
|
81
|
+
model, not a local hard cutoff)
|
|
82
|
+
--provider <string> Override provider for this run (supported: openai, anthropic, mistral)
|
|
83
|
+
-t, --type <string> Message format for this run (default: conventional, supports: conventional, plain)
|
|
84
|
+
--verbose Print the exact prompt payload sent to the AI model for this run
|
|
85
|
+
--version Show version
|
|
25
86
|
```
|
package/dist/cli.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
2
|
+
var se=Object.defineProperty;var r=(e,t)=>se(e,"name",{value:t,configurable:!0});import{command as N,cli as ae}from"cleye";import{intro as U,select as _,isCancel as C,cancel as $,password as ce,text as V,outro as j,spinner as k}from"@clack/prompts";import I from"node:fs/promises";import le from"node:os";import pe from"node:path";import{z as l}from"zod";import{createAnthropic as de}from"@ai-sdk/anthropic";import{createMistral as fe}from"@ai-sdk/mistral";import{createOpenAI as me}from"@ai-sdk/openai";import{generateText as ue}from"ai";import{execa as D}from"execa";let h=!0;const y=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let x=0;if(y.process&&y.process.env&&y.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,NO_COLOR:i,TERM:o,COLORTERM:s}=y.process.env;t||i||e==="0"?h=!1:e==="1"||e==="2"||e==="3"?h=!0:o==="dumb"?h=!1:"CI"in y.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(n=>n in y.process.env)?h=!0:h=process.stdout.isTTY,h&&(process.platform==="win32"||s&&(s==="truecolor"||s==="24bit")?x=3:o&&(o.endsWith("-256color")||o.endsWith("256"))?x=2:x=1)}let B={enabled:h,supportLevel:x};function F(e,t,i=1){const o=`\x1B[${e}m`,s=`\x1B[${t}m`,n=new RegExp(`\\x1b\\[${t}m`,"g");return a=>B.enabled&&B.supportLevel>=i?o+(""+a).replace(n,o)+s:""+a}r(F,"kolorist");const ge=F(30,39),he=F(101,49),ve=r(async e=>{try{return await I.access(e),!0}catch{return!1}},"fileExists");class d extends Error{static{r(this,"KnownError")}}const E=r(e=>{if(e instanceof d&&(process.stderr.write(`aidescribe: ${e.message}
|
|
3
3
|
`),process.exit(1)),e instanceof Error){const t=e.stack??e.message;process.stderr.write(`aidescribe: ${t}
|
|
4
4
|
`),process.exit(1)}process.stderr.write(`aidescribe: ${String(e)}
|
|
5
|
-
`),process.exit(1)},"handleCommandError"),
|
|
6
|
-
`,"utf8"),await
|
|
7
|
-
${
|
|
8
|
-
`):"",
|
|
9
|
-
${
|
|
10
|
-
`),"generatePrompt"),
|
|
5
|
+
`),process.exit(1)},"handleCommandError"),g=["openai","anthropic","mistral"],z={openai:{label:"OpenAI",defaultModel:"gpt-5-mini",defaultBaseURL:"https://api.openai.com/v1",apiMode:"openai-default",createClient:r(({apiKey:e,baseURL:t})=>me({apiKey:e,baseURL:t}),"createClient")},anthropic:{label:"Anthropic",defaultModel:"claude-haiku-4-5",defaultBaseURL:"https://api.anthropic.com/v1",apiMode:"anthropic-messages",createClient:r(({apiKey:e,baseURL:t})=>de({apiKey:e,baseURL:t}),"createClient")},mistral:{label:"Mistral",defaultModel:"mistral-small-latest",defaultBaseURL:"https://api.mistral.ai/v1",apiMode:"mistral-chat",createClient:r(({apiKey:e,baseURL:t})=>fe({apiKey:e,baseURL:t}),"createClient")}},A=r(e=>z[e],"getProviderDefinition"),O=r(e=>z[e].defaultModel,"getProviderDefaultModel"),G=["apiKey","model","baseURL"],ye=g.flatMap(e=>G.map(t=>`providers.${e}.${t}`)),w={provider:"openai",locale:"en",type:"conventional",maxLength:72,maxDiffChars:4e4,variantCount:1,"providers.openai.model":O("openai"),"providers.anthropic.model":O("anthropic"),"providers.mistral.model":O("mistral")},q=["provider","locale","type","maxLength","maxDiffChars","variantCount",...ye],we=g.map(e=>`providers.${e}.apiKey`),J=r(e=>G.includes(e),"isProviderAliasKey"),Y=r((e,t)=>`providers.${e}.${t}`,"toProviderConfigKey"),L=r(e=>q.includes(e),"isConfigKey"),W=r((e,t)=>({provider:t,apiKey:e[`providers.${t}.apiKey`],model:e[`providers.${t}.model`],baseURL:e[`providers.${t}.baseURL`]}),"getProviderConfig"),b=r(e=>W(e,e.provider),"getActiveProviderConfig"),K=r(()=>pe.join(le.homedir(),".aidescribe.json"),"getConfigPath"),be=r(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isRecord"),M=l.string().transform(e=>e.trim()).pipe(l.string().min(1)),Ce=Object.fromEntries(g.flatMap(e=>[[`providers.${e}.apiKey`,M.optional()],[`providers.${e}.model`,M.optional()],[`providers.${e}.baseURL`,M.optional()]])),H=l.object({provider:l.string().transform(e=>e.trim().toLowerCase()).pipe(l.enum(g)).optional(),locale:l.string().transform(e=>e.trim()).pipe(l.string().regex(/^[a-z-]+$/i,'must match letters and dashes (e.g. "en")')).optional(),type:l.string().transform(e=>e.trim()).pipe(l.enum(["conventional","plain"])).optional(),maxLength:l.union([l.number(),l.string().transform(e=>Number(e.trim()))]).pipe(l.number().int().positive({message:"must be a positive integer"})).optional(),maxDiffChars:l.union([l.number(),l.string().transform(e=>Number(e.trim()))]).pipe(l.number().int().positive({message:"must be a positive integer"})).optional(),variantCount:l.union([l.number(),l.string().transform(e=>Number(e.trim()))]).pipe(l.number().int().positive({message:"must be a positive integer"})).optional(),...Ce}),T=r(e=>{const t=H.safeParse(e),i=t.success?t.data:{},o=i,s=Object.fromEntries(g.flatMap(n=>[[`providers.${n}.model`,o[`providers.${n}.model`]??O(n)],[`providers.${n}.apiKey`,o[`providers.${n}.apiKey`]],[`providers.${n}.baseURL`,o[`providers.${n}.baseURL`]]]));return{provider:i.provider??w.provider,locale:i.locale??w.locale,type:i.type??w.type,maxLength:i.maxLength??w.maxLength,maxDiffChars:i.maxDiffChars??w.maxDiffChars,variantCount:i.variantCount??w.variantCount,...s}},"parseConfig"),Q=r(async()=>{const e=K();if(!await ve(e))return{};const i=await I.readFile(e,"utf8");try{const o=JSON.parse(i);if(!be(o))throw new d(`Invalid config file format at ${e}. Expected a JSON object.`);for(const s of Object.keys(o))if(!L(s))throw new d(`Invalid config key "${s}" in ${e}. Supported keys: ${q.join(", ")}.`);return o}catch(o){throw o instanceof d?o:new d(`Invalid config file format at ${e}. Expected a JSON object.`)}},"readConfigFile"),R=r(async e=>{const t=await Q(),i=e?.cliConfig?Object.fromEntries(Object.entries(e.cliConfig).filter(([s,n])=>n!==void 0)):{},o={...t,...i};return T(o)},"getConfig"),$e=r(e=>{const t=H.safeParse(e);if(!t.success){const i=t.error.issues[0],o=i?.path.join(".")||"config";throw new d(`Invalid ${o}: ${i?.message}`)}},"validateConfig"),xe=r((e,t)=>L(e)?e:J(e)?Y(t,e):null,"resolveSetKey"),Re=r(e=>{if(typeof e!="string")return null;const t=e.trim().toLowerCase();return g.includes(t)?t:null},"normalizeProvider"),Ie=r((e,t)=>e==="provider"||e.endsWith(".apiKey")||e.endsWith(".model")||e.endsWith(".baseURL")?t.trim():t,"normalizeConfigValue"),X=r(async e=>{const t=await Q();let i=T(t).provider;for(const[n,a]of e){const c=xe(n,i);if(!c)throw new d(`Invalid config property: ${n}`);const p=Ie(c,a);p===""?delete t[c]:t[c]=p,c==="provider"&&(i=Re(p)??T(t).provider)}$e(t);const o=K(),s=`${o}.${process.pid}.tmp`;await I.writeFile(s,`${JSON.stringify(t,null,2)}
|
|
6
|
+
`,"utf8"),await I.rename(s,o)},"setConfigs"),De=r(e=>{const t=[];for(let i=0;i<e.length;i+=1){const o=e[i];if(o!=="--"){if(o==="-r"){const s=e[i+1];s&&(t.push(s),i+=1);continue}if(o.startsWith("-r")&&o.length>2){t.push(o.slice(2));continue}o.startsWith("-")||t.push(o)}}return{globalArgs:[],revsets:t}},"parseDescribeArgsForDiff"),Ae=JSON.stringify({docs:"Documentation only changes",style:"Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",refactor:"A code change that improves code structure without changing functionality (renaming, restructuring classes/methods, extracting functions, etc)",perf:"A code change that improves performance",test:"Adding missing tests or correcting existing tests",build:"Changes that affect the build system or external dependencies",ci:"Changes to our CI configuration files and scripts",chore:"Other changes that don't modify src or test files",revert:"Reverts a previous commit",feat:"A new feature",fix:"A bug fix"},null,2),Oe={conventional:`Choose a type from the type-to-description JSON below that best describes the git diff:
|
|
7
|
+
${Ae}`,plain:""},Pe={conventional:"<type>[optional (<scope>)]: <commit message>",plain:"<commit message>"},Se=r((e,t,i,o=[])=>["Generate a concise git commit message title in present tense that precisely describes the key changes in the following code diff. Focus on what was changed, not just file names. Provide only the title, no description or body.",`Message language: ${e}`,`Commit message must be a maximum of ${t} characters.`,"Exclude anything unnecessary such as translation. Your entire response will be passed directly into jj describe.",`IMPORTANT: Do not include any explanations, introductions, or additional text. Do not wrap the commit message in quotes or any other formatting. The commit message must not exceed ${t} characters. Respond with ONLY the commit message text.`,"Be specific: include concrete details (package names, versions, functionality) rather than generic statements.",o.length>0?["Current change description(s) for the target revision(s):",...o.slice(0,5).map((s,n)=>`${n+1}. ${s}`),"If one of these is still relevant, edit/improve it. If not relevant, replace it completely."].join(`
|
|
8
|
+
`):"",Oe[i],`The output response must be in format:
|
|
9
|
+
${Pe[i]}`].filter(Boolean).join(`
|
|
10
|
+
`),"generatePrompt"),je=r((e,t,i)=>{const o=b(e),s=A(e.provider),n=["[aidescribe] AI request payload",`provider=${e.provider}`,`model=${o.model}`];n.push(`baseURL=${o.baseURL??s.defaultBaseURL}`),n.push(`apiMode=${s.apiMode}`),n.push("","[system]",t,"","[prompt]",i,""),process.stderr.write(`${n.join(`
|
|
11
11
|
`)}
|
|
12
|
-
`)},"printVerbosePayload"),
|
|
12
|
+
`)},"printVerbosePayload"),Ee=r((e,t,i)=>{const o=["[aidescribe] AI response payload",`finishReason=${t}`,`warnings=${i?JSON.stringify(i):"[]"}`,"","[response.text]",e||"<empty>",""];process.stderr.write(`${o.join(`
|
|
13
13
|
`)}
|
|
14
|
-
`)},"printVerboseResponse"),
|
|
14
|
+
`)},"printVerboseResponse"),Le=r(e=>e.trim(),"normalizeDescription"),Ke=r(e=>{const t=b(e);return A(e.provider).createClient({apiKey:t.apiKey,baseURL:t.baseURL})(t.model)},"resolveModel"),Me=r(async(e,t,i)=>{const o=Ke(t),s=await ue({model:o,maxRetries:2,system:i,prompt:e});return{rawText:s.text,finishReason:s.finishReason,warnings:s.warnings,reasoningText:s.reasoningText??""}},"generateWithProvider"),Te=r(async(e,t,i,o)=>{const s=b(t);let n;try{n=await Me(e,t,i)}catch(c){const p=c instanceof Error?c.message:String(c);throw new d(`AI request failed for provider "${t.provider}" (model "${s.model}"): ${p}`)}o&&Ee(n.rawText,n.finishReason,n.warnings);const a=Le(n.rawText);if(!a)throw new d(`AI returned an empty description (finishReason=${n.finishReason}). Re-run with --verbose to inspect provider output.`);return a},"generateSingleDescription"),Ne=r(async(e,t,i)=>{if(!b(t).apiKey)throw new d("apiKey is required.");const s=e.length>t.maxDiffChars?`${e.slice(-t.maxDiffChars)}
|
|
15
15
|
|
|
16
|
-
[Diff truncated due to size]`:e,
|
|
17
|
-
`).map(a=>a.trim()).filter(Boolean);return Array.from(new Set(
|
|
16
|
+
[Diff truncated due to size]`:e,n=Se(t.locale,t.maxLength,t.type,i?.currentDescriptions??[]);i?.verbose&&je(t,n,s);const a=await Promise.all(Array.from({length:t.variantCount},()=>Te(s,t,n,i?.verbose)));return[...new Set(a)]},"generateDescription"),P="aidescribe-git-minimal",Ue=["--config",`merge-tools.${P}.program=git`,"--config",`merge-tools.${P}.diff-args=["diff","--no-index","--diff-algorithm=minimal","$left","$right"]`,"--config",`merge-tools.${P}.diff-expected-exit-codes=[0,1]`],Z=r(e=>e.length>0?e.join("|"):"@","getTargetRevsetExpression"),ee=r(e=>{const t=[...e];return e.includes("--no-pager")||t.push("--no-pager"),t},"buildBaseJjArgs"),_e=r(async()=>{if((await D("jj",["root"],{reject:!1})).failed)throw new d("The current directory must be inside a jj repository.")},"assertJjRepo"),Ve=r(async e=>{const t=e?.globalArgs??[],i=e?.revsets??[],o=ee(t);o.push(...Ue,"diff","--tool",P),i.length>0&&o.push("--revisions",Z(i));const{stdout:s}=await D("jj",o);return s.trim()},"getDiff"),ke=r(async e=>{const t=e?.globalArgs??[],i=e?.revsets??[],o=ee(t);o.push("log","--no-graph","--revisions",Z(i),"--template",'description.first_line() ++ "\\n"');const{stdout:s}=await D("jj",o),n=s.split(`
|
|
17
|
+
`).map(a=>a.trim()).filter(Boolean);return Array.from(new Set(n))},"getCurrentDescriptions"),Be=r(async(e,t)=>{await D("jj",["describe","-m",e,...t],{stdio:"inherit"})},"runJjDescribe"),te=r((e,t)=>{if(!e||!e.trim())return`${t} is required`},"validateRequired"),ie=r(e=>typeof e=="string"?e.trim():"","toTrimmedPromptValue"),oe=r(async()=>{const e=await R(),t=await _({message:"Select provider",options:g.map(m=>{const S=A(m);return{value:m,label:S.label,hint:S.defaultModel}})});if(C(t))return $("Cancelled"),!1;const i=t,o=A(i),s=W(e,i),n=!!s.apiKey,a=s.model,c=await ce({message:n?`Enter ${o.label} API key (press enter to keep existing)`:`Enter ${o.label} API key`,validate:r(m=>{if(!(n&&!m?.trim()))return te(m,"API key")},"validate")});if(C(c))return $("Cancelled"),!1;const p=await V({message:"Model",placeholder:o.defaultModel,initialValue:a,validate:r(m=>te(m,"Model"),"validate")});if(C(p))return $("Cancelled"),!1;const u=ie(c),f=ie(p);if(!u&&!n)throw new d("API key is required for first-time provider setup.");if(!f)throw new d("Model is required.");const v=[["provider",i]];return u&&v.push([`providers.${i}.apiKey`,u]),f!==a&&v.push([`providers.${i}.model`,f]),await X(v),j(`Connected ${o.label}. Active model: ${f}`),!0},"runConnectWizard");var Fe=N({name:"connect",description:"Interactive provider setup wizard",help:{description:"Interactive provider setup wizard"}},()=>{U("aidescribe connect"),oe().catch(E)});const ze=r(async e=>{if(e.length<=1)return e[0]??null;const t=await _({message:"Choose a description",options:e.map(i=>({value:i,label:i}))});return C(t)?null:String(t)},"chooseDescription"),Ge=r(async e=>{const t=await V({message:"Edit description",placeholder:e,initialValue:e,validate:r(i=>i&&i.trim().length>0?void 0:"Description cannot be empty","validate")});return C(t)?null:String(t).trim()},"reviewDescription");var qe=r(async(e,t)=>(async()=>{const i=k(),o=e.verbose?k():null,s={provider:e.provider,locale:e.locale,type:e.type,maxLength:e.maxLength,maxDiffChars:e.maxDiffChars,variantCount:e.count};U(he(ge(" aidescribe \u2728 "))),o?.start("Checking repository"),await _e(),o?.stop("Repository detected"),o?.start("Loading configuration");let n=await R({cliConfig:s});if(o?.stop("Configuration loaded"),!b(n).apiKey){if(i.start("No provider configured, launching `aidescribe connect`"),i.stop("No provider configured, launching setup wizard"),!await oe())return;o?.start("Reloading configuration"),n=await R({cliConfig:s}),o?.stop("Configuration reloaded")}if(!b(n).apiKey)throw new d(`apiKey is required for provider "${n.provider}". Set it with \`aidescribe config set providers.${n.provider}.apiKey=...\`.`);const a=De(t);o?.start("Reading `jj diff`");const c=await Ve(a);if(o?.stop("Diff collected"),!c){j("No changes found in `jj diff`. Skipping description update.");return}o?.start("Reading current description");const p=await ke(a);o?.stop(p.length>0?"Current description loaded":"No current description found"),i.start("Generating description");const u=await Ne(c,n,{verbose:e.verbose,currentDescriptions:p});i.stop("Description generated");const f=await ze(u);if(!f){$("Cancelled");return}const v=await Ge(f);if(!v){$("Cancelled");return}const m=v;o?.start("Running `jj describe`"),await Be(m,a.revsets),o?.stop("Description applied"),j("Done")})().catch(E),"aidescribeCommand");const Je=r((e,t)=>{if(!we.includes(e))return String(t);const i=String(t);return i?i.length<=4?`${i}****`:`${i.slice(0,4)}****`:""},"maskValue"),Ye=g.flatMap(e=>[`providers.${e}.apiKey`,`providers.${e}.model`,`providers.${e}.baseURL`]),We=["provider",...Ye,"locale","type","maxLength","maxDiffChars","variantCount"],He=r((e,t)=>e[t],"getConfigValue"),re=r((e,t,i=t)=>{const o=He(e,t);console.log(`${i}=${Je(t,o??"")}`)},"printConfigEntry"),Qe=r((e,t)=>L(e)?e:J(e)?Y(t,e):null,"resolveRequestedKey");var Xe=N({name:"config",description:"View or modify configuration settings",help:{description:"View or modify configuration settings"},parameters:["[mode]","[keyValues...]"]},e=>{(async()=>{const t=Array.isArray(e._)?e._:[],[i,...o]=t,s=typeof i=="string"?i:void 0,n=o.filter(a=>typeof a=="string");if(!s){const a=await R();console.log(`Config file: ${K()}`);for(const c of We)re(a,c);return}if(s==="get"){const a=await R();for(const c of n){const p=Qe(c,a.provider);p&&re(a,p,c)}return}if(s==="set"){const a=n.map(c=>{const p=c.indexOf("=");if(p<0)throw new d(`Invalid key=value pair: ${c}. Use: aidescribe config set key=value`);const u=c.slice(0,p),f=c.slice(p+1);return[u,f]});await X(a);return}throw new d(`Invalid mode: ${s}. Use "get" or "set".`)})().catch(E)}),Ze="0.0.4",et="Generate jj change descriptions with AI",tt={version:Ze,description:et};const{description:it,version:ot}=tt,ne=process.argv.slice(2);ae({name:"aidescribe",version:ot,flags:{provider:{type:String,description:"Override provider for this run (supported: openai, anthropic, mistral)"},locale:{type:String,description:"Override locale for this run (default: en)"},type:{type:String,alias:"t",description:"Message format for this run (default: conventional, supports: conventional, plain)"},maxLength:{type:Number,description:"Max generated title length for this run (default: 72, it's a soft guidance for the model, not a local hard cutoff)"},maxDiffChars:{type:Number,description:"Max diff chars sent to AI for this run (default: 40000)"},count:{type:Number,description:"Generate multiple description variants for this run (default: 1)"},verbose:{type:Boolean,description:"Print the exact prompt payload sent to the AI model for this run",default:!1}},commands:[Xe,Fe],help:{description:it},ignoreArgv:r(e=>e==="unknown-flag"||e==="argument","ignoreArgv")},e=>{qe(e.flags,ne)},ne);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aidescribe",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Generate jj change descriptions with AI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -35,25 +35,29 @@
|
|
|
35
35
|
"fmt": "oxfmt",
|
|
36
36
|
"fmt:check": "oxfmt --check",
|
|
37
37
|
"lint": "oxlint",
|
|
38
|
-
"lint:fix": "oxlint --fix"
|
|
38
|
+
"lint:fix": "oxlint --fix",
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"test:watch": "vitest"
|
|
39
41
|
},
|
|
40
42
|
"dependencies": {
|
|
41
|
-
"@ai-sdk/anthropic": "^3.0.
|
|
42
|
-
"@ai-sdk/
|
|
43
|
-
"@
|
|
44
|
-
"
|
|
45
|
-
"
|
|
43
|
+
"@ai-sdk/anthropic": "^3.0.66",
|
|
44
|
+
"@ai-sdk/mistral": "^3.0.28",
|
|
45
|
+
"@ai-sdk/openai": "^3.0.50",
|
|
46
|
+
"@clack/prompts": "^1.2.0",
|
|
47
|
+
"ai": "^6.0.146",
|
|
48
|
+
"cleye": "^2.3.0",
|
|
46
49
|
"execa": "^9.6.1",
|
|
47
50
|
"zod": "^4.3.6"
|
|
48
51
|
},
|
|
49
52
|
"devDependencies": {
|
|
50
|
-
"@types/node": "^25.
|
|
53
|
+
"@types/node": "^25.5.2",
|
|
51
54
|
"kolorist": "^1.8.0",
|
|
52
55
|
"oxfmt": "^0.35.0",
|
|
53
|
-
"oxlint": "^1.
|
|
54
|
-
"pkgroll": "^2.
|
|
56
|
+
"oxlint": "^1.58.0",
|
|
57
|
+
"pkgroll": "^2.27.0",
|
|
55
58
|
"tsx": "^4.21.0",
|
|
56
|
-
"typescript": "^5.9.3"
|
|
59
|
+
"typescript": "^5.9.3",
|
|
60
|
+
"vitest": "^4.1.2"
|
|
57
61
|
},
|
|
58
62
|
"engines": {
|
|
59
63
|
"node": ">=22"
|