Skip to content

feat: add ask history --global command#5

Closed
insign wants to merge 1 commit intomainfrom
feat-global-history-8655789474397182841
Closed

feat: add ask history --global command#5
insign wants to merge 1 commit intomainfrom
feat-global-history-8655789474397182841

Conversation

@insign
Copy link
Contributor

@insign insign commented Feb 15, 2026

Implemented the ask history --global command as requested in the roadmap. This feature allows users to list all stored conversation contexts, sorted by last used time.

Key changes:

  • src/cli/parser.rs: Added support for history subcommand and --global flag.
  • src/context/manager.rs: Added logic to list and display all contexts from storage.
  • src/cli/mod.rs: Integrated the new command into the CLI execution flow.

Verification:

  • Verified manually by creating dummy context files and running ask history --global.
  • Verified that existing ask -c history functionality is preserved.
  • Ran all tests via make precommit.

PR created automatically by Jules for task 8655789474397182841 started by @insign

- Added `global` field to `Args` struct in `src/cli/parser.rs`
- Implemented `history` subcommand and `--global` flag parsing
- Added `show_global_history` method to `ContextManager` in `src/context/manager.rs`
- Updated `src/cli/mod.rs` to handle global history display

This allows users to view conversation history across all directories using `ask history --global`.
Local history can be viewed using `ask history` or `ask -c history`.
@google-labs-jules
Copy link

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd9d24e6e2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// Subcommands
"init" | "config" if query_parts.is_empty() => result.init = true,
"profiles" if query_parts.is_empty() => result.list_profiles = true,
"history" if query_parts.is_empty() => result.show_history = true,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat history as subcommand only when no query follows

This branch marks history as a command whenever it is the first non-flag token, even if additional words follow, so inputs like ask history of linux (or ask -c history of linux) set show_history and bypass normal query execution. That introduces a keyword collision with regular prompts and silently drops user intent for queries that begin with “history.”

Useful? React with 👍 / 👎.

}

// Handle history commands (global or local)
if args.show_history {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve --clear behavior when --history is also set

Handling show_history before context commands causes ask -c --clear --history to return early from the history path, so manager.clear_current() is never reached and the clear flag is silently ignored. This is a regression from the previous ordering where --clear took precedence, and it can leave stale context in place when users explicitly request clearing it.

Useful? React with 👍 / 👎.

@insign insign closed this Feb 16, 2026
@insign insign deleted the feat-global-history-8655789474397182841 branch February 16, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant