API & Integrations
How to use the remove.bg CLI tool
How to use the remove.bg CLI tool

How to use the remove.bg CLI tool

Dive into our blog post, to discover an in-depth step-by-step guide on how to make the most of this tool.

The first step is to download the latest stable release for your platform of choice.

Extract the archive file to your destination folder of choice. If you would like to be able to use the CLI tool from anywhere on your computer, make sure to add the path to your > PATH environment variable.

Execute your first command

Windows

Open the Command Prompt by clicking on the Start Menu, typing cmd, and hitting ENTER.

Mac

Open the terminal by clicking the Launchpad icon, then searching for > terminal.

Linux

Open the terminal in accordance with your Linux distribution.

To execute a command using the CLI tool, you must follow the basic structure:

removebg [options] file...

If you didn’t update your PATH environment variable,  you need to give the full path of the executable:

Windows:

C:\removebg\removebg [options] file...

Mac/Linux:

/path/to/removebg/removebg [options] file...

For the [options] part, each option follows the same structure:

--option value

So, for example, if you didn't add REMOVE_BG_API_KEY to your environment variables, you must always enter the API key as an option:

removebg --api-key your_api_key_here

The file part of the command is where you tell the CLI tool which files you'd like to process.

For a more detailed explanation, read how to remove and replace the background of multiple images using remove.bg's CLI tool.

Was this article helpful? Yes No
Thanks for your feedback.
remove.bg - Remove Background from Image 100% Free! | Product Hunt
  • Learn more

  • Magic Brush
  • Individuals
  • Photographers
  • Marketing
  • Developers
  • Ecommerce
  • Media
  • Car Dealerships
  • Enterprise
  • Success stories
  • Tools & API

  • API Documentation
  • Integrations, tools & apps
  • Photoshop Extension
  • Windows / Mac / Linux
  • Android App
  • Design Templates
  • Support

  • Help & FAQs
  • Contact us
  • Refunds
  • Platform Status
  • Company

  • Blog
  • Affiliate Program
  • Create automatic designs
  • Video Background Removal
  • Careers
  • About us
  • Press

© remove.bg, a Canva Austria GmbH brand

  • Terms of Service
  • General Terms and Conditions
  • Privacy Policy
  • Cookie Policy
  • Imprint

Thanks for your feedback!

Want to help us improve? (optional)

  • Contribute this image & help us make remove.bg better
  • Teach the Artificial Intelligence
  • Get better results for similar images in the future
Choose if you want us to use this image for quality improvements.
Choose if you do NOT want us to use this image for quality improvements.

Your image will be used for future improvements of remove.bg.

Your image will NOT be used for future improvements of remove.bg.