Skip to main content

Developer-focused DeepSeek command line tools

Project description

DeepSeek CLI

This CLI is open source at https://github.com/PDFSage/deepseek_cli – collaborators and maintainers are welcome! Submit ideas, issues, or pull requests to help the project grow.

https://pypi.org/project/deepseek-agent/

Developer-focused command line tools for working with DeepSeek models. The CLI packages both an interactive chat shell and an agentic coding assistant with repository-aware tooling, plus configuration helpers and transcript logging.

Features

  • Agent mode (deepseek agent) orchestrates tool-aware coding sessions with the DeepSeek API, optional read-only mode, transcripts, and workspace controls.
  • Chat mode (deepseek chat) supports single-response or interactive conversations with streaming output and transcript capture.
  • Config mode (deepseek config) manages stored defaults while respecting environment variable overrides.
  • Ships as a Python package with an executable entry point and Homebrew formula for distribution flexibility.

Requirements

  • Python 3.9 or newer.
  • A DeepSeek API key exported as DEEPSEEK_API_KEY or stored via deepseek config.
  • pip 23+ is recommended. Create a virtual environment for isolated installs.

Installation

From PyPI (recommended once released)

python -m pip install --upgrade pip
python -m pip install deepseek-agent

To update later, run python -m pip install --upgrade deepseek-agent.

From GitHub

Install the latest commit directly from GitHub:

python -m pip install "git+https://github.com/PDFSage/deepseek_cli.git@main"

Specify a tag (for example v0.1.9) to pin a release:

python -m pip install "git+https://github.com/PDFSage/deepseek_cli.git@v0.1.9"

From a local clone

git clone https://github.com/PDFSage/deepseek_cli.git
cd deepseek_cli
python -m venv .venv
source .venv/bin/activate  # On Windows use: .venv\\Scripts\\activate
python -m pip install --upgrade pip
python -m pip install -e .  # or `python -m pip install .` for a standard install

The editable install (-e) keeps the CLI synced with local source changes while developing.

Configuration

The CLI resolves settings in the following order:

  1. Command line flags (--api-key, --base-url, --model, etc.).
  2. Environment variables: DEEPSEEK_API_KEY, DEEPSEEK_BASE_URL, DEEPSEEK_MODEL, DEEPSEEK_SYSTEM_PROMPT.
  3. Stored configuration file at ~/.config/deepseek-cli/config.json.

Helpful commands:

deepseek config init        # Guided prompt to store your API key
deepseek config show        # Display the current configuration (API key redacted)
deepseek config show --raw  # Show the API key in plain text
deepseek config set model deepseek-reasoner  # Update an individual field
deepseek config unset model

If the config directory is unwritable, fall back to environment variables.

Usage

Interactive agent (default)

Running deepseek with no arguments launches the interactive coding agent, similar to Claude Code or the Gemini CLI. The shell waits for the agent to initialise, then prompts for your request. Commands starting with : adjust the session (for example :workspace, :model, :read-only, :transcript, and :help). Exit with :quit or Ctrl+C. Each request can include optional follow-up lines; press Enter on an empty line to run the agent. The assistant also appends an internal instruction to run automated tests and continue iterating until they pass (or a clear justification is recorded). Use :global on if you want the agent to edit files outside the current workspace root (highly privileged; defaults to off). The agent continually revises its plan when new information appears, hunts for regressions introduced by recent changes, and keeps iterating until both tests and bug checks are clean. Tool outputs are automatically truncated to stay within the model's context window—ask for narrower queries or targeted reads if you need more detail.

If no API key is configured, the CLI exits with instructions to create one at https://platform.deepseek.com/api_keys.

Verify installation

deepseek --version
# or use the legacy alias if preferred
deepseek-cli --version

Get help for any subcommand:

deepseek --help

Chat mode

deepseek chat "Summarise the last commit"

deepseek chat --interactive --model deepseek-reasoner \
  --transcript ~/Desktop/session.jsonl
  • --no-stream disables live token streaming.
  • --temperature, --top-p, and --max-tokens mirror the OpenAI Chat Completions API.
  • Provide --transcript to log each exchange to JSONL for later review.

Agent mode

deepseek agent "Refactor the HTTP client" \
  --workspace ~/code/project --max-steps 30 --transcript transcript.jsonl
  • The agent uses repository-aware tools: list directories, read/write files, apply patches, run shell commands, and search text.
  • Pass --global to permit edits outside the workspace root when you need system-wide changes.
  • The agent automatically watches for regressions, replans on the fly, and fixes issues before finishing.
  • Tool outputs are truncated to keep prompts within context limits; refine commands or request additional detail if necessary.
  • Add --follow-up "Also add tests" for additional prompts.
  • Use --read-only to prevent write operations and --quiet to suppress progress logs.

Transcripts and workspaces

  • Relative transcript paths under agent mode are resolved within the selected workspace.
  • Chat transcripts default to ~/.config/deepseek-cli/transcripts/ when a file name (not path) is supplied.

Legacy shim

Running python deepseek_agentic_cli.py prints a compatibility notice and forwards the call to deepseek agent, so existing automation keeps working.

Publishing to PyPI

  1. Update the version in pyproject.toml and commit your changes.
  2. Remove old build artifacts:
    rm -rf build dist *.egg-info
    
  3. Install packaging tooling:
    python -m pip install --upgrade build twine
    
  4. Build the source and wheel distributions:
    python -m build
    
  5. Verify the archives:
    python -m twine check dist/*
    
  6. Upload to TestPyPI (optional but recommended):
    python -m twine upload --repository testpypi dist/*
    
  7. Upload to PyPI:
    python -m twine upload dist/*
    

After publishing, users can install with pip install deepseek-agent.

Development

  • python -m deepseek_cli --version exercises the module entry point.
  • python -m deepseek_cli chat --help shows chat-specific flags.
  • python -m deepseek_cli agent --help lists agent options.
  • Run ruff, pytest, or other tooling as required by your workflow.

Contributions welcome! Open issues or pull requests to extend functionality.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deepseek_agent-0.1.9.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deepseek_agent-0.1.9-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file deepseek_agent-0.1.9.tar.gz.

File metadata

  • Download URL: deepseek_agent-0.1.9.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for deepseek_agent-0.1.9.tar.gz
Algorithm Hash digest
SHA256 8fc678a29bef5d9d54041b88d03078e5cd2dc0cab62f3c525d7a1b70fad8a675
MD5 89898945f5a6a8372e9cc8b192a4a8c6
BLAKE2b-256 44cebaaedaef8a57b197af69ab668890e251a7e511ebdda9308e3453f0b3fc23

See more details on using hashes here.

File details

Details for the file deepseek_agent-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: deepseek_agent-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for deepseek_agent-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 9ee95a56e5d89d87b7e5c738a43e8e77672fb89d29f967860434cf203c8751c4
MD5 2025dea587b9928f3db9218059bc0220
BLAKE2b-256 ddac49114918f7edf9dfd0ec03b380fc6a3443bfc291200f631344c389356e5d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page