Anvil CLI commands
The Anvil CLI is currently in beta while we continue to make improvements.
Here you can find a list of the most useful Anvil CLI commands.
For the full list of commands and flags, run
anvil --help
anvil <command> --helpconfigure
Set up your default Anvil server, editor preferences, and login.
anvil configureUse this when:
- you are setting up the CLI for the first time
- you want to run the guided setup again
- you want the guided setup instead of configuring pieces manually
checkout
Checkout an Anvil app locally using the interactive picker, the app’s URL in ANvil, or the app ID.
Alias: anvil co
anvil checkout [input] [directory]
anvil co [input] [directory]Key options:
-O, --open: open the app folder after checkout. If a preferredEditor is set, the app folder will open in that editor.-b, --branch <BRANCH>: check out a specific branch-Q, --query <QUERY>: prefill the interactive search
Examples:
anvil checkout https://anvil.works/build/apps/W36XUTXGNPDK6VEA my-app
anvil checkout W36XUTXGNPDK6VEA my-app --url anvil.works
anvil co -Q "dashboard"Use this when:
- you want a fresh local copy of an app
- you want interactive app selection
- you want to start from an app URL copied from Anvil
If you need to work across multiple accounts or Anvil installations, see Advanced.
watch
Keep your local app folder synced with Anvil while you work.
anvil watch [path]Key options:
-A, --appid <APP_ID>: specify the app directly-s, --staged-only: sync only staged files-a, --auto: automatically handle some branch and sync transitions-O, --open: open the watched path in your preferred editor
Use this when:
- you want local edits to sync to Anvil
- you want compatible Anvil changes to sync back to your local files
- you are doing normal day-to-day local development
Other useful commands
Login and account fixes
anvil loginto log in again, or to a specific installation such asanvil login anvil.company.comanvil logoutif the CLI is using the wrong account
Config commands
anvil config listto check which server URL and CLI settings are currently in effectanvil config set <key> <value>to update a config value directlyanvil config get <key>to inspect one config value directlyanvil config resetto reset CLI configuration back to its defaults and clear saved logins
Troubleshooting and maintenance
anvil versionwhen troubleshootinganvil updateif the CLI tells you a newer version is availableanvil help <command>oranvil <command> --helpfor full command details
Do you still have questions?
Our Community Forum is full of helpful information and Anvil experts.