Quick Start with DeepSeek Harness: Mastering the Three Launch Modes
This tutorial walks you through DeepSeek Harness's three launch modes—Web UI, CLI, and API—explaining their purposes, how to start each mode, key features, performance trade‑offs, configuration management, and hands‑on exercises to help you choose the right mode for daily use, development, automation, or integration.
Launch Modes Overview
DeepSeek Harness provides three ways to start the tool, each suited to different scenarios:
Web UI – visual, browser‑based interface; ideal for daily use, visual debugging, and collaboration with non‑technical users.
CLI – pure command‑line interaction; best for rapid testing, remote servers, and script integration.
API – RESTful service exposing HTTP endpoints; the most flexible option for application integration, batch processing, and building an Agent‑as‑a‑Service platform.
Web UI Mode
What it is
The Web UI starts a local web server and opens a browser window. It offers a top bar (model selection, settings, theme), a conversation area showing message bubbles, and a side panel with tools, file browser, and session management.
Starting the UI
# Basic start
dsh web
# Specify a custom port (default 3000)
dsh web --port 8080
# Use a custom configuration file
dsh web --config ~/.dsh/production.jsonKey UI Areas
Top Bar – model selection, settings, theme switch.
Conversation Area – displays chat history as message bubbles.
Input Area – type messages and send.
Side Bar – tool panel, file explorer, session manager.
Tool Panel
Click the 🧰 Tools button to reveal built‑in utilities:
read_file write_file list_dir create_dir
exec run_script fetch_url search_web
code_review write_testsSession Management
Use the 📊 Sessions view to create, search, and organize sessions by day.
CLI Mode
What it is
The CLI provides a text‑based interactive session, useful for developers who need fast testing, remote access, or script integration.
Starting the CLI
# Basic start
dsh chat
# Choose a model
dsh chat --model deepseek-chat
# Quiet mode (less output)
dsh chat --quietBasic Interaction
After the you > prompt, type a message. The assistant replies with formatted output, e.g. file trees or code snippets.
you > 帮我读取当前目录下的所有文件
assistant > 正在读取当前目录的文件:
📁 project
├── README.md
├── package.json
├── src/
│ ├── index.js
│ └── utils.js
└── tests/
└── index.test.js
你想让我对哪个文件进行操作?CLI Shortcuts
/help– show help /exit – quit CLI /clear – clear conversation /model [name] – switch model /mode [name] – switch mode /session – show session info /history – show chat history /save [name] – save session /load [name] – load session
Advanced Usage
File input: dsh chat --file src/index.js or multiple files with dsh chat --file src/*.js.
Pipe input: cat src/index.js | dsh chat --stdin.
Script mode: dsh chat --script questions.txt where questions.txt contains a list of questions.
API Mode
What it is
The API mode launches a RESTful server, exposing HTTP endpoints for programmatic interaction.
Starting the API Service
# Basic start (default port 8080)
dsh api
# Custom port
dsh api --port 9000
# Specify host
dsh api --host 0.0.0.0
# Enable CORS
dsh api --corsHealth Check
curl http://localhost:8080/healthResponse:
{
"status": "ok",
"version": "0.1.0",
"timestamp": "2026-08-15T10:30:00Z"
}Endpoints Overview
POST /api/chat– send a chat request. POST /api/chat/stream – stream responses (Server‑Sent Events). GET /api/sessions – list sessions. GET /api/session/:id – get session details. DELETE /api/session/:id – delete a session. GET /api/tools – list available tools. GET /api/models – list available models.
Sending a Chat Request
curl -X POST http://localhost:8080/api/chat \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "deepseek-chat",
"message": "帮我写一个 Hello World 程序",
"session_id": "optional-session-id"
}'Typical response includes the assistant's reply, any tool calls (e.g., write_file), token usage, and a session ID.
Streaming Responses (SSE)
curl -X POST http://localhost:8080/api/chat/stream \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-chat",
"message": "解释什么是闭包"
}'The server streams JSON chunks with type and content fields.
Authentication
Bearer token: Authorization: Bearer YOUR_API_KEY X‑API‑Key header:
X-API-Key: YOUR_API_KEYMode Comparison
Feature Comparison
Visual Interface – ✅ Web UI, ❌ CLI, ❌ API
Interactive Dialogue – ✅ Web UI, ✅ CLI, ❌ API
Programming Interface – ❌ Web UI, ❌ CLI, ✅ API
Batch Processing – ❌ Web UI, ⚠️ CLI, ✅ API
Team Collaboration – ✅ Web UI, ❌ CLI, ⚠️ API
Automation Scripts – ❌ Web UI, ✅ CLI, ✅ API
Quick Testing – ✅ Web UI, ✅ CLI, ✅ API
Performance Comparison
Startup Speed – Slow (Web UI), Fast (CLI), Medium (API)
Resource Usage – High (Web UI), Low (CLI), Medium (API)
Response Latency – Medium (Web UI), Low (CLI), Low (API)
Concurrency – Low (Web UI), Low (CLI), High (API)
Selection Guide
If you need a visual UI and debugging → Web UI
Else if you need programmatic integration or batch processing → API
Else if you need efficiency or remote operation → CLIConfiguration Management
Configuration File Layout
~/.dsh/
├── config.json # main config
├── config.dev.json # development env
├── config.prod.json # production env
├── plugins/ # plugins directory
├── sessions/ # session data
└── logs/ # logsMain Config Example
{
"api_key": "sk-xxxxxxxxxxxxxxxxxxxxxxxx",
"model": "deepseek-chat",
"base_url": "https://api.deepseek.com",
"temperature": 0.7,
"max_tokens": 4096,
"mode": "standard",
"plugins": [],
"storage": {"type": "file", "path": "~/.dsh/sessions"},
"web": {"port": 3000, "theme": "light"},
"api": {"port": 8080, "cors": true}
}Managing Config via CLI
# List current config
dsh config list
# Set values
dsh config set api_key YOUR_KEY
dsh config set model deepseek-chat
dsh config set temperature 0.5
# Get a single value
dsh config get api_key
# Unset a value
dsh config unset temperature
# Export / Import
dsh config export > my-config.json
dsh config import my-config.jsonMulti‑Environment Config
# Use a specific config file
dsh web --config ~/.dsh/config.dev.json
dsh api --config ~/.dsh/config.prod.json
# Or set environment variable
export DSH_CONFIG_PATH=~/.dsh/config.prod.json
dsh webHands‑On Exercises
Exercise 1 – Code Review with Web UI
Start the UI: dsh web In the chat box type: "帮我审查 src/index.js 文件".
Observe the tool reading the file and returning review suggestions.
Exercise 2 – Rename a File via CLI
Start CLI: dsh chat Enter: "把 old-name.js 重命名为 new-name.js".
Watch the rename_file tool being invoked and verify the rename.
Exercise 3 – Generate Documentation via API
# Start API service
dsh api --port 8080
# Call the API to generate a README
curl -X POST http://localhost:8080/api/chat \
-H "Content-Type: application/json" \
-d '{"message":"为这个项目生成 README.md"}'Chapter Summary
The three launch modes cover visual interaction, fast command‑line workflows, and full programmatic access. Choose the mode that matches your workflow:
Daily use → Web UI
Development & debugging → CLI
Application integration or batch jobs → API
Command Quick Reference
dsh web– start Web UI (default port 3000) dsh web --port 8080 – start Web UI on a custom port dsh chat – start CLI interactive mode dsh chat --model claude – specify model for CLI dsh api – start API service (default port 8080) dsh api --cors – enable CORS on API server dsh config list – show current configuration dsh config set key value – set a configuration item
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
