# Roboflow CLI not working when uploading images folder

**URL:** <https://discuss.roboflow.com/t/roboflow-cli-not-working-when-uploading-images-folder/2554>\
**Category:** 🤝  Community Help\
**Tags:** bugs\
**Created:** [July 2, 2023, 9:44pm UTC](https://discuss.roboflow.com/t/roboflow-cli-not-working-when-uploading-images-folder/2554 "2023-07-02T21:44:38Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Arner](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nick_arner/32/1036_2.png) [@Nick\_Arner](https://discuss.roboflow.com/u/Nick_Arner)\
**Post date:** [July 2, 2023, 9:44pm UTC](https://discuss.roboflow.com/t/roboflow-cli-not-working-when-uploading-images-folder/2554/1 "2023-07-02T21:44:38Z")

</div>

I’m trying to use the [Roboflow CLI](https://docs.roboflow.com/api-reference/images/upload-api#cli) to upload a folder of images and an annotation file. I’ve been able to upload the `valid` folder via the web-based UI, but due to the amount of images in the `train` one, I need to use the CLI.

![CleanShot 2023-07-02 at 14.42.16@2x](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/d/dccfdc1984ca614dc270337812c45a02d31e1c72.png)

I keep getting this error:

```auto
(base) nicholasarner@Nicholass-MacBook-Air stitch % cd /Users/nicholasarner/Downloads/Microsoft\ COCO 
(base) nicholasarner@Nicholass-MacBook-Air Microsoft COCO % cd train        
(base) nicholasarner@Nicholass-MacBook-Air train % roboflow upload *.jpg* -a _annotations.coco.json 
zsh: argument list too long: roboflow

```

---

<div class="post-metadata">

**Author:** ![leo](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/leo/32/2228_2.png) [@leo](https://discuss.roboflow.com/u/leo)\
**Post date:** [July 3, 2023, 8:19pm UTC](https://discuss.roboflow.com/t/roboflow-cli-not-working-when-uploading-images-folder/2554/2 "2023-07-03T20:19:20Z")

</div>

Hi Nick,  
Interesting error. How big are the contents of the `train` folder? Have you been able to upload images successfully via the SDK before?

Also, is there a reason for a second `*` after `*.jpg`?

```auto
roboflow upload *.jpg -a “[filename].xml”

```

This is the example code to upload all images and an annotation from [Roboflow Docs](https://docs.roboflow.com/api-reference/images/upload-api)

---

<div class="post-metadata">

**Author:** ![Nick\_Arner](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nick_arner/32/1036_2.png) [@Nick\_Arner](https://discuss.roboflow.com/u/Nick_Arner)\
**Post date:** [July 3, 2023, 11:29pm UTC](https://discuss.roboflow.com/t/roboflow-cli-not-working-when-uploading-images-folder/2554/3 "2023-07-03T23:29:52Z")

</div>

The second \* was a typo

The `train` folder has 116,410 images in it

This is the first time I’ve used the CLI

---

<div class="post-metadata">

**Author:** ![leo](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/leo/32/2228_2.png) [@leo](https://discuss.roboflow.com/u/leo)\
**Post date:** [July 3, 2023, 11:34pm UTC](https://discuss.roboflow.com/t/roboflow-cli-not-working-when-uploading-images-folder/2554/4 "2023-07-03T23:34:11Z")

</div>

Did removing the \* fix the issue or does it still persist?

Would it be possible to move a couple of pictures into a different folder to isolate if the number of images is the issue?

---

<div class="post-metadata">

**Author:** ![Nick\_Arner](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nick_arner/32/1036_2.png) [@Nick\_Arner](https://discuss.roboflow.com/u/Nick_Arner)\
**Post date:** [July 3, 2023, 11:54pm UTC](https://discuss.roboflow.com/t/roboflow-cli-not-working-when-uploading-images-folder/2554/5 "2023-07-03T23:54:54Z")

</div>

Still have the issue

 ![CleanShot 2023-07-03 at 03.41.05@2x](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/8/89604707c2b3e8dfd44751d01ee145638e2bd6b1.png)

---

<div class="post-metadata">

**Author:** ![Nick\_Arner](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nick_arner/32/1036_2.png) [@Nick\_Arner](https://discuss.roboflow.com/u/Nick_Arner)\
**Post date:** [July 3, 2023, 11:55pm UTC](https://discuss.roboflow.com/t/roboflow-cli-not-working-when-uploading-images-folder/2554/6 "2023-07-03T23:55:27Z")

</div>

![CleanShot 2023-07-03 at 03.42.31@2x](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/c/c5ce645619601626fe2436fd1530489743bb1c2c.png)

---

<div class="post-metadata">

**Author:** ![Nick\_Arner](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nick_arner/32/1036_2.png) [@Nick\_Arner](https://discuss.roboflow.com/u/Nick_Arner)\
**Post date:** [July 3, 2023, 11:56pm UTC](https://discuss.roboflow.com/t/roboflow-cli-not-working-when-uploading-images-folder/2554/7 "2023-07-03T23:56:20Z")

</div>

![CleanShot 2023-07-03 at 03.43.02@2x](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/1/1f3d5549c591af026d57a9ec428f367080d3b2a3.png)

---

<div class="post-metadata">

**Author:** ![leo](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/leo/32/2228_2.png) [@leo](https://discuss.roboflow.com/u/leo)\
**Post date:** [July 5, 2023, 7:23pm UTC](https://discuss.roboflow.com/t/roboflow-cli-not-working-when-uploading-images-folder/2554/8 "2023-07-05T19:23:59Z")

</div>

Hi Nick, the issue continued with less pictures?

---

<div class="post-metadata">

**Author:** ![Nick\_Arner](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nick_arner/32/1036_2.png) [@Nick\_Arner](https://discuss.roboflow.com/u/Nick_Arner)\
**Post date:** [July 5, 2023, 7:43pm UTC](https://discuss.roboflow.com/t/roboflow-cli-not-working-when-uploading-images-folder/2554/9 "2023-07-05T19:43:24Z")

</div>

That’s just a portion of of the photos; there’s actually quite a lot (the entirety of the coco dataset training folder)

---

<div class="post-metadata">

**Author:** ![leo](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/leo/32/2228_2.png) [@leo](https://discuss.roboflow.com/u/leo)\
**Post date:** [July 5, 2023, 8:07pm UTC](https://discuss.roboflow.com/t/roboflow-cli-not-working-when-uploading-images-folder/2554/10 "2023-07-05T20:07:06Z")

</div>

Hi,  
Wildcard matching in CLI, as a general concept not specific to Roboflow, just extends the arguments of the command line to include every file that matches the wildcard. ([Source](https://stackoverflow.com/questions/11289551/argument-list-too-long-error-for-rm-cp-mv-commands))

The easiest [solution](https://stackoverflow.com/a/18647755) is most likely to do a loop through all the files. Something like this should work:

```auto
for f in *.jpg; do roboflow upload "$f" -a "_annotations.coco.json"; done

```

---

<div class="post-metadata">

**Author:** ![Nick\_Arner](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nick_arner/32/1036_2.png) [@Nick\_Arner](https://discuss.roboflow.com/u/Nick_Arner)\
**Post date:** [July 5, 2023, 8:26pm UTC](https://discuss.roboflow.com/t/roboflow-cli-not-working-when-uploading-images-folder/2554/11 "2023-07-05T20:26:05Z")

</div>

![CleanShot 2023-07-05 at 13.25.40@2x](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/5/5838809d59e68d5247bdef0e6081c9aaac251f4b.jpeg)

I keep hitting enter when trying to select the project and that happens

---

<div class="post-metadata">

**Author:** ![leo](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/leo/32/2228_2.png) [@leo](https://discuss.roboflow.com/u/leo)\
**Post date:** [July 5, 2023, 9:55pm UTC](https://discuss.roboflow.com/t/roboflow-cli-not-working-when-uploading-images-folder/2554/12 "2023-07-05T21:55:50Z")

</div>

I’m going to try to replicate the issue. Is it the regular COCO dataset? Do you have a Universe link?

---

<div class="post-metadata">

**Author:** ![Nick\_Arner](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nick_arner/32/1036_2.png) [@Nick\_Arner](https://discuss.roboflow.com/u/Nick_Arner)\
**Post date:** [July 5, 2023, 10:11pm UTC](https://discuss.roboflow.com/t/roboflow-cli-not-working-when-uploading-images-folder/2554/13 "2023-07-05T22:11:35Z")

</div>

Ah I can’t find the universe link now (Joseph would know; he was the one who sent it to me)

---

<div class="post-metadata">

**Author:** ![Nick\_Arner](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nick_arner/32/1036_2.png) [@Nick\_Arner](https://discuss.roboflow.com/u/Nick_Arner)\
**Post date:** [July 6, 2023, 2:54pm UTC](https://discuss.roboflow.com/t/roboflow-cli-not-working-when-uploading-images-folder/2554/14 "2023-07-06T14:54:30Z")

</div>

Found it @leo; it’s this one [Microsoft COCO Object Detection Dataset (v10, 2023-03-08 9:49pm) by Microsoft](https://universe.roboflow.com/jacob-solawetz/microsoft-coco/dataset/10)
