-
Terminal Interface
- Access DeepSeek Chat directly from your terminal
- Streamed output with live typing effect
- Scriptable: accepts piped input or
--prompt
- Lightweight: no GUI or browser dependency
- Requires no account login (uses your own token)
- Optional: save responses to file
-
API Mode
- Expose DeepSeek completions via a local HTTP API
- Built with Express.js and supports both streaming and non-streaming responses
- Easily integrate with web frontends, bots, or automation tools
- Customizable and self-hosted on any local or remote environment
- Node.js v18+
- DeepSeek Access Token (see below)
To use DeepTerm, you need to extract your access token manually from the browser:
- Go to https://chat.deepseek.com
- Open DevTools (F12) → Network tab
- Look for requests to
/api/v0/users/current
or any chat endpoints - Copy the
Authorization
header value (starts withBearer ey...
) - Export it in your shell:
export DEEPSEEK_TOKEN="eyJ..."
Or
DEEPSEEK_TOKEN="eyJ..." deepterm
Start interactive session:
deepterm
One-shot prompt:
deepterm -p "What is quantum computing?"
Pipe input:
echo "summarize the movie Inception" | deepterm
Save response to a file:
deepterm -p "Write a haiku about Linux" -o output.txt
Usage: deepterm [options]
Options:
-p, --prompt "<text>" Send one-shot prompt via CLI
-i, --interactive Start an interactive session
-o, --output <file> Save the response to a file
-h, --help Show help message
DeepTerm also provides an optional HTTP API built with Express, allowing programmatic access to DeepSeek completions.
Install the dependencies (if not already installed):
npm install
Start the API server:
npm run start
To run on a custom port:
PORT=8080 npm run start
By default, the server listens on port 3000
.
- Method:
POST
- Content-Type:
application/json
Field | Type | Required | Description |
---|---|---|---|
token |
string |
Yes | DeepSeek Authorization token (e.g., starts with Bearer ey... ) |
prompt |
string |
Yes | The prompt or question to send to DeepSeek |
sessid |
string |
No | (Optional) Existing chat session ID. A new session will be created if not provided |
stream |
boolean |
No | Whether to use streaming response (SSE). Defaults to true . |
curl -N -X POST http://localhost:3000/completion \
-H "Content-Type: application/json" \
-d '{
"token": "Bearer eyJ...your_token...",
"prompt": "Explain general relativity in simple terms",
"stream": true
}'
This will return a text/event-stream
streaming response.
curl -X POST http://localhost:3000/completion \
-H "Content-Type: application/json" \
-d '{
"token": "Bearer eyJ...your_token...",
"prompt": "What is quantum entanglement?",
"stream": false
}'
{
"result": "Quantum entanglement is a physical phenomenon..."
}
- The session ID (
sessid
) is optional. If not provided, the server will automatically create a new chat session. - The
stream
flag is recommended for interactive applications or web frontends. - This API is intended for personal, development, or proxy use — not for large-scale automation.
-
Rate Limiting and Access Restrictions: DeepSeek may implement rate limiting or temporary restrictions if the service detects excessive or automated usage. Users are advised to interact with the service responsibly and avoid high-frequency automated requests.
-
Manual Token Provisioning: The application requires a valid DeepSeek access token to function. This token must be manually retrieved from browser network requests. At this time, no built-in authentication or login mechanism is provided.
-
Dependency on Web Frontend Structure: DeepTerm relies on reverse-engineered behavior from DeepSeek’s web frontend. Any changes to endpoint URLs, request structures, or authentication flows may result in tool failure until the implementation is updated accordingly.
-
Text-Only Interface: The tool is designed for terminal-based interaction and only supports plain text responses. It does not render or interpret rich content formats such as markdown, HTML, embedded media, or syntax highlighting.
-
Limited Session Context Management: Unless operating in interactive mode or with manual session tracking, each prompt is treated independently. Contextual continuity between prompts may be limited unless explicitly managed by the user.
-
Requires Internet Connectivity: DeepTerm is not designed for offline use. A stable internet connection is required to communicate with DeepSeek servers and process user prompts.
-
Unofficial and Unsupported: DeepTerm is an independent project and is not affiliated with or endorsed by DeepSeek. Use of the tool is at the user's own risk, and compatibility with DeepSeek services is not guaranteed.
Contributions are welcome! DeepTerm is a community-driven project, and we’re excited to see it grow with your ideas and improvements.
Here are a few enhancements you might consider implementing:
-
File Upload Support
Enable users to upload files and extract content to feed into prompts (e.g., for summarizing documents or parsing code). -
Session Management UI
Add richer command-line controls or a web UI for managing sessions, renaming chats, or deleting old history. -
Markdown & Code Rendering
Improve the CLI experience by detecting and formatting markdown, tables, and code blocks. -
Multi-language Support
Internationalize prompts and interface messages to support multiple languages.
Or other contributions..
- Fork the repository
- Create a new feature branch
- Make your changes and test locally
- Submit a pull request with a clear description of your changes
Before contributing, please ensure your code follows project structure and is well-documented.
Feel free to open an issue or discussion if you’re unsure how to get started, have feature ideas, or want to collaborate on larger tasks. Let’s build something awesome together.
Made with ❤️ by @karjok
This project is licensed under the MIT License.
You are free to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, provided that the original copyright notice and this permission notice are included in all copies or substantial portions.