Skip to content

armgit / Ix

Public Imported from GitHub
0

Understand any codebase instantly. System intelligence for codebases, built for humans and AI.

feat: add short-ID prefix resolution for entity and history commands

riley0227fe27b79a4ee1
diff --git a/ix-cli/src/cli/commands/entity.ts b/ix-cli/src/cli/commands/entity.ts
index 6fd48e81..3ae8fd0a 100644
--- a/ix-cli/src/cli/commands/entity.ts
+++ b/ix-cli/src/cli/commands/entity.ts
@@ -9,7 +9,8 @@ export function registerEntityCommand(program: Command): void {
.option("--format <fmt>", "Output format (text|json)", "text")
.action(async (id: string, opts: { format: string }) => {
const client = new IxClient(getEndpoint());
- const result = await client.entity(id);
+ const resolvedId = await client.resolvePrefix(id);
+ const result = await client.entity(resolvedId);
if (opts.format === "json") {
console.log(JSON.stringify(result, null, 2));
} else {
diff --git a/ix-cli/src/cli/commands/history.ts b/ix-cli/src/cli/commands/history.ts
index c336b794..5a2c5961 100644
--- a/ix-cli/src/cli/commands/history.ts
+++ b/ix-cli/src/cli/commands/history.ts
@@ -9,7 +9,8 @@ export function registerHistoryCommand(program: Command): void {
.option("--format <fmt>", "Output format (text|json)", "text")
.action(async (entityId: string, opts: { format: string }) => {
const client = new IxClient(getEndpoint());
- const result = await client.provenance(entityId);
+ const resolvedId = await client.resolvePrefix(entityId);
+ const result = await client.provenance(resolvedId);
if (opts.format === "json") {
console.log(JSON.stringify(result, null, 2));
} else {