Using the CLI to validate a config that references a private orb

I’m attempting to cut down on copy/pasta through our multiple repos by using private orbs. I’ve built a simple orb to test things out and verify our workflow and I have one sticking point, a .circleci/config.yml will not validate using circleci config validate when a private orb is referenced. I’ve committed the config.yml and it runs perfectly fine in CircleCI.

When I run the validate, I receive the following error:

➜  test git:(orbify) ✗ circleci config validate
Error: Cannot find xxx/orbtest@0.0.1 in the orb registry. Check that the namespace, orb name and version are correct.
Cannot find xxx/orbtest@0.0.1 in the orb registry. Check that the namespace, orb name and version are correct.
➜  test git:(orbify) ✗ circleci orb list xxx --private
Orbs found: 1. Showing only private orbs.

xxx/orbtest (0.0.1)
➜  test git:(orbify) ✗ circleci version  
0.1.15973+ce8624c (homebrew)

As you can see, the orb is available (sorry for the masked namespace and name). Are there plans to add this functionality into the CLI anytime soon? Having to do a commit and check the CircleCI project is a bit cumbersome and wastes a fair amount of time.

Hi @mwhitney-rbi, and welcome to the CircleCI Discuss community!

This is indeed a limitation when using private orbs. In this case, you can validate your configuration with:

config validate --org-slug <your-org-slug> <path/to/config.yml> 

 
Let me know if this helps.

@yannCI thanks! I knew I was missing something from the documentation. However, even using the org slug, I’m not able to validate and get a permission denied even though I can list the orbs fine.

➜  test git:(orbify) ✗ circleci orb list xxx --private                             
Orbs found: 1. Showing only private orbs.

xxx/orbtest (0.0.1)

➜  test git:(orbify) ✗ circleci config validate --org-slug xxx .circleci/config.yml
Error: Unable to validate config: Permission denied