Code Monkey home page Code Monkey logo

claude's Introduction

Claude CLI

License

A command-line interface for interacting with Anthropic's Claude Opus AI model.

Installation

  1. Clone the repository or download the claude script.
wget -O ./claude https://raw.githubusercontent.com/paralin/claude/master/claude
  1. Make the script executable:
chmod +x claude
  1. (optional) Move the script to a directory in your PATH, e.g.:
cp claude ~/.local/bin/

Usage

Set your Anthropic API key as an environment variable:

export ANTHROPIC_API_KEY=your_api_key_here

To use the CLI, simply run the claude command followed by your input text:

./claude
Rewrite this program correctly: <code>stdos.stdout.logthis("hello world")</code>

Then press ctrl+d to end the input.

You can also pipe input to the script:

echo "Hello, how are you?" | claude

Or a file:

cat prompt.txt | claude

If you're feeling brave:

echo "Show me what is in my home directory." | claude bash | bash

Templates

The script supports predefined templates. To use a template, pass its name as the first argument:

claude spanish "Hello, how are you?"

Available templates:

  • spanish: Translates the input text to Spanish (basic example).
  • bash: Output an executable bash script from the input.

Acknowledgements

  • Anthropic for creating the Claude AI model.
  • litellm for the Python library to interact with the Anthropic API.

License

MIT

claude's People

Contributors

paralin avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.