How to fetch updates for Firebase project using CLI tools?

2k Views Asked by At

I've set up Firebase command line tools. I've uploaded my files to Firebase Hosting. All is okay.

After this I changed Database rules via console in browser.

The question is: how to fetch (download) Firebase's files from server to my local directory?

I can't find such command neither on Github nor on Reference nor on this guide.

2

There are 2 best solutions below

2
On BEST ANSWER

This currently isn't possible, though I'll make note of this as a feature request.

In general, if you're using the CLI to deploy database rules we encourage you to always use the CLI to update the rules (or immediately copy and paste the newly-updated rules to your local copy). Since rules deployed by the CLI are often stored in version control systems, this is often the best way to make sure that a project with multiple contributors doesn't accidentally trample each other's rules.

1
On

I don't know which version this became available. But you can now manage rules via REST and the firebase cli

See these docs https://firebase.google.com/docs/database/rest/app-management

From REST

  • curl 'https://docs-examples.firebaseio.com/.settings/rules.json?auth=FIREBASE_SECRET'

From Firebase CLI

  • firebase database:get /.settings/rules