Usage

clipocr-rs provides the following commands:

  • clipocr-rs general: performs general OCR on the image in the clipboard
  • clipocr-rs accurate: performs accurate OCR on the image in the clipboard
  • clipocr-rs latex: recognize laetx
  • clipocr-rs generate-config: generates a configuration file for setting up the Baidu OCR API credentials

Before using clipocr-rs, you need to set up the configuration file with your Baidu OCR API credentials. Run the following command to generate the configuration file:

clipocr-rs generate-config

You will be prompted to enter your Baidu OCR API appid, apikey, and secret key. The configuration file will be saved in the ~/.config/clipocr-rs/config.yaml directory.

To perform OCR on an image in the clipboard, simply run one of the OCR commands:

clipocr-rs general

clipocr-rs will automatically detect the image in the clipboard, perform OCR using the specified mode, and copy the recognized text back to the clipboard. You can then paste the text into any application.

Configuration

The configuration file (~/.config/clipocr-rs/config.yaml) contains the following settings:

  • appid: Your Baidu OCR API application ID
  • apikey: Your Baidu OCR API key
  • secret_key: Your Baidu OCR API secret key

Make sure to keep your API credentials secure and do not share them with others.

Note

Don't use this library as an complete api client, I have not implemented all the return values from api.

Readme generated by claude, revised by me.