In the plugin ecosystem of DeepSeek Harness (DSH), developers often need quick AI assistance in the terminal. Compared with launching a TUI or switching to a Web interface, asking directly in the command line is often more efficient. dsh-ask is designed to solve this pain point.
It is a lightweight DSH bundle. It does not launch a graphical or TUI interface; instead, it submits a question directly in the current directory, streams the answer to the terminal, and then exits.
Core Features¶
dsh-ask mainly provides the following capabilities:
- Direct terminal Q&A: Ask questions directly in the current directory, with streaming output support.
- Persistent sessions: Consecutive questions in the same terminal and directory resume the same session; a different directory or a new terminal starts a new session.
- Streaming output and status display: Shows thinking progress and tool-call status in real time, while answer content is output only to stdout.
- Shell integration: Supports Fish, Bash, Zsh, and experimental PowerShell.
- Highly configurable: Supports configuring Provider, Model, Effort, language, and output style.
- Chinese and English support: Chinese by default, switchable via command line.
Installation and Activation¶
Use DSH’s plugin command to install the bundle:
dsh plugin --profile ask add <你的包名或 git spec>
After installation, you must manually initialize and activate Shell integration. The installer does not automatically modify your shell configuration files (such as .bashrc or .zshrc).
Fish
dsh plugin --profile ask exec dsh-ask init fish
source ~/.config/fish/conf.d/zz-dsh-ask.fish
Bash
dsh plugin --profile ask exec dsh-ask init bash
source "${XDG_CONFIG_HOME:-$HOME/.config}/dsh-ask/bash-command-not-found.bash"
# 如需持久启用,请在 ~/.bashrc 中加入上述 source 命令
Zsh
dsh plugin --profile ask exec dsh-ask init zsh
source "${XDG_CONFIG_HOME:-$HOME/.config}/dsh-ask/zsh-command-not-found.zsh"
# 如需持久启用,请在 ~/.zshrc 中加入上述 source 命令
PowerShell (experimental)
dsh plugin --profile ask exec dsh-ask init powershell
. "$HOME/.config/dsh-ask/powershell-command-not-found.ps1"
# 如需持久启用,请将上述命令加入 $PROFILE
Typical Usage¶
Basic Question¶
Enter the question directly in the command line:
dsh --profile ask "这个函数做什么?"
Configuration and Selection¶
dsh-ask provides parameters to specify or save default settings. These parameters only modify default values for the ask profile and do not affect global DSH settings.
List all registered providers and their supported effort settings:
dsh --profile ask --provider
Specify a provider and ask immediately:
dsh --profile ask --provider=deepseek --model=deepseek-chat "快速解释这段代码"
Save settings only (without starting a chat):
dsh --profile ask --provider=deepseek
dsh --profile ask --model=deepseek-chat
dsh --profile ask --effort=high
Advanced Operations¶
Use a reasoning model and specify the effort:
dsh --profile ask -m deepseek-reasoner -e high "审查这个设计"
Manage sessions:
# 创建新的独立会话
dsh --profile ask --new "调查一个无关问题"
# 恢复指定 ID 的会话
dsh --profile ask --session refactor-auth "继续重构"
Style and Language¶
Set the output style (for example, plain text only):
# 使用环境变量
export DSH_ASK_STYLE=plain
# 或在 profile 的 cordis.patch.yml 中覆盖
Switch language:
dsh --profile ask --lang=en "Explain this code"
Use Cases and Notes¶
- Session logic: The default session is determined by the current absolute directory and the current parent shell. Therefore, consecutive questions in the same terminal and directory resume the context; however, if the directory is different or a new terminal is opened, it is treated as a new session. To browse or restore old sessions, use the Web interface.
- Streaming output: Status information such as the thinking process and tool calls is output to stderr, while plain-text answers are output to stdout. This ensures that when output is redirected to a file, only the answer content is included.
- Configuration location: The default configuration for
dsh-askis saved in$DSH_HOME/ask/config.json(usually~/.dsh/ask/config.json). - Shell integration: The Bash and Zsh installers do not automatically modify configuration files; the generated scripts must be sourced manually. PowerShell integration is currently experimental and should be verified in the host environments you use.
dsh-ask provides DeepSeek Harness users with direct, streaming, and persistent Q&A from the terminal. It suits developers who frequently interact with AI in a command-line environment.
For more details and source code, visit: GitHub Repository