Skip to main content

A CLI and API for interacting with Claude

Project description

unoffical claude-cli 0.7.1

Claude CLI REPL


Install

No offical package yet
Python 3.10+
API Documentation

# Clone the repository
git clone https://github.com/TheTank10/claude-cli
cd claude-cli

# Install with pip
pip install -e .

# Verify installation
claude test

Usage

Account Management

Add your first account:

claude add-account

You'll be prompted for:

  • Account name (anything you want)
  • Claude cookies (paste from browser)

List all accounts:

claude accounts

Shows all saved accounts with -> indicating the active one.

Switch between accounts:

claude switch-account

Update expired cookies:

claude update-account

Remove an account:

claude remove-account

Getting Your Cookies

  1. Log into claude.ai in your browser
  2. Open Developer Tools (F12)
  3. Click on network
  4. Refresh the page and click on a fetch request such as "count_all"
  5. Check the request headers and copy Cookies

Chatting with Claude

List conversations:

claude conversations

Allows you to switch to previous conversations you've had with claude.

Create new conversation:

claude new # Claude chooses a name for this conversation
claude new --name "My Project" 

Send a message:

claude chat prompt # Streams to output with markdown using the rich library
claude chat "prompt" --raw # Streams to output without markdown 
claude chat "prompt" > response.md # Streams response to a file

# Sending attachments/files
claude chat "explain @main.py" 
claude chat "explain @src/cli/chat.py and @src/__init__.py"
claude chat "explain @c:\Users\User\OneDrive\Desktop\code\claude-cli\src\cli\chat.py"

** REPL mode:**

# Works just like claude chat except its interactive
claude repl
claude repl --raw

Note: To make uploading files easier add @ then drag and drop the file into your terminal.
Most terminals will support this.

Configure settings:

claude settings

Toggle web search, extended thinking, and artifacts.

Rename conversation:

claude name # Shows the name of the conversation
claude name New Name

Sync conversation:

claude sync

Updates local state with latest messages from web.
⚠️ Important: If you talk to claude on your browser and come back later to the cli and don't sync the conversations it will remove the history up to the last chat claude sent through the cli

Delete current conversation:

claude delete

Get chat history:

claude history # Last 30 messages with rich markdowns
claude history 5 # Last x messages 
claude history --raw # No rich markdowns
claude history > output.md # Redirect to file

Search current conversation:

claude search query # Shows interactively
claude search "query" > results.txt # Redirects all results to a file
claude search "query" -o folder # Creates a folder with text files representing results

Currently this tool only searches for text found in: text, files, coding artifacts
should probably make it search more things later on

Export conversation/s:

claude export # Interactive
claude export this/all/choose js/md directory_name # Dont enter dir name with 'this'

claude --help for a list of commands


TODO

High Priority

  • Add conversation history viewer
  • Support file uploads (Some file types might not work. Some need to be passed through the convert_document endpoint which is not yet implemented.)
  • Add conversation search/filter
  • Export conversations to markdown/json
  • Python API
  • REPL mode

Mid Priority

  • Styles
  • Automatic session gathering maybe with a web driver?
  • Clearing chat history
  • Incognito mode
  • Batch operations (clear all, delete all)

Low priorty

  • claude retry
  • Show when claude is thinking/seraching/coding
  • Prompt input redirection

This tool is completely unofficial and has no affilation to anthropic
All contributions are welcome

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

unofficial_claude_cli-0.7.1.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

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

unofficial_claude_cli-0.7.1-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file unofficial_claude_cli-0.7.1.tar.gz.

File metadata

  • Download URL: unofficial_claude_cli-0.7.1.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for unofficial_claude_cli-0.7.1.tar.gz
Algorithm Hash digest
SHA256 e55d0c7dec596c7b2fc90280029685ec3dd54a19d96f37f8531586f587668428
MD5 59ec0ceaa70706b5b1ea89fc8a344a5d
BLAKE2b-256 715bd3e1e427c939fdec58be917affbf7a39d7c7254142c291763c39f92ee5f4

See more details on using hashes here.

File details

Details for the file unofficial_claude_cli-0.7.1-py3-none-any.whl.

File metadata

File hashes

Hashes for unofficial_claude_cli-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 01b454b3d331763d7930eb7c87c27bfd82c42b3898d4ae074c4091a27bf38a1b
MD5 afc5ae4d6b8c7bac8bfa5550e343e607
BLAKE2b-256 438f941aa076b5881e697ee33e18c794ad59f68a92215c6bdaa5b842472c3e51

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