Skip to main content

A CLI and API for interacting with Claude

Project description

unoffical claude-cli 0.7.3

Claude CLI REPL


Install

No offical package yet
Python 3.10+
API Documentation

pip install unofficial-claude-cli
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.3.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.3-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: unofficial_claude_cli-0.7.3.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.3.tar.gz
Algorithm Hash digest
SHA256 2a82e8e41d57a43e694cff13dc8b7f0bcd9e208059b9bd2ec349b03f3579fbc9
MD5 89c36f268611f57f44e1964cec279bd8
BLAKE2b-256 fb8a9b462ace0b805a5f8ae56a44fdd47be477299adb0952ba28cffdcfb578ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for unofficial_claude_cli-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c327daa291c038b9d8145b7072ff501baa4e10b35eb69eae820a37bf483c3ffb
MD5 2e01f1d67f472ec8bf180965ea0d552c
BLAKE2b-256 c0e4de7ff39ca6e4649ea932a44295165bb7f8501380b4995a5fab69516bf64a

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