fusabase-cli
v26.1.1
Published
Command-Line Interface to perform Fusabase Console Operations
Keywords
Readme
Oracle® Backend for Firebase (Fusabase) CLI
Command-line interface for managing Fusabase projects over ORDS — authenticate, select a project, and manage backend resources from your terminal.
- Package:
fusabase-cli - Binary:
fusabase - Requires: Node.js 18+
Installation
From source (development):
- Clone this repo
npm installnpm linkfusabase --help
From npm (when published):
npm i -g fusabase-cli
Getting Started (Quick Start)
- Configure your ORDS host and schema
Create a fusabase.config.js in the project root (the folder you'll run commands from):
module.exports = {
host: 'https://<ords-host>/ords/<schema>/'
}Notes:
- Include
/ords/<schema>/and keep the trailing slash. - If your ORDS is configured with multiple databases, point to the appropriate schema and db pool.
- This value is used as the base URL for all API calls.
- Authenticate and set your session
Interactive (recommended):
fusabase initWhat it does:
- Prompts for ORDS
clientIdandclientSecret(with SQL Developer Role) - Exchanges them for an access token and stores it locally (see “Session file” below)
- Fetches your accessible projects and lets you choose one to use
- Prompts for ORDS
Non‑interactive:
fusabase login <clientId>:<clientSecret> fusabase list-projects fusabase use <projectId>
- Run commands against the selected project. See below and
fusabase <cmd> --helpfor details.
Configuration: fusabase.config.js
- Location: project root
- Purpose: Set the ORDS base endpoint for the CLI.
- Example:
module.exports = {
host: 'https://myhost.example.com/ords/user2/'
}Troubleshooting:
- If you see
fusabase error: host not set!, ensurefusabase.config.jsexists and thehostis correct with a trailing slash.
Session file (hidden)
After init or login, the CLI stores transient session state in a hidden file in your project directory.
Canonical filename:
.fusabase.confFormat (key=value per line):
access_token=... exp=2025-11-06T08:17:24.976Z projectId=... projectName=...
Behavior:
- Tokens are considered expired slightly early for safety; expired tokens trigger re‑authentication.
- Delete the file to force a fresh login.
Security:
- Do not commit this file; add
.fusabase.confto your.gitignore.
Common Commands
All commands support --help for detailed usage and examples.
fusabase --help|fusabase --versionfusabase init- Interactive login + project selection. Stores access token and chosen project in the session file.
fusabase login <clientId>:<clientSecret>- Direct token exchange. Pair with
list-projectsanduseto select a project.
- Direct token exchange. Pair with
fusabase list-projects- Lists projects accessible to the authenticated user.
fusabase use <projectId>- Sets the current project in the session file.
fusabase create-project- Prompts for a project name and creates it in the connected schema.
Additional areas (see docs/commands.md or --help for each command):
set-auth,auth,set-objs,database,storage,indexes,function,application,cel,member,delete-project,generate
Documentation
Refer to the Documentation here.
Troubleshooting
Host not set
- Error:
fusabase error: host not set! - Fix: Ensure
fusabase.config.jsexists andhostincludes/ords/<schema>/with trailing slash.
- Error:
Invalid/expired token
- Errors may include “Invalid or expired token” or prompts to re‑authenticate.
- Fix:
fusabase initorfusabase login <clientId>:<clientSecret>(or delete.fusabase.confand re‑auth).
Contributing
This project welcomes contributions from the community. Before submitting a pull request, please review our contribution guide.
Security
Please consult the security guide for our responsible security vulnerability disclosure process.
Development
- Install deps:
npm install - Run tests:
npm test(jest) - Format:
npm run format
License
Copyright (c) 2015, 2026, Oracle and/or its affiliates.
This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
If you elect to accept the software under the Apache License, Version 2.0, the following applies:
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
