API & State — Avora CLI
Control which Avora backend the CLI uses and where it saves authentication and project-tracking data.
Task
Choose a stable API base URL and, when needed, move CLI state to a writable or isolated directory.
Prerequisites
- The URL of the Avora backend you intend to use.
- A writable local directory for CLI state.
Find This in Your Terminal
The API URL is resolved in this order:
- The command's
--api <url>option. - The
AVORA_API_URLenvironment variable. - The API URL saved during the last login.
http://localhost:8000.
State is stored in the first writable location in this order:
- The directory set by
AVORA_CLI_HOME. ~/.avora-cli..avora-cliin the current directory.
The state filename is projects.json.
Steps
Set an API URL for the current shell:
export AVORA_API_URL="https://api.example.com"
avora login
Or override it for one login:
avora login --api https://api.example.com
To isolate CLI state in a specific directory:
export AVORA_CLI_HOME="/path/to/avora-state"
avora projects
Expected Result
Future authenticated requests use the saved login endpoint unless a command or environment variable overrides it. The state file contains authentication tokens plus tracked Avora and Git project locations.
Next Step
Use Pull Code to pull an Avora project, or Connect Repository to connect a repository.
Troubleshooting
- If the CLI still reaches the wrong server, check for an existing
AVORA_API_URLvalue because it takes priority over the saved login URL. - If state appears to reset between commands, verify that each shell uses the same
AVORA_CLI_HOMEvalue. - If the state file is invalid JSON, move it aside and sign in again; tracked project entries must then be recreated.