feat(cli): --name <title> for custom session display titles (#99)#202
Merged
Conversation
Adds the missing CLI affordance requested in issue #99. Today the session list shows random animal-themed names ("Garden Scorpion", "Garden Sauropod") which carry no semantic meaning when juggling several projects. Behavior: jcode --name 'review pr 412' run 'review the diff' jcode --session-name 'feature-X' run 'continue feature work' Translates to the JCODE_SESSION_NAME env var in parse_and_prepare_args (alias --session-name on the same flag). Session::create reads the env var and sets it as the new session's `title` ONLY when: - parent_id is None (top-level session, not a subagent/spawn child) - title argument is None (caller hasn't already supplied a title) Existing sessions are unaffected — `jcode session rename <id> <name>` still applies for those. Test `jcode_session_name_env_titles_top_level_session` covers all three branches: top-level pickup, child-no-pickup, explicit-arg-wins. Closes #99
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the missing CLI affordance requested in issue #99. Random animal-themed names work great for whimsy but don't help when juggling several projects.
Usage
Existing sessions are unaffected —
jcode session rename <id> <name>still applies for those.Changes
--name <text>(alias--session-name) global flag.parse_and_prepare_argstranslates the flag into theJCODE_SESSION_NAMEenv var so deep code paths read it without arg threading.Session::createreadsJCODE_SESSION_NAMEONLY whenparent_idisNone(top-level only — subagents/spawned children stay random-named for clarity) ANDtitlearg isNone(explicit title always wins).jcode_session_name_env_titles_top_level_sessioncovers all three branches.Tests
Notes
The issue's secondary request — "default to working-directory basename" — is intentionally NOT bundled here. That changes existing UX (random animal names → directory name) for everyone, and should be opt-in via a config option in a separate PR (recommend
session.name_format = "random" | "directory").