@brainjar/cli 0.6.2 → 0.6.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainjar/cli",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "Shape how your AI thinks — composable soul, persona, and rules for AI agents",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -167,7 +167,7 @@ export const persona = Cli.create('persona', {
167
167
  options: z.object({
168
168
  project: z.boolean().default(false).describe('Show project persona override (if any)'),
169
169
  short: z.boolean().default(false).describe('Print only the active persona name'),
170
- version: z.number().optional().describe('Show a specific version from history'),
170
+ rev: z.number().optional().describe('Show a specific version from history'),
171
171
  }),
172
172
  async run(c) {
173
173
  const api = await getApi()
@@ -178,11 +178,11 @@ export const persona = Cli.create('persona', {
178
178
  return state.persona ?? 'none'
179
179
  }
180
180
 
181
- if (c.options.version) {
181
+ if (c.options.rev) {
182
182
  const name = c.args.name
183
- if (!name) throw createError(ErrorCode.MISSING_ARG, { message: 'Name is required when using --version' })
183
+ if (!name) throw createError(ErrorCode.MISSING_ARG, { message: 'Name is required when using --rev' })
184
184
  const slug = normalizeSlug(name, 'persona name')
185
- const v = await api.get<ApiContentVersion>(`/api/v1/personas/${slug}/versions/${c.options.version}`)
185
+ const v = await api.get<ApiContentVersion>(`/api/v1/personas/${slug}/versions/${c.options.rev}`)
186
186
  return { name: slug, version: v.version, content: v.content, metadata: v.metadata, created_at: v.created_at }
187
187
  }
188
188
 
@@ -146,14 +146,14 @@ export const rules = Cli.create('rules', {
146
146
  name: z.string().describe('Rule name to show'),
147
147
  }),
148
148
  options: z.object({
149
- version: z.number().optional().describe('Show a specific version from history'),
149
+ rev: z.number().optional().describe('Show a specific version from history'),
150
150
  }),
151
151
  async run(c) {
152
152
  const name = normalizeSlug(c.args.name, 'rule name')
153
153
  const api = await getApi()
154
154
 
155
- if (c.options.version) {
156
- const v = await api.get<ApiContentVersion>(`/api/v1/rules/${name}/versions/${c.options.version}`)
155
+ if (c.options.rev) {
156
+ const v = await api.get<ApiContentVersion>(`/api/v1/rules/${name}/versions/${c.options.rev}`)
157
157
  const entries = (v.metadata as { entries?: Array<{ sort_key: number; content: string }> })?.entries ?? []
158
158
  const content = entries.map(e => e.content.trim()).join('\n\n')
159
159
  return { name, version: v.version, content, created_at: v.created_at }
@@ -133,7 +133,7 @@ export const soul = Cli.create('soul', {
133
133
  options: z.object({
134
134
  project: z.boolean().default(false).describe('Show project soul override (if any)'),
135
135
  short: z.boolean().default(false).describe('Print only the active soul name'),
136
- version: z.number().optional().describe('Show a specific version from history'),
136
+ rev: z.number().optional().describe('Show a specific version from history'),
137
137
  }),
138
138
  async run(c) {
139
139
  const api = await getApi()
@@ -144,11 +144,11 @@ export const soul = Cli.create('soul', {
144
144
  return state.soul ?? 'none'
145
145
  }
146
146
 
147
- if (c.options.version) {
147
+ if (c.options.rev) {
148
148
  const name = c.args.name
149
- if (!name) throw createError(ErrorCode.MISSING_ARG, { message: 'Name is required when using --version' })
149
+ if (!name) throw createError(ErrorCode.MISSING_ARG, { message: 'Name is required when using --rev' })
150
150
  const slug = normalizeSlug(name, 'soul name')
151
- const v = await api.get<ApiContentVersion>(`/api/v1/souls/${slug}/versions/${c.options.version}`)
151
+ const v = await api.get<ApiContentVersion>(`/api/v1/souls/${slug}/versions/${c.options.rev}`)
152
152
  return { name: slug, version: v.version, content: v.content, created_at: v.created_at }
153
153
  }
154
154