Skip to content

stories create --json outputs null and non-json shows 'Story created: undefined' #665

@nikrich

Description

@nikrich

Bug

`hive stories create` displays the wrong story ID and `--json` mode outputs `null`:

$ hive stories create -t "Test" -d "Testing"
Story created: undefined
  Title: Test

$ hive stories create -t "Test" -d "Testing" --json
null

Root Cause

This is a downstream effect of the `storyId` vs `id` field mismatch in #652.

After `createStory()` returns, the code uses `story.id` in two places:

  1. Line 98: `client.getStory(story.id)` → `getStory(undefined)` → returns `null` → outputs `null`
  2. Line 102: `Story created: ${story.id}` → displays `Story created: undefined`

The story is successfully created, but the user gets no usable ID back, making it impossible to reference the story in subsequent commands.

Fix

Use `story.storyId || story.id` or normalize the `createStory()` response to always include `id`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions