Skip to main content

Claude CLI

A command-line interface for interacting with Claude AI.

Features

  • Interactive chat with Claude AI in your terminal
  • Send one-off queries without entering an interactive session
  • Manage your conversations (list, delete, rename)
  • Support for file attachments
  • Rich text formatting (markdown)
  • Configuration management

Installation

From PyPI

pip install claudeshell

From Source

git clone https://github.com/soheilsh7/claude-cli.git
cd claude-cli
pip install -e .

Setup

Before using Claude CLI, you need to configure your Claude cookie:

claude config

This will prompt you to enter your Claude cookie. Alternatively, you can set the CLAUDE_COOKIE environment variable.

Getting Your Claude Cookie

  1. Go to claude.ai and log in
  2. Open your browser's developer tools (F12 or right-click > Inspect)
  3. Go to the Network tab
  4. Refresh the page
  5. Click on any request to claude.ai
  6. In the Headers tab, find the Cookie header
  7. Copy the entire cookie value

Visit here for more description on how to get your session key.

Usage

Interactive Chat

Start a new chat conversation:

claude chat --new

Continue an existing conversation:

claude chat --id <conversation_id>

One-off Queries

Send a single query and get a response:

claude query "What is the capital of France?"

With attachment:

claude query "Summarize this document" --attachment path/to/file.pdf

Managing Conversations

List all conversations:

claude list

Delete a conversation:

claude delete <conversation_id>

Rename a conversation:

claude rename <conversation_id> "New Title"

Commands Reference

  • claude chat: Start an interactive chat session
  • claude query: Send a one-off query
  • claude list: List all conversations
  • claude delete: Delete a conversation
  • claude rename: Rename a conversation
  • claude config: Configure settings

Using Claude Terminal with a Proxy

Claude Terminal now includes built-in proxy support, so you don't need to use external tools like proxychains. Here's how to use it:

Setting a Default Proxy

You can configure a default proxy that will be used for all commands:

claude config --proxy socks5://127.0.0.1:2080

This saves the proxy in your config file (~/.config/claude-terminal/config.yaml).

To remove the default proxy:

claude config --proxy ""

Using a One-Time Proxy

You can also specify a proxy for a single command:

claude chat --proxy socks5://127.0.0.1:2080
claude query "Hello" --proxy socks5://127.0.0.1:2080
claude list --proxy socks5://127.0.0.1:2080

The --proxy parameter takes precedence over any default proxy configured.

Supported Proxy Formats

  • SOCKS5: socks5://127.0.0.1:1080
  • SOCKS4: socks4://127.0.0.1:1080
  • HTTP: http://127.0.0.1:8080
  • HTTPS: https://127.0.0.1:8080

Authentication

If your proxy requires authentication, include username and password:

socks5://username:password@127.0.0.1:1080

Troubleshooting

If you encounter issues with the proxy:

  1. Verify your proxy is running correctly
  2. Check that the proxy URL format is correct
  3. Ensure your proxy allows connections to claude.ai
  4. Try with verbose output: claude chat --proxy your_proxy_url --verbose

Security Note

Proxy settings are stored in plain text in your config file. If this is a concern, use the command-line --proxy parameter instead of the saved configuration.

Dependencies

  • claude-api: Unofficial Claude API
  • click: Command-line interface creation
  • rich: Terminal text formatting and display
  • pyyaml: Configuration file handling

License

MIT

Disclaimer

This project provides an unofficial client for Claude AI and is not affiliated with or endorsed by Anthropic. Use it at your own risk.

Metadata

Release files for claudeshell 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for claudeshell 0.2.0
File Size Uploaded
claudeshell-0.2.0.tar.gz 16.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for claudeshell 0.2.0
File Interpreter ABI Platform
claudeshell-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.7 kB

Release files / claudeshell-0.2.0.tar.gz

Download URL claudeshell-0.2.0.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a7f3d22234533f57b4502beb9602f814d1a2ea8793b59a223afaa7cd6236181a
BLAKE2b-256 checksum
How to use checksums
03c4ce42d6d262380f4b309814277d2a224387d62d31afc07742320b4d1b89c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / claudeshell-0.2.0-py3-none-any.whl

Download URL claudeshell-0.2.0-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
efffbc35c86017a495e460cf3d0f421375dce72e5ad4ebff1ca48b88524bb916
BLAKE2b-256 checksum
How to use checksums
e5df41b2f5c8bf3eedd3b83230b71cbe34493f5449ec6deb56776d7247d3cda7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page