A command-line interface for Claude AI
Project description
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
- Go to claude.ai and log in
- Open your browser's developer tools (F12 or right-click > Inspect)
- Go to the Network tab
- Refresh the page
- Click on any request to claude.ai
- In the Headers tab, find the Cookie header
- 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 sessionclaude query: Send a one-off queryclaude list: List all conversationsclaude delete: Delete a conversationclaude rename: Rename a conversationclaude 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:
- Verify your proxy is running correctly
- Check that the proxy URL format is correct
- Ensure your proxy allows connections to claude.ai
- 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claudeshell-0.2.0.tar.gz.
File metadata
- Download URL: claudeshell-0.2.0.tar.gz
- Upload date:
- Size: 16.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7f3d22234533f57b4502beb9602f814d1a2ea8793b59a223afaa7cd6236181a
|
|
| MD5 |
0fc627a6b6d5c80522bd573e558c388b
|
|
| BLAKE2b-256 |
03c4ce42d6d262380f4b309814277d2a224387d62d31afc07742320b4d1b89c6
|
File details
Details for the file claudeshell-0.2.0-py3-none-any.whl.
File metadata
- Download URL: claudeshell-0.2.0-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efffbc35c86017a495e460cf3d0f421375dce72e5ad4ebff1ca48b88524bb916
|
|
| MD5 |
3e1bf5e9f89a154fba4e9e17535377f7
|
|
| BLAKE2b-256 |
e5df41b2f5c8bf3eedd3b83230b71cbe34493f5449ec6deb56776d7247d3cda7
|